AP Statistics / Unit 5: Regression Analysis / Topic 5.4
NUM8ERS study notes · Topic 5.4

Residuals

How far did a prediction miss the actual result? Calculate a residual, explain its sign in context, and use residual plots to see what a straight-line model leaves unexplained.

2026–27 curriculum4 worked examples8 practice questions3 visual explanations

By the end of this lesson, you should be able to:

  • Calculate the difference between an observed response and its predicted value.
  • Explain whether a model underpredicts or overpredicts, using response units.
  • Read and construct residual plots, and use their patterns to assess a linear model.

Before you start: Review linear regression predictions. You should be comfortable substituting an explanatory value into a supplied equation.

First time learning this? Follow the delivery example from the fitted line to its residual plot, then try the worked examples.

Here to revise? Review the sign and pattern checklist, then attempt the practice questions before revealing answers.

The concept in 60 seconds

A residual is the observed response minus the response predicted by the model for the same explanatory value.

e=y−y^.e=y-\hat{y}.

Think: actual result first, prediction second. If the model predicts 3030 minutes but a delivery takes 2929 minutes, its residual is 29−30=−129-30=-1 minute.

The sign tells you the direction of the miss. A positive residual means the actual response is above the prediction: the model underpredicts. A negative residual means the actual response is below the prediction: the model overpredicts.

The size tells you how far the prediction missed in the response units. A residual of −1-1 minute is an overprediction by 11 minute, not a negative delivery time.

Quick check: predicted time is shorter than actual time. What is the sign?

Positive. The actual value is larger, so y−y^>0y-\hat{y}>0. The model underpredicts the actual time.

A real situation: how much did the delivery model miss?

Use the same 99 invented deliveries from Topic 5.3. Distance xx is measured in kilometres; actual time yy and predicted time y^\hat{y} are measured in minutes. The supplied fitted line is:

y^=12+1.8x.\hat{y}=12+1.8x.
Prediction and residual for each delivery. Residuals use minutes, the response units.
Delivery IDDistance xx (km)Observed yy (min)Predicted y^\hat{y} (min)Residual ee (min)
A5522222121+1+1
B7.57.524.524.525.525.5−1-1
C101029293030−1-1
D12.512.535.535.534.534.5+1+1
E15153939393900
F17.517.544.544.543.543.5+1+1
G202047474848−1-1
H22.522.551.551.552.552.5−1-1
I252558585757+1+1
Residuals are vertical gaps from the fitted line
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 9 10 11 Distance (km) 28 30 32 Delivery time (min) $y=29$ $\hat{y}=30$ $e=-1\,\mathrm{min}$ C: model overpredicts 11.5 12.5 13.5 Distance (km) 32.5 34.5 36.5 Delivery time (min) $y=35.5$ $\hat{y}=34.5$ $e=1\,\mathrm{min}$ D: model underpredicts image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 9 10 11 Distance (km) 28 30 32 Delivery time (min) $y=29$ $\hat{y}=30$ $e=-1\,\mathrm{min}$ C: model overpredicts 11.5 12.5 13.5 Distance (km) 32.5 34.5 36.5 Delivery time (min) $y=35.5$ $\hat{y}=34.5$ $e=1\,\mathrm{min}$ D: model underpredicts

The two panels zoom in on deliveries C and D. Circles mark observations, squares mark predictions, and vertical segments show the signed residuals at the same distance.

Delivery C: at x=10x=10, the model predicts 3030 minutes and the actual time is 2929 minutes. Thus e=29−30=−1e=29-30=-1: the model overpredicts by 11 minute.

Delivery D: at x=12.5x=12.5, the prediction is 34.534.5 minutes and the actual time is 35.535.5 minutes. Thus e=35.5−34.5=1e=35.5-34.5=1: the model underpredicts by 11 minute.

The residual is a vertical difference at the same distance. It is not the shortest slanted distance to the line, and it is not a difference in kilometres.

Key ideas and notation

Observed response: yy

The actual response recorded for one individual. It is a measured delivery time in our example.

Predicted response: y^\hat{y}

The model’s output at that individual’s explanatory value. Keep the hat to distinguish the prediction from the observation.

Residual: ee

The signed difference y−y^y-\hat{y}. It describes how the model missed this observed response.

Residual magnitude: ∣e∣|e|

The distance above or below the prediction in response units, ignoring direction. Smaller magnitude means a closer prediction for that observation.

Zero reference line

