I wanted to compute Beta for a Stock against an Index (Say Stock X against S&P 500).
I computed the daily returns for over one year applied the following logic :
Beta = COVAR(X, S&P 500)/VARP(S&P 500)
COVAR : Returns Covariance, the average of the products of deviations for each data point pair. VARP : Variance of the entire population.
The problem I run into is, X has few missing data points, and the daily returns has lot of NAN, hence I seem to get some bad COVAR.
Linear Regression was suggested here, I would like to know how Linear Regression can solve the bad data issue here, also how different is Beta computation using COVAR and Linear Regression.