Back to Lesson

Teacher Guide: Residuals

Learn what a residual is, how to compute residuals in a table, and how a residual plot shows whether a line fits the data.

Use this lesson with your class

Free, no student accounts needed.

Share with students

Students open the lesson and practise with instant feedback.

Printable worksheet

All practice problems on paper, with a separate answer key.

Class quiz

10 questions on Regression. Students join with a name, you see everyone's score.

For Teachers

Learning Objectives
  • Compute a residual as observed minus predicted value
  • Interpret the sign of a residual as a point above or below the regression line
  • Organize residuals in a table and verify that they add up to zero for the least-squares line
  • Use a residual plot to decide whether a linear model is appropriate
  • Explain least squares as minimizing the sum of squared residuals
Prerequisites
  • • Scatter plots and reading points as (x, y) pairs
  • • Line of best fit and its equation y^=mx+b\hat{y} = mx + b
  • • Making predictions by substituting xx into the regression line
  • • Adding and squaring negative numbers
Discussion Starters
  • 1. If your residual on a test-score model is −5-5, did you do better or worse than the model expected?
  • 2. Why can the residuals of a bad line still add up to zero?
  • 3. What would a residual plot look like if every point were exactly on the line?
  • 4. Why does squaring the residuals punish one big miss more than several small ones?
Common Misconceptions

The residual is predicted minus observed

Remediation: Anchor the order with a picture: a point above the line should be positive. Have students check the sign against the graph every time.

A sum of residuals equal to zero proves the line is a good fit

Remediation: Show the downloads data: the sum is 00 but the residual plot is a clear U shape. Then compare SSR values of two lines.

A strong correlation means a straight line is always the right model

Remediation: Data that curves can still have a high rr. Always draw the residual plot and look for a pattern before trusting a linear model.

Differentiation Ideas

For Struggling Students:

  • • Start with one residual at a time and a graph to check the sign
  • • Give a table with the predicted values already filled in
  • • Use only whole-number residuals

For On-Level Students:

  • • Complete full residual tables and check that the sum is zero
  • • Draw residual plots by hand and describe the pattern
  • • Compare two lines using the sum of squared residuals

For Advanced Students:

  • • Show that moving the least-squares line up by cc adds nc2n c^2 to the SSR
  • • Explain why the least-squares line always passes through (xˉ,yˉ)(\bar{x}, \bar{y})
  • • Find real data whose residual plot is curved and suggest a better model
Standards Alignment
  • HSS.ID.B.6.B (CCSS.MATH.CONTENT.HSS.ID.B.6.B)

    Informally assess the fit of a function by plotting and analyzing residuals

  • HSS.ID.B.6.C (CCSS.MATH.CONTENT.HSS.ID.B.6.C)

    Fit a linear function for a scatter plot that suggests a linear association

  • HSS.ID.C.7 (CCSS.MATH.CONTENT.HSS.ID.C.7)

    Interpret the slope and the intercept of a linear model in the context of the data

Lesson Resources
  • visualScatter Plot with Residuals

    Students tap points to read each residual as a dashed segment between the point and the line

  • activityHuman Residual Plot

    Students measure height and arm span, compute residuals from a class line and stand on a floor number line at their residual

  • worksheetResidual Tables

    Fill in predicted values, residuals and squared residuals for small data sets and compare two lines

Lesson Content

Everything students see: definition, examples, common mistakes, applications. Tap to open.

Definition

A residual is the vertical distance between a data point and the regression line. It tells you how far the line's prediction missed the real value:
e=y−y^e = y - \hat{y}
  • yy is the observed value (what really happened)
  • y^\hat{y} is the predicted value from the line (read "y-hat")
  • ee is the residual, always observed minus predicted
The sign of a residual tells you where the point lies:
  • e>0e > 0: the point is above the line (the line predicted too little)
  • e<0e < 0: the point is below the line (the line predicted too much)
  • e=0e = 0: the point is exactly on the line
A residual has the same unit as yy. For the least-squares regression line, the residuals always add up to zero: ∑e=0\sum e = 0.

Worked Examples

The regression line for hours studied (xx) and test score (yy) is y^=5x+50\hat{y} = 5x + 50. Mia studied 44 hours and scored 7272. Find her residual.
1

Find the predicted score

y^=5(4)+50=20+50\hat{y} = 5(4) + 50 = 20 + 50 → y^=70\hat{y} = 70
2

Subtract: observed minus predicted

e=y−y^=72−70e = y - \hat{y} = 72 - 70 → e=2e = 2
3

Interpret the sign

e>0e > 0, so Mia's point lies above the line → She scored 2 points more than predicted

Common Mistakes

Computing predicted minus observed (y^−y\hat{y} - y)

Why it's wrong: This flips every sign: points above the line would get negative residuals and points below would get positive ones.

Correct: Always use observed minus predicted: e=y−y^e = y - \hat{y}. Positive means above the line.

Judging a line by the plain sum of its residuals

