Residual Plots
and Model Fit
Learn how residual plots reveal whether a linear model truly captures the pattern in your data, or if something more complex is at play.
What is a Residual?
A residual is the difference between an observed value and the value predicted by your regression model. It measures how far off the model's prediction is for each data point.
Visualizing Residuals on a Scatterplot
Why Do Residuals Matter?
A regression line always minimizes \( \sum e_i^2 \), but that doesn't guarantee the linear model is appropriate. Residuals are the diagnostic tool that tells you whether your model's assumptions hold.
The Residual Plot
A residual plot graphs the residuals \( e_i \) on the vertical axis against either the predicted values \( \hat{y}_i \) or the explanatory variable \( x_i \) on the horizontal axis. A horizontal line at \( e = 0 \) serves as the reference.
Good vs. Bad Residual Plots
Patterns That Signal Problems
Residual Plot vs. Scatterplot
| Residual Plot | Original Scatterplot | |
|---|---|---|
| Y-axis | Residuals \( e_i \) | Response variable \( y \) |
| X-axis | \( x \) or \( \hat{y} \) | Explanatory variable \( x \) |
| Purpose | Check model assumptions | Show the relationship |
| Ideal look | Random scatter around 0 | Clear trend (linear or other) |
| Reveals | Model deficiencies | Association direction/strength |
How to Build a Residual Plot
Example 1: Computing Residuals
A student fits the line \( \hat{y} = 2 + 3x \) to data. Compute the residual for the point \( (4, 17) \).
Example 2: Full Residual Plot
Given \( \hat{y} = 10 + 2x \) and data points, we compute residuals and plot them:
| \( x \) | \( y \) (observed) | \( \hat{y} \) (predicted) | \( e = y - \hat{y} \) |
|---|---|---|---|
| 1 | 13 | 12 | +1 |
| 2 | 15 | 14 | +1 |
| 3 | 14 | 16 | -2 |
| 4 | 19 | 18 | +1 |
| 5 | 19 | 20 | -1 |
Example 3: Detecting Nonlinearity
A researcher fits a linear model to data that actually follows a quadratic trend. The residual plot reveals the problem:
Recognizing a Fan Shape
\( r^2 \) Alone is Not Enough
A high \( r^2 \) value does not guarantee a good model. The famous Anscombe's Quartet shows four very different datasets that all have the same regression line and the same \( r^2 \approx 0.67 \).
Common Mistakes
Summary: Reading Residual Plots
| Residual Pattern | What It Means | Action |
|---|---|---|
| Random scatter | Linear model is appropriate | ✓ Keep the model |
| U-shape / arch | Nonlinear relationship | Try quadratic model |
| Fan shape | Non-constant variance | Transform the data |
| Clusters | Subgroups / lurking variable | Investigate groupings |
| Single extreme point | Potential outlier / influential | Examine that point |
Question 1 of 5
A residual is defined as:
Question 2 of 5
A residual plot shows a clear U-shaped curve. What does this indicate?
Question 3 of 5
Given the regression equation \( \hat{y} = 5 + 2x \), what is the residual for the data point \( (3,\, 14) \)?
Question 4 of 5
A residual plot shows residuals that fan out (become more spread) as \( x \) increases. This pattern is called:
Question 5 of 5
Which of the following is true about a well-fitting linear model?