AP · Statistics · Linear Regression

Residuals, Residual Plots and r²

15 min readUpdated November 30, 2026FreeAP Statistics, Exploring Two-Variable Data

A residual is the actual value minus the value a regression line predicts, y−y^y - \hat{y}: positive means the point lies above the line, negative means it lies below. A residual plot with no pattern says a linear model is appropriate. The standard deviation of the residuals, ss, gives the typical size of a prediction error, and r2r^2 gives the fraction of the variation in yy that the line accounts for.

Quick check

  1. A line predicts quiz score from hours of study as y^=55+4x\hat{y} = 55 + 4x. What does it predict for 3 hours?Show answerHide answer

    6767, because 55+4(3)=6755 + 4(3) = 67.

  2. A point lies above a regression line. Is its actual yy greater or less than the predicted y^\hat{y}?Show answerHide answer

    Greater. Above the line means the actual value is bigger than what the line predicts at that xx.

Know these already? Jump to the practice questions

What you'll be able to do

  • Calculate a residual and interpret its sign and size in context.
  • Justify from a residual plot whether a linear model is appropriate.
  • Calculate and interpret ss as a typical prediction error.
  • Interpret r2r^2 in context.

Key terms

Residual

For one data point, residual =y−y^= y - \hat{y}: the actual value of the response minus the value the regression line predicts.

In plain English
How far the point sits above (positive) or below (negative) the line.
Don't write
"residual =y^−y= \hat{y} - y"; that flips every sign.

Standard deviation of the residuals (ss)

The typical distance between the actual values of yy and the values the regression line predicts.

In plain English
How far off the line's predictions usually are.
Don't write
"ss is the standard deviation of yy"; it measures spread around the line, not around yˉ\bar{y}.

Coefficient of determination (r2r^2)

The fraction of the variation in the response that is accounted for by the least-squares line with the explanatory variable.

In plain English
How much better the line predicts than using yˉ\bar{y} for everyone.
Don't write
"the percent of predictions that are correct".

What does a residual tell you?

Learn this (it is not on the formula sheet):

residual=y−y^=actual−predicted\text{residual} = y - \hat{y} = \text{actual} - \text{predicted}

Substitute the point's xx into the regression equation to get y^\hat{y}, then subtract it from the actual yy. A positive residual means the point is above the line, so the line underestimated. A negative residual means the point is below the line, so the line overestimated.

Interpret a residual with the variables, the units and the direction. If y^=412−14.5x\hat{y} = 412 - 14.5x predicts reaction time (milliseconds) from hours of sleep, an adult who slept 6 hours is predicted 412−14.5(6)=325412 - 14.5(6) = 325 milliseconds. If that adult's time was 340 milliseconds, the residual is 340−325=15340 - 325 = 15: a reaction time 15 milliseconds slower than predicted for 6 hours of sleep.

The residuals from a least-squares line always add to 00.

Key idea

Residual = actual − predicted, so positive means the line underestimated and negative means it overestimated.

Check yourself

The line predicts y^=48\hat{y} = 48 and the actual value is y=45y = 45. What is the residual?
Show answerHide answer

−3-3, because 45−48=−345 - 48 = -3. The residual is negative, so the point is below the line.

How does a residual plot show whether a line fits?

A residual plot graphs each residual against xx (or y^\hat{y}), with a horizontal line at 00. It lays the line flat, so any pattern left over is something the line failed to capture.

  • No pattern: the residuals scatter randomly above and below 00. A linear model is appropriate.
  • A curve: a run of positive residuals, then negative, then positive (or the reverse). The relationship is curved, so a linear model is not appropriate. The note on Influential Points and Transforming to Linearity shows how to straighten it.
  • A fan: the residuals spread out more as xx increases, so predictions are less precise for large xx.

A high r2r^2 does not rule out a curve.

Examiner's eye

Marks are lost for "the residuals are random" with no conclusion. Say there is no apparent pattern, so a linear model is appropriate for these two variables.

Check yourself

Residuals are negative for small and large xx and positive in the middle. Is a linear model appropriate?
Show answerHide answer

No. The residuals follow an upside-down U, so the relationship is curved and a straight line misses it in a systematic way.

What does ss tell you?

Learn this (Novark does not confirm it on the formula sheet):

s=∑(y−y^)2n−2s = \sqrt{\frac{\sum (y - \hat{y})^2}{n - 2}}

You divide by n−2n - 2 because the line uses two estimated values, the slope and the intercept.

Interpret it as: the actual [response] is typically about ss [units] away from the value predicted by the line using [explanatory variable]. It is also the yardstick for one residual: a residual much bigger than ss in size is an unusually large error.

