Knaph

Statistics of Two Variables88 of 1002 min read

Residuals

Hana did 12, 13, 18, 19 and 23 push-ups in a minute in weeks 1 to 5. A spreadsheet gave y^=8.6+2.8x\hat{y} = 8.6 + 2.8x. How far off is the line at each week, and what pattern in those misses shows the line is a good model?

Actual minus predicted

A residual is the miss at one data point: residual=y−y^\text{residual} = y - \hat{y}. Week 3: the line predicts 8.6+2.8⋅3=178.6 + 2.8 \cdot 3 = 17 and Hana did 18, so the residual is 18−17=118 - 17 = 1 push-up. A positive residual means the dot is above the line. A negative one means it is below. The unit is the unit of yy.

All five residuals are 0.60.6, −1.2-1.2, 11, −0.8-0.8 and 0.40.4. They add to 0, which is true for every least-squares line.

A scatter plot of Hana's 5 push-up counts with the line through them, and a short vertical segment from each dot to the line. Dots above the line are marked plus and dots below are marked minus.

The residual plot

A residual plot has xx across and the residual up. If the dots scatter at random around 0, with no pattern, a straight line is a good model. If they form a curve, the data bend and a line is the wrong model. If they fan out, the line misses by more at one end.

Two residual plots. Left: dots scattered at random above and below the zero line. Right: dots forming a U, positive at the ends and negative in the middle.

Reading the shape

Plant heights that double each week make a curved cloud. A line through them leaves positive residuals at the ends and negative ones in the middle, a U. The U says: try a curve instead.

Your turn: a person weighs 52 kg and the line predicts 49.5 kg. Answer: 52−49.5=2.552 - 49.5 = 2.5 kg, above the line.

Careful

A residual of 2.5 does not mean the line is 2.5 wrong everywhere. It is one point's miss.

Try it at home

  1. Plot 5 points of your own and draw a line through them by eye.
  2. Read the predicted value for each xx and subtract it from the actual value.
  3. Check whether your residuals roughly add to 0.

Words in this lesson

  • residual - the actual value minus the predicted value, the miss at one point.
  • residual plot - a plot of the residuals against xx.

Big idea

A residual is actual minus predicted. Random scatter around 0 in the residual plot means a line fits. A curve or a fan means a line is the wrong model.

Test your understanding

Sign in to test your understanding of this lesson and track your progress.