Residuals and residual plots

Lessons and exercises follow the school system and stay in its language.Les leçons et les exercices suivent le système scolaire et restent dans sa langue.Lektionen und Übungen folgen dem Schulsystem und bleiben in seiner Sprache.

About this lesson

Integrated Math I › Descriptive statistics: two variables

To save a PDF, choose “Save as PDF” in the print dialog.

Sources and credits

Written with this source as a starting point:

sedifier rewrote the text and added its own examples and exercises.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits

Residuals and residual plots

Descriptive statistics: two variables. two-way tables, scatterplots, correlation, line of best fit, residuals

Warm-up

Three quick questions from earlier lessons.

  1. r=0.6r = 0.6, sx=15s_x = 15 and sy=16s_y = 16. Find the slope of the least-squares regression line of yy on xx.
  2. The least-squares line has slope 33, and xˉ=20\bar{x} = 20, yˉ=12\bar{y} = 12. Find its intercept.
  3. The regression line is y^=29+2x\hat{y} = 29 + 2x. Predict yy for x=3x = 3.

Discover

The model predicts 70 for a student who actually scored 76. Is the student above or below the line, and by how much?

  1. 6 above
  2. 6 below

Key idea

Residuals show what the line misses.

Residual = observed −- predicted =y−y^= y - \hat{y}. Positive: point above the line. A residual plot (residuals against xx) should look like random scatter around 0; a curve or a fan shape means a linear model is not appropriate.

Worked example

y^=12+3x\hat{y} = 12 + 3x; the data point is (5,30)(5, 30).

y^=27\hat{y} = 27
Predicted.
Residual =30−27=3= 30 - 27 = 3
Observed − predicted.
The point is 3 above the line
Positive.

Your turn, guided

Your turn: same line, point (4,20)(4, 20).

Residual −4-4
20 − 24.

Practice ★

  1. y^=30+3x\hat{y} = 30 + 3x. A data point is (7,46)(7, 46). Find its residual.
  2. y^=36+4x\hat{y} = 36 + 4x. A data point is (3,41)(3, 41). Find its residual.
  3. y^=32+6x\hat{y} = 32 + 6x. A data point is (7,70)(7, 70). Find its residual.

Watch out!

Practice ★★

  1. The residual plot of a linear model fitted to 56 points shows a clear U-shaped curve. What does that tell you?
    1. A straight line is not a good model: the relationship is curved
    2. The model is good, because residuals are both positive and negative
    3. There is one outlier
  1. A point has residual +8+8. Where is it relative to the regression line?
    1. 8 units above the line: the model underpredicts it
    2. 8 units below the line
    3. On the line

Exit ticket

Three questions to check you have got it.

  1. y^=30+3x\hat{y} = 30 + 3x. A data point is (7,46)(7, 46). Find its residual.
  2. y^=36+4x\hat{y} = 36 + 4x. A data point is (3,41)(3, 41). Find its residual.
  3. y^=32+6x\hat{y} = 32 + 6x. A data point is (7,70)(7, 70). Find its residual.

Summary card

Residuals

  • e=y−y^e = y - \hat{y}; positive is above the line.
  • Residual plot: no pattern means a linear model is appropriate.

Watch out: observed minus predicted, in that order.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. A least-squares line is fitted to three points. Two residuals are 3 and −7-7. What is the third residual?
Sources and credits

Written with this source as a starting point:

sedifier rewrote the text and added its own examples and exercises.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits