I am trying to quantify a stock's beta (bench marked vs. SPY) in R using the PerformanceAnalytics CAPM.beta() function and the results aren't even close to the values I am seeing online at Yahoo/Google Finance. The code:
require(PerformanceAnalytics)
start_date <- "2013-08-24"
acad <- getSymbols("ACAD", from = start_date, auto.assign = F)
spy <- getSymbols("SPY", from = start_date, auto.assign = F)
CAPM.beta(acad[,6], spy[,6])
For the above example, Yahoo/Finviz/Google all list ACAD's beta at 2.6 to more than 3.0. While I am not sure what the lookback period is for each site, changing the value in the above code produces a beta value of less than 1 for 1,2,3 yr lookbacks.
Similarly, by trying to calculate the beta using lm(), I am getting ie 0.39 beta for ACAD ~ SPY 2 year lookback:
m <- lm(acad[,6] ~ spy[,6] + 0)
beta <- coef(m)[1]
beta
what am I missing?
Beta is calculated in terms of returns, often montly. You do want the intercept term (alpha) in the model fit when using
lm
.Beta calculated for 36 months of adjusted month-end close is about 2.6 in this case.