Regression – Understanding Identity in Simple Linear Model

linear modelregressionself-study

I'm working on this identity
$$\sum_{i-1}^n (y_i – \hat {\beta_0} – \hat {\beta_1}x_i)^2 = \sum_{i=1}^n y_i^2 – \hat {\beta_0}\sum_{i=1}^n y_i – \hat {\beta_1} \sum_{i=1}^n x_iy_i$$

I have these relationships to work with:

$$\hat {\beta_1} = \frac { n\sum_{i_1}^n x_iy_i – \left ( \sum_{i=1}^n x_i \right ) \left ( \sum_{i=1}^n y_i \right )}{ n \left ( \sum_{i=1}^n x_i^2 \right ) -\left (\sum_{i=1}^n x_i \right )^2 }$$

$$ \hat {\beta_0}= \overline {y} – \hat {\beta_1} \overline {x}$$

A little manipulation also shows

$$\hat {\beta_1}= \frac { \sum_{i=1}^n ( x_i – \overline {x}) y_i}{ \left ( \sum_{i=1}^n x_i^2 \right ) -n \overline {x}^2 }$$

My strategy has to substitute $\hat {\beta_1}$ out of the equation, but I just keep getting $\overline {y}$ in too many terms and not any terms with $y_i$. The formula for $\hat {\beta_1}$ is too complicated to consider working with. What am I missing?

Best Answer

OK, I will do some parts and leave the rest for you to do it yourself. I dropped the index of summations for simplicity. Start from expanding the L.H.S to have $$L.H.S=\sum y_i^2+\sum(\hat{\beta_0}+\hat{\beta_1}x_i)^2-2\hat{\beta_0}\sum y_i-2\hat{\beta_1}\sum (y_ix_i)$$ which is $$L.H.S=\Big[\sum y_i^2-\hat{\beta_0}\sum y_i-\hat{\beta_1}\sum (y_ix_i)\Big]+\sum(\hat{\beta_0}+\hat{\beta_1}x_i)^2-\hat{\beta_0}\sum y_i-\hat{\beta_1}.\sum (y_ix_i).$$ Now what we have inside the bracket is actually the R.H.S. So you need to show that the rest is zero i.e. $$\sum(\hat{\beta_0}+\hat{\beta_1}x_i)^2-\hat{\beta_0}\sum y_i-\hat{\beta_1}\sum (y_ix_i)=0.$$ Now to show this, I will give you some hints. You need to do them correctly and step by step.

  1. Replace $\hat{\beta_0}$ by $\bar{y}-\hat{\beta_1}\bar{x}$ to re-write it all based on $\hat{\beta_1}$.
  2. Expand the terms and simplify (some terms will be canceled out).
  3. Now use two facts:
    (1): $\hat{\beta_1}=\dfrac{S_{xy}}{S_{xx}},$ where $S_{xy}=\sum(x_i-\bar{x})(y_i-\bar{y})$ and $S_{xx}=\sum(x_i-\bar{x})^2$ and
    (2): $S_{xy}=\sum (x_iy_i)-\dfrac{\sum x_i .\sum y_i}{n}$
    to write everything in terms of $S_{xy}$ and $S_{xx}$.
  4. Simplify to show that it is zero.
Related Question