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.