# Math Help - Stats help!

1. ## Stats help!

So the sum of the residuals for a linear regression=0, which makes sense thinking about it, but how would I go about proving this???
That is r(i)=y(i)-ý(i) (the second y is y hat) and the sum of all of these = 0.

Any help would be greatly appreciated!

2. Originally Posted by Jar23
So the sum of the residuals for a linear regression=0, which makes sense thinking about it, but how would I go about proving this???
That is r(i)=y(i)-ý(i) (the second y is y hat) and the sum of all of these = 0.

Any help would be greatly appreciated!
In linear regression we find $a$ and $b$ such that:

$\sum (y_i-(ax_i+b))^2$

is minimised

Therefore

$\frac{\partial}{\partial b}\sum (y_i-(ax_i+b))^2=0$

which means:

$-\ \sum 2(y_i-(ax_i+b))=0$

simplifying:

$\sum (y_i-(ax_i+b))=\sum (y_i - \hat{y}_i)=0$

RonL

3. Thanks so much. i thought it was something simple that had to do with minimizing the linear regression equation.