Residuals, Residual Plots, and r²
Compute and interpret residuals (actual − predicted). Analyze residual plots to assess the appropriateness of a linear model: patterns indicate non-linearity. Interpret r² as the proportion of variability in y explained by the linear model.
A lesson of AP Statistics, in Exploring Two-Variable Data, about 10 minutes.
Residuals and Assessing Fit
By the end of this lesson, you will be able to construct and interpret residual plots, use $r^2$ to assess model fit, and identify when a linear model is or is not appropriate.
Residuals: Review
$$\text{Residual} = y - \hat{y}$$
Each observation has a residual — the vertical distance from the point to the regression line. Positive = above the line; negative = below.
The LSRL is defined so that the sum of all residuals = 0 and the sum of squared residuals is minimized.
The Residual Plot
A residual plot graphs the residuals ($y$-axis) against the explanatory variable or predicted values ($x$-axis). It is the primary diagnostic tool for checking whether a linear model is appropriate.
A good residual plot (linear model is appropriate):
- Points are scattered randomly above and below the zero line
- No pattern — just noise
- Spread is roughly constant across all x values
A bad residual plot (signals a problem):
- Curved pattern: the relationship is nonlinear; a linear model is not appropriate
- Fan shape (heteroscedasticity): spread increases as x increases; the linear model's predictions become less reliable for larger x values
- Systematic pattern: the model is missing something important
Interpreting Residual Plots: Examples
+2 | . . .
+1 | . . .
0 |------------------
-1 | . . .
-2 | . .
Example 1 — Good fit:
Random scatter above and below zero → linear model is appropriate.
Example 2 — Curved pattern:
+2 |
+1 | . . . .
0 |------------------
-1 | . . .
-2 |
Points curve down then up (or up then down) → nonlinear relationship; linear model is not appropriate.
Example 3 — Fan shape:
+3 | . .
+1 | . . . . .
0 |------------------
-1 | . . .
-3 | .
Spread increases → constant variance assumption violated.