# Mean of residuals = 0

#### wenhotbabe2

##### New Member
Hey im having trouble proving the mean of the residuals must always be zero.
Can someone help me with this?

Thanks

#### LukeV

##### New Member
Well assuming you know how to show the sum is 0. The mean is Sum(ei) / n. Which is clearly 0.

#### Dragan

##### Super Moderator
Hey im having trouble proving the mean of the residuals must always be zero.
Can someone help me with this?

Thanks
For a simple regression it is straight forward since you can express the slope intercept form of the model as:

Yhat = b0 + b1*X
Yhat = YBar + R*(Sy/Sx)*(X - XBar)

And, the Error (E) terms are expressed as:

E=(Y - Yhat)

SumE=Sum(Y - Yhat)

SumE=Sum(Y - YBar + R*(Sy/Sx)*(X - XBar) )

SumE=SumY - SumYBar + R*(Sy/Sx)*Sum(X - XBar)

SumE=N*YBar - N*YBar + 0 = 0,

because the summation of a constant N times is N times that constant (N*YBar) and Sum(X - XBar) = 0.

Thus, as indicated above, if the sum of the error terms are zero, so will the mean.