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.
Definition
- is the observed value (what really happened)
- is the predicted value from the line (read "y-hat")
- is the residual, always observed minus predicted
- : the point is above the line (the line predicted too little)
- : the point is below the line (the line predicted too much)
- : the point is exactly on the line
Try it now
Worked Examples
Find the predicted score
Subtract: observed minus predicted
Interpret the sign
Answer: Mia's residual is : she scored 2 points higher than the line predicted, so her point is above the line.
Common Mistakes
Computing predicted minus observed ()
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: . 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 , 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 with no pattern.
Forgetting the unit or the size of a residual
Why it's wrong: A residual of on a test score means 3 points, not 3%. Its size only makes sense in the unit of .
Correct: Say it in context: "The line overestimated Leo's score by 3 points."
Interactive Visual
Scatter Plot
Study hours and test scores with residuals
ŷ = 5x + 50
r = 0.963 · strong positive correlation
Tap a point to see its coordinates.
Scatter Plot
Residual plot: random scatter (linear model fits)
residual = 0
Tap a point to see its coordinates.
Scatter Plot
Residual plot: U-shaped curve (linear model does not fit)
residual = 0
Tap a point to see its coordinates.
Interactive Sandbox
Expression Calculator
Try these:
History
No calculations yet
Practice Problems
18 problemsWhy It Matters
- 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.
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 minutes for km, a 5 km order is predicted to take minutes. If it took minutes, the residual is .
The app's model is (minutes, in km). An order over km took 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 cm after weeks, a plant is expected to be cm tall after 4 weeks.
The growth model is (cm, in weeks). After weeks one plant is 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 cm and cm for two athletes, the residuals add to , but the squared residuals add to .
A least-squares model for jump height has residuals , and 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:
- 2A positive residual means the point is above the line, a negative one means it is below
- 3Residuals have the same unit as and are easiest to organize in a table: , , ,
- 4The residuals of the least-squares line always add up to
- 5A residual plot with random scatter around 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
Glossary
- Residual
- Observed value minus predicted value:
- Observed value
- The real value of a data point, measured or collected
- Predicted value
- The value that the regression line gives for a certain
- Residual plot
- A graph of against the residuals, with a horizontal line at
- Sum of squared residuals (SSR)
- The sum ; 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
Observed minus predicted; positive above the line, negative below
Sum of residuals
Always true for the least-squares regression line
Sum of squared residuals
The least-squares line makes this as small as possible (also written $SS_{\text{res}}$)