Estimating slope of regression using OLS vs Cov(x,y)/var(x)

least squaresregression

Is there a difference between estimating the slope of a line using OLS vs calculating the slope using the formula Cov(x,y)/var(x) ? . If these methods are different, what are the advantages of using either?

Best Answer

If we are talking about simple linear regression, the formula you mention is the least squares solution. You can use it when the model contains intercept and only one feature, otherwise, you need the solution for the matrices.

Related Question