![The sample cross product between each one of the regressors and the OLS residuals is zero]1
Can anyone explain to me how the penultimate step leads to the final step?
![The sample cross product between each one of the regressors and the OLS residuals is zero]1
Can anyone explain to me how the penultimate step leads to the final step?
Copyright © 2021 JogjaFile Inc.
They are using the fact that $$\hat \beta_2=\frac{\sum (X_i-\bar X)(Y_i-\bar Y)}{\sum (X_i-\bar X)^2}=\frac{\sum X_iY_i-n\bar X \bar Y}{\sum X_i^2-n\bar X^2}=\frac{\frac1n\sum X_iY_i-\bar X \bar Y}{\frac1n\sum X_i^2-\bar X^2}.$$
So $$\frac1n\sum X_iY_i-\bar X \bar Y-\hat \beta_2 \left(\frac1n\sum X_i^2-\bar X^2\right)=$$ $$=\frac1n\sum X_iY_i-\bar X \bar Y- \frac{\frac1n\sum X_iY_i-\bar X \bar Y}{\frac1n\sum X_i^2-\bar X^2} \cdot\left(\frac1n\sum X_i^2-\bar X^2\right)=$$ $$=\frac1n\sum X_i Y_i -\bar X \bar Y -\left(\frac1n\sum X_i Y_i -\bar X \bar Y\right)=0.$$