0
$\begingroup$

I needed some help trying to understand why the sum of the observed values $Y_i$ equals the sum of the estimated values $\hat{Y}_i$.

$\endgroup$
0
$\begingroup$

Let us consider the special case of a simple linear regression.

Minimizing the sum of squared residuals $S=\sum_{r=1}^{n}(y_{r}-a-b x_{r})^{2}$ w.r.t. $a$ and $b$ gives the "normal equations" (first order conditions) $$ \sum_{r=1}^{n}y_{r}=na+b\sum_{r=1}^{n}x_{r}\quad\text{and}\quad\sum_{r=1}^{n}y_{r}x_{r}=a\sum_{r=1}^{n}x_{r}+b\sum_{r=1}^{n}x_{r}^{2}. $$ The fitted values are $\hat{y}_{r}=a+bx_{r}$, with residuals $$\hat{u}_{r}=y_{r}-(a+bx_{r})$$ Consider $$\sum_{r=1}^{n}\hat{u}_{r}=\sum_{r=1}^{n}y_{r}-\sum_{r=1}^{n}\hat{y}_{r}=\sum_{r=1}^{n}y_{r}-\sum_{r=1}^{n}(a+bx_{r})=\sum_{r=1}^{n}y_{r}-na-b\sum_{r=1}^{n}x_{r}.$$ Now, substitute $\sum_{r=1}^{n}y_{r}$ for the first normal equation.

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.