Lesson 5 of 7 · 18 min

Residuals and residual plots

Calculate residuals, construct a residual plot, and use its pattern to decide whether a linear model is appropriate — even when r is close to 1.

What you will be able to do

  • Calculate a residual as the actual value minus the predicted value.
  • Construct a residual plot against the explanatory variable.
  • Use a residual plot to assess whether fitting a linear model is appropriate.

A driving instructor in Cairns measures the stopping distance of a car at eight speeds. The correlation coefficient is r=0.995r = 0.995 — about as strong as an association gets. Is a straight line the right model?

Look closely at the line. The points at the ends sit above it and the points in the middle sit below it. That pattern is the clue, and a residual plot makes it impossible to miss.

Interactive

Stopping distances

Despite r=0.995r = 0.995, the residuals go positive, negative, then positive again. The data curves upward, and a straight line can't follow it.

Definition

Residual

residual=actual value−predicted value\text{residual} = \text{actual value} - \text{predicted value}
  • A positive residual: the point is above the line (the model under-predicts).
  • A negative residual: the point is below the line (the model over-predicts).
  • A residual of 0: the point is on the line.

The residuals of a least-squares line always add to 0. The residual rule is not in the formula book.

Worked example

Calculate and interpret a residual

  • Simple familiar

For the café data, the least-squares line is

coffees sold=3.23×temperature−21.86\text{coffees sold} = 3.23 \times \text{temperature} - 21.86

On a 30 °C day the café sold 82 iced coffees. Calculate the residual for this day and explain what it tells you.

3 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Substitute the explanatory value to find the predicted value.

  2. Residual = actual − predicted.

  3. Positive: above the line (under-predicted). Negative: below (over-predicted).

Watch out for

  • Calculating predicted − actual, which gives −6.96-6.96.

Using coffees sold=3.23×temperature−21.86\text{coffees sold} = 3.23 \times \text{temperature} - 21.86, find the residual for the day when the temperature was 25 °C and the café sold 55 iced coffees.

A residual plot graphs each residual against its value of the explanatory variable. It flattens the least-squares line onto the horizontal axis, so any pattern in how the points miss the line is easy to see.

Constructing a residual plot

  1. Fit the least-squares line

    Use technology on the raw data.

  2. Find each predicted value

    Substitute every xx value into the line.

  3. Calculate each residual

    Actual −- predicted, for every point. A spreadsheet does this in one column: =B2-(slope*A2+intercept).

  4. Plot residuals against the explanatory variable

    Explanatory variable on the horizontal axis, residual on the vertical axis, with a horizontal line at 0.

Café data: the residuals are randomly scattered around 0 with no pattern, so a linear model is appropriate.

Stopping distances: the residuals form a clear U-shaped curve, so a linear model is not appropriate, even though r=0.995r = 0.995.

Key idea

Reading a residual plot

  • Random scatter around 0 with no pattern: a linear model is appropriate.
  • A clear pattern — a curve (U shape or upside-down U), or residuals that fan out: a linear model is not appropriate. The association is non-linear, so another model would fit better.

Don't over-read a few points: you are looking for a clear, systematic pattern.

A residual plot shows the residuals forming a clear upside-down U shape: negative at both ends and positive in the middle. What should you conclude?

Choose one answer

Worked example

Use a residual plot to judge a linear model

  • Complex familiar
  • Technology active

Stopping distances for a car at eight speeds are shown.

Speed (km/h)405060708090100110
Stopping distance (m)26354557708499116

Technology gives r=0.995r = 0.995 and the least-squares line distance=1.2857×speed−29.93\text{distance} = 1.2857 \times \text{speed} - 29.93.

a) Calculate the residuals at 40, 70 and 110 km/h.

b) The residual plot is shown in the lesson. Use it to decide whether a linear model is appropriate.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Find each predicted value from the line, then actual − predicted.

  2. Plot residuals against the explanatory variable.

  3. Describe the pattern (random or curved), then conclude whether a linear model is appropriate.

Watch out for

  • Concluding the model is appropriate because rr is close to 1.

  • Describing the pattern without drawing the conclusion, or the reverse.

Common mistake

High r is not proof of a linear association

rr measures how closely points follow a straight line, and points on a gentle curve can still be very close to one. The stopping distances have r=0.995r = 0.995 and a clearly curved residual plot. When the question gives you a residual plot, base your decision about linearity on it, not on rr.

A least-squares line predicts a stopping distance of 60.07 m at 70 km/h. The residual at 70 km/h is −3.07-3.07 m. What was the actual stopping distance?

in m

Exam tip

Two parts to every answer

Describe the residual plot and draw the conclusion: "The residual plot shows a clear curved (U-shaped) pattern, so a linear model is not appropriate for this data." Saying only "it's curved" or only "linear isn't appropriate" usually earns one of the two marks.

Summary

  • Residual = actual − predicted. Positive means above the line, negative means below.

  • A residual plot graphs residuals against the explanatory variable, with a line at 0.

  • Random scatter: a linear model is appropriate. A clear pattern (such as a curve): it is not.

  • rr close to 1 does not guarantee linearity. Check the residual plot.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 5 of 70% read

Save your progress with a free account