AP Statistics · Topic 5.4 · Reading guide, about 5 min

Prediction errors and residual plots

Compute and interpret residuals, and read a residual plot to judge whether a linear model fits the data.

In one minute

A regression line predicts, and predictions are rarely perfect. The gap between what actually happened and what the line predicted is called a residual. Residuals tell you how large the prediction errors are, and plotting them shows whether a line was the right kind of model.

This topic is about reading errors: interpret one residual in context, and read the overall pattern of residuals in a plot.

Key terms

Residual
Observed y minus predicted y: y−y^y - \hat{y}. It is the prediction error for one individual.
Positive residual
The observed value is above the line, so the line underpredicts for that point.
Negative residual
The observed value is below the line, so the line overpredicts for that point.
Residual plot
A scatterplot of residuals (vertical axis) against x or against predicted values (horizontal axis).
Random scatter
Residuals scattered with no pattern around the horizontal line at 0, which supports a linear model.
Curved pattern in residuals
A systematic bend, such as a U shape, which suggests a line is not the best model for the data.
Predicted value y^\hat{y}
What the regression line gives for a given x.
Observed value y
The actual measured value for an individual.

What a residual is

For each point in the data, the residual is residual=y−y^\text{residual} = y - \hat{y}. You subtract in that order: actual minus predicted. If a student scored 80 and the line predicted 75, the residual is +5+5. If the student scored 70 and the line predicted 75, the residual is −5-5.

The sign tells you which way the line missed. A positive residual means the point lies above the line, so the line underpredicts: the prediction was too low. A negative residual means the point lies below the line, so the line overpredicts: the prediction was too high. A residual of zero means the line passed right through the point.

Interpreting a residual in context

State the sign and size in terms of the variables: "The residual is −1.0-1.0, so this player made 1 free throw fewer than the line predicted for that many practice hours." Include units and use "predicted" language. Do not call the residual an error in the person; it is the difference between the model and the observation, and every data point has one.

Residual plots

A residual plot shows residuals against x (or against predicted values). Look for pattern.

Random scatter: points spread without pattern above and below zero, with roughly the same vertical spread across the plot. This supports using a linear model, because the line has captured the trend and what is left looks like noise.

Curved pattern: residuals that run positive, then negative, then positive (a U shape), or the reverse (an arch). The line systematically misses in a predictable way, which means the relationship has curvature that a line cannot represent. Another model, not a line, would fit better. (Fitting nonlinear models is beyond this course; the key skill is recognizing the pattern.)

Because the residuals from a least-squares line always add to zero, they will always balance above and below the zero line overall. What matters is whether there is a pattern.

Reading a residual plot
What you seeWhat it suggests
Random scatter around 0, no patternA linear model is appropriate
U shape or other curveThe relationship is not linear; a line is not the best model
A residual far from the othersAn individual the line predicts poorly; look at that point

Worked example

Use the invented practice data from 5.2: weekly practice hours x and free throws made y, with points (1, 2), (2, 4), (3, 5), (4, 4), (5, 6), and the line y^=1.8+0.8x\hat{y} = 1.8 + 0.8x.

Predictions: at x=1,2,3,4,5x = 1, 2, 3, 4, 5 the line gives y^=2.6,3.4,4.2,5.0,5.8\hat{y} = 2.6, 3.4, 4.2, 5.0, 5.8.

Residuals (y−y^y - \hat{y}): 2−2.6=−0.62 - 2.6 = -0.6, 4−3.4=0.64 - 3.4 = 0.6, 5−4.2=0.85 - 4.2 = 0.8, 4−5.0=−1.04 - 5.0 = -1.0, 6−5.8=0.26 - 5.8 = 0.2. They add to −0.6+0.6+0.8−1.0+0.2=0-0.6 + 0.6 + 0.8 - 1.0 + 0.2 = 0, as expected for the least-squares line.

Interpretation of one residual: for the player who practiced 4 hours, the residual is −1.0-1.0. This player made 1 fewer free throw than the line predicted (4 made versus 5.0 predicted), so the line overpredicted for this player. For the player at 3 hours, the residual is +0.8+0.8: the player made 0.8 more than predicted, so the line underpredicted.

Residual plot: plotting the residuals −0.6,0.6,0.8,−1.0,0.2-0.6, 0.6, 0.8, -1.0, 0.2 against hours shows no clear curve or fan (a spread that widens across the plot). With only five points we cannot say much, but nothing suggests a line is inappropriate.

Contrast: for the points (−2,4)(-2, 4), (−1,1)(-1, 1), (0,0)(0, 0), (1,1)(1, 1), (2,4)(2, 4) on a curve, the best line is y^=2\hat{y} = 2, and the residuals are 2,−1,−2,−1,22, -1, -2, -1, 2. They are positive at both ends and negative in the middle, a U shape. That curved pattern in the residual plot tells us a line is a poor model here.

How it connects

  • Back to 5.3: a prediction y^\hat{y} is one piece of a residual; y−y^y - \hat{y} compares it to what happened.
  • Back to 5.1 and 5.2: a curved scatterplot shows the same problem a residual plot makes clearer, and r alone cannot detect it, since a curved pattern can have a high r or an r near 0.
  • Forward to 5.5: the least-squares line is the one that makes the sum of squared residuals as small as possible.

Common mistakes

  • Subtracting in the wrong order. Residual equals observed minus predicted. Reversing it flips the sign and the meaning.
  • Mixing up over- and underprediction. A negative residual means the line predicted too high (overpredicted); a positive residual means it predicted too low.
  • Looking only at r. A high r can hide curvature; the residual plot reveals it.
  • Expecting a residual plot to show the trend. A good plot shows no trend at all.

How it shows up on the exam

  • A residual to compute or interpret in context, including the sign and what it says about the prediction.
  • A residual plot to judge whether a linear model is appropriate, with a specific reason (random scatter or a curved pattern).
  • A short explanation of what a given pattern in a residual plot suggests about the relationship.

Check yourself

  1. A line predicts 62 and the observed value is 58. What is the residual, and does the line over- or underpredict?
  2. Why does a U shape in a residual plot mean a line is the wrong kind of model?
  3. What should a residual plot look like if a linear model is a good choice?
  4. Why do the residuals from the least-squares line always sum to zero, and does that make the model good?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.