[Math] Variance of residuals from simple linear regression

covarianceregressionregression analysisstatistics

I am trying to compute $Var(e_i)$.

So far I have

$Var(e_i)=Var(y_i-\hat y_i)=Var(y_i)+Var(\hat y_i)-2cov(y_i,\hat y_i)$

Now, I know that

$Cov(y_i,\hat y_i)=var(\hat y_i)$

but how do I prove this? (without using matrices)

But anyway, from there I have $Var(e_i)=var(y_i)-var(\hat y_i)=
\sigma^2 -var(\overline y+\hat \beta_1 (x_i-\overline x))$

$=\sigma^2-var(\overline y)-(x_i-\overline x)^2var(\hat\beta_1) -2cov(\overline y,\hat \beta_1 )(x_i-\overline x)$

$\sigma^2-var(\sum y_i /n) – (x_i-\overline x)^2\sigma^2\sum(x_i-\overline x)^2$

$var(\sum y_i /n)=\sum(var(y_i))n^2 = \sigma ^2 / n$

So I end up with $Var(e_i)=\sigma^2(1-(1/n)-(x_i-\bar x)^2\sum (x_i-\overline x)^2)$

Is this correct?

Best Answer

The (Estimated) Variance of residuals in an OLS regression is simply: $$ Var(e)=\frac{e'e}{n-(k+1)} $$ where $k+1$ is the number of regressors (plus a constant).