Beta Equation (Stocks)

Beta Equation (Stocks)
The calculation of beta in stocks is done as follows:
[(n) (sum of (xy)) ]-[(sum of x) (sum of y)]
[(n) (sum of (xx)) ]-[(sum of x) (sum of x)]
Here: n = # of observations (24-60 months)
x = return rate for the S&P 500 Index
y = return rate for the stock