AP Stats Residual Calculator
A residual is how far an observed value misses its predicted value. Positive means the actual value was above the line; negative means it was below the line. Residuals show whether a regression model fits well — or systematically misses.
Residual Calculator
Interactive visual: Live preview
Press Show live preview to redraw this chart from your calculator inputs.
What Is a Residual?
A residual is the difference between an observed value and the value predicted by the regression line: residual = observed y - predicted y. A positive residual means the actual value was above the line, and a negative residual means it was below it. Plotting residuals against the explanatory variable shows whether a straight line is a good model, the residuals should scatter randomly with no pattern.
Interactive visual: See the idea
Example: observed 10, predicted 9 — residual = 1.
How to Use This Calculator
Interactive visual: Walk through it
Step 1: Open the AP Stats Residual Calculator calculator at the top and enter the values it asks for.
Choose your input mode. If you already have predicted values, enter observed y and predicted ŷ in the same order. If you have a regression equation instead, enter x, slope, and intercept, and the calculator finds ŷ = a + bx for each x first. The table then shows every residual, and the chart draws positive residuals above zero and negative ones below zero.
How to Calculate Residuals
Interactive visual: See it on a chart
Press Update visual to redraw this chart from your calculator inputs.
Formula: residual = observed − predicted, or e = y − ŷ. With a model, ŷ = a + bx first.
Worked example: Observed y = 10, 12, 15, 18 and predicted ŷ = 9, 13, 14, 18. Residuals are 10 − 9 = 1, 12 − 13 = −1, 15 − 14 = 1, and 18 − 18 = 0. The first and third points sit above the line, the second sits below it, and the fourth sits exactly on it. Same example from a model: with x = 1, 2, 3, 4, slope 2.5 and intercept 7, predicted values are 9.5, 12, 14.5, 17, giving residuals 0.5, 0, 0.5, 1.
Tips and Common Mistakes
Interactive visual: Mistake vs correct
Mistake: Computing predicted minus observed.
- Residual is observed minus predicted — reversing the subtraction flips every sign.
- A residual of 0 means the point lies exactly on the regression line, not that it was “ignored.”
- Large residuals are worth checking: they may be outliers, or a sign the model is wrong.
- A residual plot should look random. A curved pattern means a straight line is the wrong model.
- Do not average residuals to judge fit — for a least-squares line they sum to about 0 by construction. Look at their size and pattern instead.
Frequently Asked Questions
Interactive visual: FAQ
Tap any question below to show or hide its answer.
What does a positive residual mean?
The observed value was higher than predicted — the point sits above the regression line.
What does a negative residual mean?
The observed value was lower than predicted — the point sits below the regression line.
Can a residual be zero?
Yes. It means the observed value equals the predicted value and the point lies exactly on the line.
Do residuals always sum to zero?
For a least-squares regression line fitted to the same data, they sum to approximately zero (apart from rounding). That is a property of the fit, not proof the model is good.
What is a residual plot used for?
It plots residuals against x (or against predicted values). A random scatter supports a linear model; a pattern, curve, or funnel shape warns against it.
How are residuals different from errors?
A residual is the observed minus predicted value from your fitted model. The true “error” would use the unknown true population line, which you never observe.
Disclaimer: AP is a trademark of the College Board, which was not involved in this site.
Related Calculators and Guides
Keep exploring AP Statistics with calculators and guides related to this tool.
Related Calculators
Interactive visual: Tool path
Start with this tool, then follow the path through the related calculators.
Residual Calculator → Linear Regression Calculator → R-Squared Calculator