Residuals, r² and Outliers
A residual is how far a point misses the line. Add up what the line misses and compare it with what you'd miss using no line at all, and you get , the share of the ups and downs in the line accounts for. Plotting the residuals tells you whether a straight line was the right choice in the first place.
What the symbols mean
- Residual
Observed minus predicted: positive when the point is above the line.
- Coefficient of determination
The share of y's variation explained by the linear relationship with x.
Explanation
A residual is simply the leftover: what actually happened minus what the line predicted. The formulas look like more than they are. (actual minus predicted, positive when the point is above the line). And is minus a fraction: on top, (how much the line still misses), on the bottom, (how much you'd miss by just guessing the average every time). Its formal name is the coefficient of determination, but everyone just says "r squared," because for a straight-line fit it really is the correlation , squared.
Why that ratio? Without , your best guess for any is just , and measures how badly that does. With the line, the misses shrink to . So is the fraction of the original variation the line didn't explain, and minus it is the fraction it did.
Residual plots. Plot residuals against . A patternless band around 0 means the line fits; a curve means a straight line is the wrong model; a fan shape means the spread changes with . Think of it this way: if the line captured the real pattern, all that's left should be random noise. Any shape in the leftovers is pattern the line missed.
Outliers and influential points. An outlier has a large residual. An influential point changes the line a lot when removed, usually because its is far from the rest. Investigate them rather than deleting them automatically.
Extrapolation, predicting far outside the range of the data, is unreliable: the pattern may not continue.
A common mistake. It's tempting to think a high means a straight line is the right model. It doesn't. Clearly curved data can still have near 0.8, because a line catches the general trend while missing the shape. The residual plot is what tells you; there's an example of this in the picture further down.
See it
Worked examples
For , find the residual of the point .
- 1
The line predicts .
Practice
Type your answer and check it. Solve them all to complete the lesson.
For , find the residual of .
For the five-point data set with , find .
means:
A residual plot shows a clear U-shaped pattern. What does that suggest?
A model fit on children aged 2 to 10 predicts height at age 30. This is risky because:
A model predicts a house will sell for 310 (thousand), and it sells for 295. What is the residual?
If , what fraction of the variation in does the regression line explain?
The hardest one here. Get it, and you've got this lesson.
For the five points , , , , and their least-squares line , find and . Enter both.
Where it's used
Analysts check residual plots before trusting any regression; r² is reported for models in economics, engineering and machine learning.