Check yourself

A line predicting hypothetical commute times has s=4.2s = 4.2 minutes. Interpret ss.
Show answerHide answer

Actual commute times are typically about 4.2 minutes away from the times predicted by the regression line.

What does r2r^2 tell you?

Learn this: r2r^2 is the square of the correlation rr, and it also equals

r2=1−∑(y−y^)2∑(y−yˉ)2r^2 = 1 - \frac{\sum (y - \hat{y})^2}{\sum (y - \bar{y})^2}

The bottom sum is the variation in yy if you ignored xx and predicted yˉ\bar{y} for everyone. The top sum is the variation still left after using the line. So r2r^2 is the fraction of the variation that the line removes. If ∑(y−yˉ)2=250\sum (y - \bar{y})^2 = 250 and ∑(y−y^)2=40\sum (y - \hat{y})^2 = 40, then r2=1−40250=0.84r^2 = 1 - \frac{40}{250} = 0.84.

Interpret it as: about 84 percent of the variation in [response] is accounted for by the linear model relating [response] to [explanatory variable]. r2r^2 has no units, and it says nothing about whether a line is the right shape.

Key idea

ss gives the typical prediction error in the units of yy; r2r^2 gives the fraction of the variation in yy that the line explains.

Check yourself

For hypothetical data on hours of screen time xx and hours of sleep yy, r=−0.7r = -0.7. Calculate and interpret r2r^2.
Show answerHide answer

r2=0.49r^2 = 0.49. About 49 percent of the variation in hours of sleep is accounted for by the linear model relating sleep to screen time.

Worked example 1: Reading the residuals

Question: A hypothetical test measured the stopping distance yy (feet) of one car at five speeds xx (miles per hour): (20,38)(20, 38), (30,66)(30, 66), (40,100)(40, 100), (50,144)(50, 144) and (60,196)(60, 196). The least-squares line is y^=−48.8+3.94x\hat{y} = -48.8 + 3.94x, with r2=0.985r^2 = 0.985. Calculate the five residuals and decide whether a linear model is appropriate.

What tells you the method

"appropriate" means judge the pattern in the residuals, not the size of r2r^2.

  1. Step 1: Predict at each speed.

    y^=30\hat{y} = 30, 69.469.4, 108.8108.8, 148.2148.2 and 187.6187.6 feet.

    Why

    Substitute each xx into the equation, for example −48.8+3.94(20)=30-48.8 + 3.94(20) = 30.

  2. Step 2: Subtract.

    Residuals: 38−30=838 - 30 = 8, 66−69.4=−3.466 - 69.4 = -3.4, 100−108.8=−8.8100 - 108.8 = -8.8, 144−148.2=−4.2144 - 148.2 = -4.2 and 196−187.6=8.4196 - 187.6 = 8.4.

    Why

    Each residual is actual minus predicted.

  3. Step 3: Read the pattern.

    The signs go +,−,−,−,++, -, -, -, +: the U shape in the figure "Residual plot for the stopping-distance data". The line overestimates at middle speeds and underestimates at both ends.

    Why

    A curve in the residuals means a straight line has the wrong form for these data.

Check it

8−3.4−8.8−4.2+8.4=08 - 3.4 - 8.8 - 4.2 + 8.4 = 0, as least-squares residuals must add to 00.

Answer

The residuals are 88, −3.4-3.4, −8.8-8.8, −4.2-4.2 and 8.48.4 feet. They form a curved pattern, so a linear model is not appropriate for stopping distance and speed, even though r2=0.985r^2 = 0.985.

Worked example 2: Interpreting ss and r2r^2

Question: For 20 hypothetical trees of one species, a regression of height yy (meters) on trunk diameter xx (centimeters) gives y^=3.2+0.41x\hat{y} = 3.2 + 0.41x, r=0.88r = 0.88 and s=1.6s = 1.6 meters. (a) Interpret ss. (b) Calculate and interpret r2r^2. (c) A tree with diameter 30 centimeters is 14.9 meters tall. Calculate its residual and judge whether it is unusually large.

What tells you the method

