Given regression equation Y=Xβ + ε which satisfies all classical assumptions including those of homoscadasticity
Estimated regression equation using OLS is the following -
Y=Xb + e
Where, b is the OLS estimator for β and e is the estimated residual term for equation where E(e|x) =0
Note: b=(X'X)$^{-1}$X'Y
We can find, Cov(b,e|x) = E(b.e|x) - E(b).E(e|x)
=E(b.e|x) = E((X'X)$^{-1}$X'Y.e|x)=E((X'X)$^{-1}$X'(Xβ + ε).e|x)
=E((β.e + (X'X)$^{-1}$X'ε.e)|x)
=(X'X)$^{-1}$X'E(ε.e)
Solving for E(ε.e) gives σ²(n-k) [I wrote e= Y-Xb, substituting for b and some manipulation gave me e= ε + X(X'X)$^{-1}$X'ε]
This gives Cov(b,e|x)=(X'X)$^{-1}$X'σ²(n-k)
I think in this expression - (X'X)$^{-1}$X' - I shouldn't have X' in the right (as the formula of var(b) suggests). What am I missing?