Overview
A residual is the gap between an actual value and what a model predicted. Residuals show where a regression line fits well and where it misses.
Enter the actual value and the predicted value from your model.
Worked examples
| Inputs | Result |
|---|---|
| Actual value (y)52Predicted value (ŷ)53.8 | Residual: -1.8Squared residual: 3.24The model over-predicted (the point is below the line) |
Show 2 more examples
| Actual value (y)10Predicted value (ŷ)7 | Residual: 3Squared residual: 9The model under-predicted (the point is above the line) |
| Actual value (y)100Predicted value (ŷ)100 | Residual: 0Squared residual: 0The prediction is exact |
Residual by predicted value
With the calculator's starting values, the residual is -1.8. The table shows how it changes with the predicted value.
| Predicted value (ŷ) | Residual |
|---|---|
| 30 | 22 |
| 40 | 12 |
| 50 | 2 |
| 53.8starting value | -1.8 |
| 60 | -8 |
| 70 | -18 |
| 80 | -28 |
Other inputs: Actual value: 52 y. Change them in the calculator above for your own numbers.
How it works
The residual is actual minus predicted. A positive residual means the point is above the line, so the model under-predicted. A negative one means it over-predicted. Squared residuals are added up to give the sum of squared errors, which least-squares fitting makes as small as possible.
The formula
| y | Actual value |
| ŷ | Predicted value |
Practical tips
- An actual value of 52 with a prediction of 53.8 gives a residual of −1.8.
- To get ŷ, put x into your regression equation, such as ŷ = 2x + 3.
- Plot residuals against x. A curve or funnel shape suggests the model is missing something.
Frequently asked questions
What should residuals look like?
Randomly scattered around zero, with no pattern and a similar spread throughout.
Do residuals add up to zero?
For a least-squares line with an intercept, yes.