3
$\begingroup$

Yahoo calculates the Beta by using 3 years of monthly returns and using the S&P 500 as a market proxy but I cannot seem to replicate this or even get close using R. I downloaded the data from Yahoo from 12/01/2014 to 12/01/2017 for NKE and GSPC and take the adjusted closing price (either that or just closing price they both should at least be fairly close to the beta if the calculation is done correctly). Then I do the following

>nike = read.csv("NKE.csv")
>sp = read.csv("^GSPC.csv")
>nikeAC = nike$Adj.Close
>spAC = sp$Adj.Close
> niker = rep(0,36)
> 
> for (i in 1:36){
+     niker[i] = (nikeAC[i+1]-nikeAC[i])/nikeAC[i]
+ }
> 
> spr = rep(0,36)
> 
> for (i in 1:36){
+     spr[i] = (spAC[i+1]-spAC[i])/spAC[i]
+ }
> cov(spr,niker)/var(spr)

and get an output of -1.21 when the Beta is supposed to be around .54. I would also like to add that they don't use an adjusted Beta so I should be getting something close to .54 as I've checked other sites and they seem to be within the .54 -.64 range generally.

$\endgroup$
  • 1
    $\begingroup$ Are you using the last 36 days or the last 36 months? $\endgroup$ – noob2 Dec 21 '17 at 7:21
  • 1
    $\begingroup$ Last 36 months, under the Historical Data tab you can have Yahoo display the "Monthly" data $\endgroup$ – Dmitriy Dec 21 '17 at 7:56
  • $\begingroup$ Is that indexing correct? You are asking for spAC[37]. $\endgroup$ – dm63 Dec 21 '17 at 9:29
  • $\begingroup$ Hmm... I did the calculation by hand with Excel, . I got Covar=-0.00103, Var= 0.000852 and $\beta$=-1.213 like you did. The prices of NKE look a little wierd, did it really go to 109 in 8/1/2015 and then 59.66 in 9/1/2015 ? Without that datapoint it would be more reasonable. $\endgroup$ – noob2 Dec 21 '17 at 9:46
4
$\begingroup$

You need returns for 36 months, in particular data from 37 months. Yahoo also uses unadjusted closing prices for the reference index as far as i know. The data from 8/1/2015 got to be an error, I checked multiply data sources and found no similarities. After interpolating that point i got a beta of 0.48.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.