Why it's wrong: For the least-squares line the sum is always 00, even when the line fits badly, because positive and negative residuals cancel.

Correct: Square the residuals first and add them (SSR), or look at the residual plot.

Thinking a curved residual plot is fine because the points are close to zero on average

Why it's wrong: A clear curve (U shape, hill shape) means the data follows a bend that a straight line cannot follow.

Correct: A linear model fits only when the residual plot looks like random scatter around 00 with no pattern.

Forgetting the unit or the size of a residual

Why it's wrong: A residual of −3-3 on a test score means 3 points, not 3%. Its size only makes sense in the unit of yy.

Correct: Say it in context: "The line overestimated Leo's score by 3 points."

Why It Matters

Residuals are how statisticians check a model instead of just trusting it:
  • Is the line any good? Small residuals mean the predictions are close to reality.
  • Is a straight line the right shape? A residual plot (the residuals plotted against x) shows a random cloud when a line fits and a curve when it does not.
  • Which line is best? The least-squares line is the one with the smallest sum of squared residuals.
  • Unusual cases: a very large residual flags a point that does not follow the pattern, such as a typo in the data or a special case.
Weather services, delivery apps, doctors and sports scientists all compare predictions with what really happened, and every one of those comparisons is a residual.

Real World Applications

Delivery Time Estimates

Delivery apps predict the time for an order from the distance. After each delivery, the residual shows whether the estimate was too short or too long.

Example:

With y^=2x+10\hat{y} = 2x + 10 minutes for xx km, a 5 km order is predicted to take 2020 minutes. If it took 1818 minutes, the residual is 18−20=−218 - 20 = -2.

1Try It Yourself

The app's model is y^=2x+10\hat{y} = 2x + 10 (minutes, xx in km). An order over 66 km took 2525 minutes.

What is the residual for this order?

Step 1: Write the mathematical expression

Observed minus predicted:

Plant Growth Experiments

Biologists fit a line to plant height over time. A plant with a large negative residual may be lacking light or water.

Example:

With y^=1.5x+4\hat{y} = 1.5x + 4 cm after xx weeks, a plant is expected to be 1010 cm tall after 4 weeks.

2Try It Yourself

The growth model is y^=1.5x+4\hat{y} = 1.5x + 4 (cm, xx in weeks). After 88 weeks one plant is 14.514.5 cm tall.

What is the residual for this plant?

Step 1: Write the mathematical expression

Observed minus predicted:

Sports Science Models

Coaches predict an athlete's jump height from training data and judge the model by its sum of squared residuals: the smaller, the better.

Example:

If a model misses by 33 cm and −3-3 cm for two athletes, the residuals add to 00, but the squared residuals add to 9+9=189 + 9 = 18.

3Try It Yourself

A least-squares model for jump height has residuals 22, −1-1 and −1-1 cm for three athletes.

What is the sum of squared residuals?

Step 1: Write the mathematical expression

Square each residual and add:

Key Takeaways

  • 1A residual is observed minus predicted: e=y−y^e = y - \hat{y}
  • 2A positive residual means the point is above the line, a negative one means it is below
  • 3Residuals have the same unit as yy and are easiest to organize in a table: xx, yy, y^\hat{y}, ee
  • 4The residuals of the least-squares line always add up to 00
  • 5A residual plot with random scatter around 00 means a line fits; a curved pattern means it does not
  • 6The least-squares line is the line with the smallest sum of squared residuals

Frequently Asked Questions

Why is it called a residual?

"Residual" means "what is left over". It is the part of yy that the line does not explain: the value left over after you take away the prediction.

Why do we square the residuals instead of just adding them?

Plain residuals cancel out (for the least-squares line their sum is always 00). Squaring makes every miss count as positive and makes big misses count much more.

Is a big residual a mistake?

Not necessarily. It just means the point does not follow the pattern well. Check the data for a typo, but real data can have unusual cases too.

How is a residual plot different from a scatter plot?

A scatter plot shows xx against yy. A residual plot shows xx against the residual ee, so the regression line becomes the horizontal line e=0e = 0 and any pattern the line missed is easy to see.

Glossary

Residual
Observed value minus predicted value: e=y−y^e = y - \hat{y}
Observed value
The real yy value of a data point, measured or collected
Predicted value
The value y^\hat{y} that the regression line gives for a certain xx
Residual plot
A graph of xx against the residuals, with a horizontal line at 00
Sum of squared residuals (SSR)
The sum ∑(y−y^)2\sum (y - \hat{y})^2; the least-squares line makes it as small as possible
Least-squares line
The regression line with the smallest sum of squared residuals

Formula Card

Residual

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

Observed minus predicted; positive above the line, negative below

Sum of residuals

∑e=0\sum e = 0

Always true for the least-squares regression line

Sum of squared residuals

SSR=∑(y−y^)2\text{SSR} = \sum (y - \hat{y})^2

The least-squares line makes this as small as possible (also written $SS_{\text{res}}$)

More in This Topic