"interpret ss" and "interpret r2r^2" each have a fixed form; "residual" means actual minus predicted.

  1. Step 1: Interpret ss.

    Actual heights are typically about 1.6 meters from the heights the line predicts from trunk diameter.

    Why

    ss is the typical size of a residual, in the units of yy.

  2. Step 2: Calculate r2r^2.

    r2=0.882=0.7744r^2 = 0.88^2 = 0.7744, so about 77.4 percent of the variation in height is explained by the linear model with trunk diameter.

    Why

    Squaring rr gives the fraction of variation explained.

  3. Step 3: Find the residual.

    y^=3.2+0.41(30)=15.5\hat{y} = 3.2 + 0.41(30) = 15.5 meters, so the residual is 14.9−15.5=−0.614.9 - 15.5 = -0.6 meters.

    Why

    Actual minus predicted; the tree is shorter than predicted.

  4. Step 4: Compare with ss.

    The residual's size, 0.60.6 meters, is less than s=1.6s = 1.6 meters.

    Why

    ss is the yardstick for an ordinary prediction error.

Check it

For 0<r<10 < r < 1, squaring makes the value smaller, and 0.7744<0.880.7744 < 0.88.

Answer

(a) Heights are typically about 1.6 meters from their predicted values. (b) r2=0.7744r^2 = 0.7744: about 77.4 percent of the variation in height is explained by the linear model with diameter. (c) The residual is −0.6-0.6 meters, smaller than ss in size, so it is not unusually large.

Your turn

Question: A hypothetical line predicts jigsaw finishing time (minutes) from number of pieces. For n=6n = 6 puzzles the residuals are 1.21.2, −0.8-0.8, −1.5-1.5, 0.40.4, 1.11.1 and −0.4-0.4 minutes. Calculate ss to two decimal places and interpret it.

  1. Step 1:

    Square and add: 1.44+0.64+2.25+0.16+1.21+0.16=5.861.44 + 0.64 + 2.25 + 0.16 + 1.21 + 0.16 = 5.86.

  2. Step 2: Your go: divide by n−2n - 2, take the square root and interpret.

Show the full solutionHide the solution

s=5.866−2=1.465=1.21s = \sqrt{\dfrac{5.86}{6 - 2}} = \sqrt{1.465} = 1.21 minutes, to two decimal places.

Actual finishing times are typically about 1.21 minutes away from the times predicted by the line using number of pieces.

Answer: s=1.21s = 1.21 minutes: actual times are typically about 1.21 minutes from the predicted times.

Traps

Trap

Thinking a high r2r^2 means a linear model is appropriate.

It seems right because the line explains most of the variation. But a curved relationship can still have r2r^2 near 1, like the stopping-distance data (r2=0.985r^2 = 0.985). Only the residual plot shows whether the form is right.

Check yourself

A model has r2=0.96r^2 = 0.96 and its residual plot shows a clear curve. Is a linear model appropriate?
Show answerHide answer

No. The curve in the residuals shows the form is wrong, whatever the size of r2r^2.

Trap

Thinking residual = predicted − actual.

It seems right because you work out the predicted value first. But a residual is actual minus predicted, y−y^y - \hat{y}, so a point above the line has a positive residual.

Check yourself

The actual value is 20 and the predicted value is 23. What is the residual?
Show answerHide answer

−3-3, because 20−23=−320 - 23 = -3. The point lies below the line.

What's examined

Residuals, residual plots, ss and r2r^2 are tested on the AP® Statistics exam (Two-variable data: Exploring Two-Variable Data), in both the multiple-choice and free-response sections. Expect Calculate, Interpret and Justify, with every answer in context. A graphing calculator gives residuals and r2r^2; the credit is for interpreting them with both variables and the units.

Practice questions

  1. Recall A point has a negative residual from a least-squares line. Which statement must be true?
    • A) The actual value is greater than the predicted value.
    • B) The correlation between xx and yy is negative.
    • C) The point lies below the regression line.
    • D) A linear model is not appropriate.
Show answer

Answer: C) The point lies below the regression line.

Marking points:

  • Residual =y−y^<0= y - \hat{y} < 0, so the actual value is less than predicted and the point is below the line.
  • A reverses the sign. B confuses the sign of one residual with the direction of the association. D judges the model from one point instead of the pattern in the residual plot.
  1. Apply For a hypothetical lemonade stand, y^=−28+1.6x\hat{y} = -28 + 1.6x predicts the number of cups sold yy from the day's high temperature xx (°F). On an 80 °F day the stand sold 91 cups. Calculate the residual for that day.
Show answer

Answer: The residual is −9-9 cups: the stand sold 9 fewer cups than predicted.

Marking points:

  • y^=−28+1.6(80)=100\hat{y} = -28 + 1.6(80) = 100 cups.
  • Residual =91−100=−9= 91 - 100 = -9 cups.
  1. Apply A least-squares line has r2=0.92r^2 = 0.92, and its residual plot shows a clear U-shaped pattern. Which conclusion is correct?
    • A) A linear model is not appropriate, because the residuals show a curved pattern.
    • B) A linear model is appropriate, because r2r^2 is close to 1.
    • C) A linear model is appropriate, because some residuals are positive and some are negative.
    • D) A linear model is not appropriate, because r2r^2 is less than 1.
