Learn R Programming

bdrift (version 1.2.2)

BDA.loader: Beta Drift Anaylsis Data Loader

Description

BDA.loader prepares a data frame to be used by the BDA function.

Usage

BDA.loader(symbol, frequency = "monthly", xbench = NA, type = "log", ...)

Arguments

symbol
stock ticker on Yahoo Finance, enter as character.
frequency
the frequency used to calculate returns ("daily", "monthly", or "yearly")
xbench
ticker symbol of an external benchmark, NA by default.
type
type of returns to be calculated ("log" or "arithmetic"). By default, log returns are used.
...
aditional commands passed to the getSymbols function.

Value

a xts-matrix containing the returns of the security, Kenneth French's asset pricing factors and the external benchmark (optional).

Details

BDA.loader pulls stock price data from Yahoo Finance, calculates returns on these prices, downloads factor data from Kenneth French's library (via Quandl.com) and bundles all data in a xts-matrix that can be passed on to the BDA function.

Examples

Run this code
testframe <- BDA.loader(symbol = "XOM")

Run the code above in your browser using DataLab