Residuals Math Example 2

Follow the full solution, then compare it with the other examples linked below.

Example 2

medium
Five observed and predicted values: (y,y^)(y, \hat{y}): (10,8),(15,14),(12,13),(20,19),(8,11)(10,8), (15,14), (12,13), (20,19), (8,11). Calculate all residuals, verify they sum to 0, and compute โˆ‘ei2\sum e_i^2.

Solution

  1. 1
    Residuals: e1=10โˆ’8=2e_1=10-8=2; e2=15โˆ’14=1e_2=15-14=1; e3=12โˆ’13=โˆ’1e_3=12-13=-1; e4=20โˆ’19=1e_4=20-19=1; e5=8โˆ’11=โˆ’3e_5=8-11=-3
  2. 2
    Sum of residuals: 2+1+(โˆ’1)+1+(โˆ’3)=02+1+(-1)+1+(-3) = 0 โœ“ (confirms a valid LSRL)
  3. 3
    โˆ‘ei2=4+1+1+1+9=16\sum e_i^2 = 4+1+1+1+9 = 16
  4. 4
    The LSRL minimizes this sum of 16 โ€” any other line would produce a larger โˆ‘ei2\sum e_i^2

Answer

Residuals: 2,1,โˆ’1,1,โˆ’32,1,-1,1,-3; sum=0; โˆ‘ei2=16\sum e_i^2=16.
The sum of residuals from the LSRL always equals zero (because the LSRL passes through (xห‰,yห‰)(\bar{x},\bar{y})). The sum of squared residuals (SSE) is what the LSRL minimizes โ€” this is the defining property of the least-squares method.

About Residuals

The difference between an observed value and its predicted value from a regression model: residual=yโˆ’y^\text{residual} = y - \hat{y} (observed minus predicted).

Learn more about Residuals โ†’

More Residuals Examples