Show answer

Answer: A) A linear model is not appropriate, because the residuals show a curved pattern.

Marking points:

  • A systematic curve in the residuals means the relationship is not linear.
  • B trusts r2r^2, which cannot detect curvature. C is true of every least-squares line, since residuals add to 0. D reaches the right conclusion for the wrong reason: real data almost never give r2=1r^2 = 1.
  1. Apply In a hypothetical sample of used cars of one model, the correlation between age (years) and price is r=−0.9r = -0.9. Which is the correct interpretation of r2r^2?
    • A) About 90 percent of the variation in price is explained by the linear model with age.
    • B) About 81 percent of the cars lie on the regression line.
    • C) The line predicts about 81 percent of the prices correctly.
    • D) About 81 percent of the variation in price is explained by the linear model with age.
Show answer

Answer: D) About 81 percent of the variation in price is explained by the linear model with age.

Marking points:

  • r2=(−0.9)2=0.81r^2 = (-0.9)^2 = 0.81, the fraction of variation in price explained by the line.
  • A uses rr without squaring it. B treats r2r^2 as the share of points on the line. C treats it as the share of correct predictions.
  1. Exam-style For 25 hypothetical tomato plants, a regression of yield yy (kilograms per plant) on daily hours of sunlight xx gives y^=0.8+0.52x\hat{y} = 0.8 + 0.52x, r=0.75r = 0.75 and s=0.9s = 0.9 kilograms. (a) Calculate and interpret r2r^2. (b) A plant that got 8 hours of sunlight a day yielded 4.1 kilograms. Calculate its residual. (c) Using ss, decide whether this residual is unusually large.
Show answer

Answer: (a) r2=0.5625r^2 = 0.5625: about 56.3 percent of the variation in yield is accounted for by the linear model relating yield to hours of sunlight. (b) The residual is −0.86-0.86 kilograms. (c) It is not unusually large, because 0.86<0.9=s0.86 < 0.9 = s.

Marking points:

  • r2=0.752=0.5625r^2 = 0.75^2 = 0.5625, interpreted as variation in yield explained, in context.
  • y^=0.8+0.52(8)=4.96\hat{y} = 0.8 + 0.52(8) = 4.96 kilograms, so the residual is 4.1−4.96=−0.864.1 - 4.96 = -0.86 kilograms.
  • The residual's size is less than the typical prediction error ss, so this plant's yield is not unusually far from its prediction.
  1. Recall A hypothetical regression predicting 100-meter sprint time (seconds) from leg length (centimeters) has s=0.4s = 0.4 seconds. Which is the best interpretation of ss?
    • A) The sprint times have a standard deviation of 0.4 seconds.
    • B) Actual times are typically about 0.4 seconds from the times the line predicts from leg length.
    • C) Time changes by 0.4 seconds per extra centimeter of leg length.
    • D) About 40 percent of the variation in time is explained by leg length.
Show answer

Answer: B) Actual times are typically about 0.4 seconds from the times the line predicts from leg length.

Marking points:

  • ss is the typical size of a residual, in the units of yy.
  • A describes spread around the mean time, not around the line. C describes a slope. D describes r2r^2.

Key points

Recall, then reveal

Say the main points from memory first, then check them.

Show key pointsHide key points
  • Work out a residual as y−y^y - \hat{y}; a positive one sits above the line (underestimate) and a negative one below (overestimate).
  • A residual plot with no apparent pattern supports a linear model; a curve means the form is wrong, however high r2r^2 is.
  • s=∑(y−y^)2/(n−2)s = \sqrt{\sum (y - \hat{y})^2 / (n - 2)} is the typical prediction error, in the units of yy.
  • r2r^2 is the fraction of the variation in yy accounted for by the linear model with xx; it has no units.

Figures

Residual plot with speed in miles per hour on the horizontal axis and residual in feet on the vertical axis. The five residuals are 8 at 20 mph, -3.4 at 30 mph, -8.8 at 40 mph, -4.2 at 50 mph and 8.4 at 60 mph, forming a U shape around the zero line. (open full size in a new tab)
Residual plot for the stopping-distance data

Keep learning

Explore AP Statistics tutoring →

View the full Statistics syllabus →

More in this unit

Exploring Two-Variable Data

All Linear Regression notes

Part of Novark's AP Statistics notes