25 Diagnostic Plots and Influential Cases
By the end of this chapter you will be able to:
- Read the Residuals vs. Fitted plot and recognize non-linearity and heteroscedasticity.
- Explain what the Normal Q-Q plot of residuals is testing.
- Use Cook’s distance to identify influential observations.
- Respond to an influential case responsibly — investigate it, don’t automatically delete it.
Fitting a regression takes one line of R. The hard part is checking whether the model’s assumptions hold. This chapter is about the four-panel diagnostic plot that base R produces automatically — and how to read each panel.
par(mfrow = c(2, 2))
plot(model)
par(mfrow = c(1, 1))That one call produces four diagnostic plots, each checking a different way the model can go wrong. Learning to read them is the single most useful skill in applied regression.
25.1 The four diagnostic plots
25.1.1 1. Residuals vs. Fitted — checks linearity and homoscedasticity
The top-left panel plots residuals on the vertical axis against fitted (predicted) values on the horizontal. What you want to see:
- A random scatter around the horizontal line at zero, with no obvious pattern.
- Constant spread across the range of fitted values (no fanning or funneling).
What can go wrong:
- A curved pattern (U-shape or inverted U) → your relationship is non-linear; consider a polynomial term or a transformation of Y or X.
- A funnel shape (residuals spreading or shrinking as fitted values grow) → heteroscedasticity. Variance isn’t constant. Common fixes: transform Y (log, sqrt) or use robust standard errors (see the table below).
- A systematic trend (residuals consistently above or below zero in some region) → the model is missing structure.
25.1.2 2. Normal Q-Q plot — checks normality of residuals
The top-right panel plots sample quantiles of the residuals against theoretical quantiles of a normal distribution.
What you want to see:
- Points close to the diagonal line.
What can go wrong:
- S-shaped curve → tails heavier or lighter than normal (kurtosis problem).
- Bowed curve (one side off, the other on) → skew in the residuals.
- A few points far from the line at the extremes → outliers.
Mild deviations from normality are usually fine, especially with \(n > 30\). Severe deviations (clear skew or heavy tails) call for a transformation or non-parametric approach.
25.1.3 3. Scale-Location — checks homoscedasticity (again)
The bottom-left panel plots the square root of the absolute standardized residuals against fitted values. It’s a second look at homoscedasticity.
What you want to see:
- A roughly horizontal line with random scatter around it.
What can go wrong:
- An upward or downward trend → variance changes with fitted value (heteroscedasticity).
- A clear curve → as in the Residuals vs. Fitted plot, the relationship may not be properly modeled.
If both Residuals vs. Fitted and Scale-Location show heteroscedasticity, you have a real problem. A single questionable look from one of them might be tolerable.
25.1.4 4. Residuals vs. Leverage — checks for influential cases
The bottom-right panel plots residuals against leverage.
- Leverage measures how far an observation’s predictor values are from the average. High-leverage points have unusual X values.
- Residual measures how unusual the Y value is, given the model.
- A point that is both high-leverage and high-residual has high influence — it disproportionately pulls the regression line.
What you want to see:
- Most points clustered in the middle of the plot.
- No points in the upper-right or lower-right corners.
What can go wrong:
- Points outside the dashed red “Cook’s distance” contours → highly influential observations. Investigate.