The horizontal line e=0e=0 in a residual plot. A point on it represents an observation that the model predicts exactly.

Residual plot

A scatterplot of residuals against explanatory values or predicted responses. It makes patterns in the model’s misses easier to see.

Do not confuse the letters: the residual ee and correlation rr measure different things. Correlation summarizes linear association; a residual describes an individual prediction difference.

Calculate and interpret a residual

  1. Find the actual response. Use the recorded value for the individual.
  2. Calculate the matching prediction. Substitute that individual’s explanatory value into the supplied model.
  3. Subtract in the correct order. Calculate actual minus predicted, keeping the sign.
  4. Explain the result. Name the response, give its units, and state whether the model underpredicts or overpredicts.

Delivery C, step by step

y^=12+1.8(10)=30\hat{y}=12+1.8(10)=30
e=29−30=−1.e=29-30=-1.

The delivery’s actual time is 11 minute less than predicted, so the model overpredicts its time by 11 minute.

Connect the sign to the dot’s position and the model’s prediction.
ResidualObservation relative to lineModel interpretation
e>0e>0Above the fitted lineUnderpredicts the actual response
e<0e<0Below the fitted lineOverpredicts the actual response
e=0e=0On the fitted lineMatches this observed response exactly

Keep the response units

If the response is time in minutes, residuals are in minutes. If the response is remaining battery charge measured as a percentage, a difference between 65%65\% and 68%68\% is −3-3 percentage points. It is not a relative percentage error.

Keep enough precision

Calculate the prediction before rounding the residual. If you are given a rounded model, use it as supplied; if technology provides full coefficients, avoid rounding those coefficients early. Small discrepancies can result from using different coefficient precision.

Build a residual plot

To plot residuals against distance, keep each delivery’s distance on the horizontal axis and replace its actual time with its residual on the vertical axis.

(x,y)⟶(x,y−y^).(x,y)\longrightarrow(x,y-\hat{y}).

Delivery C moves from (10,29)(10,29) on the original scatterplot to (10,−1)(10,-1) on the residual plot. Delivery D becomes (12.5,1)(12.5,1). Label the axes with variables and units, and draw the horizontal reference line e=0e=0.

Keep distance; replace time with the residual
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ $5$ $7.5$ $10$ $12.5$ $15$ $17.5$ $20$ $22.5$ $25$ Distance (km) −2 −1 0 1 2 Residual (min) C D $e=y-\hat{y}$ The delivery residual plot
Posted on Google Google
0000003998 : Abdad Alam Shamim Alam profile picture
0000003998 : Abdad Alam Shamim Alam
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
This is the bestest institution I have ever come to and I love it very much.
Posted on Google Google
Aliki S profile picture
Aliki S
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
Posted on Google Google
Ali profile picture
Ali
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
Sly is him
Posted on Google Google
Jitendra Kumar Kumawat profile picture
Jitendra Kumar Kumawat
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
Posted on Google Google
Raahil Hasan profile picture
Raahil Hasan
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
Posted on Google Google
Tina Mudarres profile picture
Tina Mudarres
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
The classes are amazing and my child learnt so much
Posted on Google Google
alisha gadoya profile picture
alisha gadoya
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
I have experienced a lot of good things, it has taught me so many things and from B/Cs I have gone to an A! This is wonderful and Mavish’s class is awesome.
Posted on Google Google
smasher 123 profile picture
smasher 123
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
It’s sensational my kid went. First he only would get C now it’s all A’s really good and recommend
Posted on Google Google
Mosa Al- Samaraie profile picture
Mosa Al- Samaraie
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
AMAZING PRICES GREAT TEACHERS STRAIGHT FORWARD LEARNING STEADY PACE IN TUTORING
Posted on Google Google
Cael Dagnelie profile picture
Cael Dagnelie
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
I had a great experience learning math with Ms. Mavish. She explains complex topics in a very clear and simple way, which made it easier for me to understand and enjoy the subject. Her patience and dedication really stood out, and she always made sure that everyone in the class was keeping up. I especially appreciated how approachable she was — I never felt afraid to ask questions, and she was always willing to help. Thanks to her teaching, my confidence in math has grown a lot. I’m really thankful for the effort she puts into every lesson!

NUM8ERS is one of finest tutoring institutes in UAE, Located in Al Barsha 1, Dubai. Close to DUBAI AMERICAN ACADEMY (DAA) & AMERICAN SCHOOL OF DUBAI (ASD).