AP® Statistics · Unit 5 · Topic 5.4

Residuals

A residual is the leftover piece a regression line misses: observed y minus predicted y-hat. Its sign and size tell you whether the line overshot or undershot, and by how much.

Every regression line makes a prediction, y-hat, for each x-value. But real data rarely sits exactly on the line. The residual captures that gap: residual = observed y - predicted y-hat. If the point sits above the line, the residual is positive, the line underestimated. If the point sits below the line, the residual is negative, the line overestimated. A residual of zero means the line nailed that point exactly.

The direction matters as much as the size. Residuals are always measured vertically, straight up or down from the point to the line, because y-hat is a prediction of y based on x, and we care about how far off that prediction was in the y-direction. The shortest distance from a point to the line would usually cut across at an angle, but that distance mixes up errors in x and y in a way that doesn't match what the line is actually predicting. Only the vertical gap isolates the prediction error.

Residuals are where the real diagnostic work of regression happens. A least-squares line is chosen specifically to make the sum of squared residuals as small as possible, so every residual is a piece of that minimization. Plotting all the residuals against x, in a residual plot, is how you check whether a straight line was ever the right model: patternless scatter around zero means the line fits well, while curves or fans in the residuals expose problems the scatterplot alone might hide.

Key terms

Residual
Observed y minus predicted y-hat for a given x-value.
Predicted value (y-hat)
The y-value the regression line gives for a particular x.
Least-squares line
The regression line chosen to minimize the sum of the squared residuals.
Residual plot
A scatterplot of residuals against x, used to check whether a linear model fits well.

Watch it explained

  1. How it worksHow does each residual measure the vertical miss between observed and predicted?
  2. Worked exampleFind the residual at x = 6 when the observed y is 14 and y-hat is 3.4 + 1.7x.
  3. Common mistakeWhy isn't a residual the shortest distance from the point to the line?
  4. Going furtherWhat happens to all the residuals when the line gets shifted up by one unit?

Check yourself

Your turn1 of 2
Find the residual at x = 11 when the observed y is 42 and y-hat = 8 + 2x.

End of topic.