25.2 Cook’s distance: the influence number
Cook’s distance is a single number per observation that measures how much the regression coefficients would change if you removed that observation. Large Cook’s distance = influential point.
# Get Cook's distance for each observation
cooks_d <- cooks.distance(model)
# Plot
plot(cooks_d, type = "h",
main = "Cook's distance per observation",
ylab = "Cook's D")
abline(h = 4/length(cooks_d), col = "red", lty = 2)
# Find the most influential observations
which(cooks_d > 4/length(cooks_d))Rules of thumb for what counts as “large”:
- D > 1 → almost certainly influential.
- D > 4/n → worth investigating.
The 4/n cutoff shrinks as the sample grows, so in large samples it flags many ordinary points. In the Baby Dataset model in the workflow below, 56 of 996 babies exceed 4/n = .004, yet the largest Cook’s distance is only 0.04. Treat the 4/n list as points to look at, not points to delete.
A single influential observation can flip the sign of a coefficient or move an \(R^2\) from .05 to .35. They deserve scrutiny.
With large samples (n > 100 or so), Shapiro-Wilk detects trivially small deviations from normality that have no meaningful effect on p-values or confidence intervals. The Central Limit Theorem makes regression robust to mild non-normality, especially with larger samples. The Q-Q plot is more informative than the significance threshold: mild S-curves or a few points off the line at the extremes are usually not a problem. What actually matters is whether the Q-Q plot shows severe, systematic skew or heavy tails — not whether Shapiro-Wilk crosses p = .05.
25.3 What to do about an influential observation
Don’t just delete it. The right workflow:
- Investigate. Why is that point unusual? Is it a data-entry error (subject 27 reported age = 300)? Is it a legitimate but extreme observation? Is it a different population entirely?
- If it’s a data error, correct it (or remove the case and note that you did).
- If it’s legitimate but extreme, you have options:
- Run the analysis with and without it, and report both.
- Use robust regression methods that down-weight extreme observations.
- Keep it and accept the variability it introduces.
The worst response is to silently delete it and report the cleaner result. That is the textbook example of p-hacking.
25.4 A complete diagnostics workflow
# Fit the model (load and prepare the Baby Dataset as in Chapter 7, then: data <- babies)
model <- lm(bwt ~ weight + smoke_bi, data = data)
# Step 1: The four-panel plot
par(mfrow = c(2, 2))
plot(model)
par(mfrow = c(1, 1))
# Step 2: Shapiro-Wilk on residuals
shapiro.test(residuals(model))
# Step 3: Variance inflation (if multiple predictors)
library(car)
vif(model)
# Step 4: Cook's distance
cooks_d <- cooks.distance(model)
plot(cooks_d, type = "h", main = "Cook's distance")
abline(h = 4 / length(cooks_d), col = "red")
which(cooks_d > 4 / length(cooks_d))If all four diagnostic panels look reasonable, the Shapiro-Wilk is not extreme, VIF values are below 5 (some texts use a more lenient cutoff of 10), and no Cook’s distance is above 1, you’re in good shape to interpret the model.
25.5 What to do when assumptions are violated
| Violation | Symptoms | Fix |
|---|---|---|
| Non-linearity | Curve in Residuals vs. Fitted | Polynomial term, transformation, or non-linear model |
| Heteroscedasticity | Funnel in Residuals vs. Fitted; trend in Scale-Location | Transform Y (log, sqrt), or use robust SEs (sandwich package) |
| Non-normal residuals | Bowed Q-Q plot; Shapiro-Wilk significant | Transformation (small samples); ignore (large samples — CLT) |
| Severe outliers | Big residuals, especially with high leverage | Investigate, correct if errors, otherwise report sensitivity |
| Influential points | Cook’s D > 1 or > 4/n | Investigate; consider robust regression |
| Multicollinearity | VIF > 5 (or the more lenient > 10); coefficient signs flip when adding predictors | Drop or combine correlated predictors |
25.6 Reporting on diagnostics
You usually don’t include diagnostic plots in your write-up. But you do mention what you checked:
For the Baby Dataset model in the workflow above:
Regression diagnostics were inspected for the model predicting birth weight from mother’s weight and smoking status (N = 996). The residuals vs. fitted and scale-location plots showed no clear curvature or funnel shape. The Q-Q plot showed a slightly heavy lower tail (a few unusually light babies); Shapiro-Wilk was significant, W = 0.99, p < .001, but with N = 996 this reflects the test’s sensitivity to small departures rather than a violation that threatens the inferences. No observation approached Cook’s distance of 1 (maximum = 0.04).
Notice what the plots can’t check: independence of residuals is a question about the study design (for example, whether any mother contributes more than one baby), not something a residual plot confirms.
If you had to remove or down-weight any cases, document that explicitly:
One observation was identified as highly influential (Cook’s D = [value]). On inspection it was [a data-entry error / a legitimate but extreme case — say which, and how you know], and it was [corrected / excluded / retained]. With the case included, the slope was b = [value]; without it, b = [value]. [State whether the substantive conclusion changed.]
Fill in every bracket from your own output. The template’s job is to make the decision and its consequence visible, so a reader can see that the case wasn’t quietly dropped to improve the result.
25.7 Common mistakes
| Wrong | Right |
|---|---|
| Skipping the four-panel plot before interpreting | Always run plot(model) first |
| Deleting influential cases without justification | Investigate and report what you did |
| Reading the Q-Q plot too strictly | Mild deviation is fine, especially with large n |
| Mistaking the Residuals vs. Leverage plot for the most important one | All four panels together tell the story |
| Reporting p-values when residuals are clearly non-normal and n is small | Address the violation first |
25.8 Quick reference
| Element | R code |
|---|---|
| Four-panel diagnostics | par(mfrow = c(2,2)); plot(model); par(mfrow = c(1,1)) |
| Shapiro-Wilk on residuals | shapiro.test(residuals(model)) |
| Cook’s distance | cooks.distance(model) |
| Plot Cook’s distance | plot(cooks.distance(model), type = "h") |
| Variance inflation factor | library(car); vif(model) |
| Identify influential cases | cooks_d <- cooks.distance(model); which(cooks_d > 4 / length(cooks_d)) |
| Robust SEs | library(sandwich); library(lmtest); coeftest(model, vcov = vcovHC(model)) |
Before reporting any regression result, look at:
- Residuals vs. Fitted — is there a pattern? Funnel?
- Q-Q plot — do the residuals look approximately normal?
- Scale-Location — is variance constant?
- Residuals vs. Leverage — are any points unusually influential?
If yes to any concern, address it before interpreting. If no to all four, proceed.
A regression model has been fitted. The code is not shown, but the following is known about the four diagnostic panels and two supplementary checks:
- Residuals vs. Fitted: a clear U-shaped curve in the residuals (not random scatter).
- Normal Q-Q: points follow the diagonal closely with no severe deviations.
- Scale-Location: a clear upward trend — residuals spread out as fitted values increase.
- Residuals vs. Leverage: one observation (obs. 42) falls outside the Cook’s distance contours.
- Shapiro-Wilk on residuals: W = 0.984, p = .41.
- Cook’s distance maximum: 1.47 (for obs. 42).
- The Shapiro-Wilk test is non-significant. Can you conclude that the normality assumption is met? What plot provides the relevant visual check?
- The Residuals vs. Fitted plot shows a U-shaped curve. What does this indicate about the model, and what is one possible fix?
- The Scale-Location plot shows an upward trend. Name this violation. Give two possible remedies.
- Observation 42 has Cook’s distance = 1.47. What should you do — and what should you not do?
- A classmate says “the Q-Q plot and Shapiro-Wilk both look fine, so the model is okay.” What assumption violations is this classmate ignoring?
- After investigation, you find obs. 42 has an invalid data entry. You remove it and refit. The slope changes from b = 2.4 to b = 1.8. What should you report?
Core idea: Fitting a regression model in R takes one line. Trusting the result requires checking four diagnostic plots. Each plot checks a different assumption; together they tell you whether the model is appropriate for your data.
You should understand:
- What each of the four panels shows and what pattern constitutes a violation
- What Cook’s distance measures and when to investigate
- Why Shapiro-Wilk significance is not by itself a disqualifying result
- Why silently deleting influential cases is a form of p-hacking
You should be able to do in R:
- Diagnostic plots:
par(mfrow = c(2, 2)); plot(model); par(mfrow = c(1, 1)) - Normality of residuals:
shapiro.test(residuals(model)) - Cook’s distance:
cooks_d <- cooks.distance(model)andwhich(cooks_d > 4 / length(cooks_d)) - VIF (multicollinearity):
library(car); vif(model)
Plain-language check: Your Residuals vs. Fitted plot fans out into a funnel (spread increases with fitted values). Name the assumption being violated, and give one R-based fix.
The one mistake to avoid: Skipping the four-panel plot and relying solely on Shapiro-Wilk. Non-normality of residuals is the least consequential violation for large samples. Non-linearity and heteroscedasticity are more serious and invisible to Shapiro-Wilk.
Key terms from this chapter are defined in the Glossary.
Ch 25: Diagnostics, step by step walks you through this chapter one section at a time, with a new dataset in R at each step.
This concludes Part V. Part VI turns to the practical matter of writing up results in APA style, with detailed reporting templates for every test in Part IV and V.
Module 3: Checking Assumptions and Diagnostics gives you one predictor, a clean reference outcome, and four outcomes that each break one assumption, so you can see each violation on its own. One of them is worth the module by itself: a variable whose slope is non-significant with R² = .002, where the residual plot shows an obvious curve. The relationship is strong — it just is not a straight line.
This module opens in a new tab.