Residual Calculator
Test cases replayed : 2 of 2 match · Methodology · No outside source listed
Enter a data point (x, y) and the intercept and slope of the regression line to get the predicted value and the residual of that point.
Result
Residual (y − ŷ)
Predicted value (ŷ)
- Squared residual
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- x value of the data point: enter a number.
- Observed y value: enter a number.
- Intercept of the line (b0): enter a number.
- Slope of the line (b1): enter a number.
- Read the result: Residual (y − ŷ); the panel also shows Predicted value (ŷ) and Squared residual.
How this calculator works
Predicted value ŷ = b0 + b1 × x, from the least-squares (or any) line y = b0 + b1x. Residual e = y − ŷ: the observed value minus the predicted value.
A positive residual means the point lies above the line, a negative one below it. Least-squares regression chooses b0 and b1 so that the sum of the squared residuals is as small as possible.
The formula
| Symbol | Meaning |
|---|---|
| x value of the data point | |
| Observed y value | |
| Intercept of the line (b0) | |
| Slope of the line (b1) | |
| Predicted value (ŷ) | |
| Residual (y − ŷ) |
Worked example
| x value of the data point | 4 |
|---|---|
| Observed y value | 12 |
| Intercept of the line (b0) | 2 |
| Slope of the line (b1) | 2.5 |
| Predicted value (ŷ) | 12 |
|---|---|
| Squared residual | 0 |
Residual (y − ŷ) 0
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What is the residual of the point (4, 12) for the line y = 2 + 2.5x?
ŷ = 2 + 2.5 × 4 = 12, so the residual is 12 − 12 = 0: the point is on the line.
What does a negative residual mean?
The observed value is below the value the line predicts: the line overestimates that point.