01 / 23

Residual Analysis
& Influence

Master the art of diagnosing regression models: understand residuals, detect outliers, and identify points of high influence.

College Statistics

What Is a Residual?

A residual measures the vertical distance between an observed data point and the value predicted by your regression model. It tells you how much the model missed for that specific observation.

Positive residual
The point lies above the regression line: \( y_i > \hat{y}_i \)
Negative residual
The point lies below the regression line: \( y_i < \hat{y}_i \)

Visualizing Residuals on a Scatterplot

x y regression line
\( e < 0 \)
\( e > 0 \)
residual

Why Residuals Matter

Residuals are the primary diagnostic tool for regression. If the model is appropriate, residuals should show no pattern: they should look like random scatter around zero.

1
Check linearity: a residual plot with no curve confirms a linear model is appropriate.
2
Check constant variance: residuals should have roughly equal spread across all \(x\) values (homoscedasticity).
3
Detect outliers: unusually large residuals signal observations the model fits poorly.
4
Assess normality: for inference, residuals should be approximately normally distributed.

Reading a Residual Plot

Predicted values 0 + − ✓ Good: random scatter around 0

Problem Patterns in Residual Plots

Curved pattern
A U-shape or arch means the relationship is nonlinear: a straight line is the wrong model.
Fan shape
Increasing spread means non-constant variance (heteroscedasticity). Consider a transformation.
Clusters
Distinct groups suggest a lurking variable or that the data come from different populations.

Standardized Residuals

Raw residuals have units that depend on the response variable. To compare residuals on a common scale, we standardize them by dividing by their estimated standard deviation.

Rule of thumb
A standardized residual with \( |r_i| > 2 \) is unusual; \( |r_i| > 3 \) is a strong candidate for an outlier.
Why standardize?
Makes it easy to compare across different datasets and different scales of measurement.

Outliers vs Influential Points

These terms are related but not the same. An outlier has an unusual \(y\)-value given its \(x\)-value. An influential point substantially changes the regression when removed.

Outlier
A point with a large residual: it doesn't fit the pattern of the rest of the data in the \(y\)-direction.
Influential point
Removing it substantially changes the slope, intercept, or \(R^2\) of the regression.

Understanding Leverage

Leverage measures how far an observation's \(x\)-value is from \(\bar{x}\). Points far from the center of the \(x\)-distribution have more potential to pull the regression line.

x y
\(\bar{x}\)
High leverage Outlier, low leverage
far from \(\bar{x}\)

Cook's Distance: Measuring Influence

Cook's distance combines leverage and residual size into a single measure of how much each observation influences the fitted values.

Common threshold
Points with \( D_i > \frac{4}{n} \) or \( D_i > 1 \) deserve closer inspection.
Intuition
Cook's distance answers: "If I delete this point, how much do all the predicted values change?"

How the Pieces Fit Together

Large Residual Outlier in \(y\) High Leverage Extreme in \(x\) Cook's Distance Measures influence Influential point if both are large +

Key Distinctions at a Glance

Outlier High Leverage Influential
Definition Large residual Extreme \(x\)-value Changes regression substantially
Detected by \( |r_i| > 2 \) \( h_{ii} > 2p/n \) \( D_i > 4/n \)
Must have high leverage? No By definition Usually, but not always
Must have large residual? By definition No Usually, but not always

How to Perform Residual Analysis

1
Fit the model and compute residuals \( e_i = y_i - \hat{y}_i \).
2
Plot residuals vs fitted values (\(e_i\) vs \(\hat{y}_i\)). Look for patterns, curves, or fans.
3
Check normality with a Normal Q-Q plot of the residuals. Points should follow a straight line.
4
Compute standardized residuals. Flag any with \( |r_i| > 2 \) as potential outliers.
5
Check leverage values. Flag any with \( h_{ii} > 2p/n \).
6
Compute Cook's distance. Investigate any point with \( D_i > 4/n \). Refit the model without it to assess impact.

Example 1: Calculating a Residual

A regression model for predicting test score from study hours gives: \( \hat{y} = 40 + 5x \). A student who studied \( x = 8 \) hours scored \( y = 92 \). Find the residual.

1
Compute the predicted value: \( \hat{y} = 40 + 5(8) = 80 \)
2
Compute the residual: \( e = y - \hat{y} = 92 - 80 = 12 \)
3
Interpret: The student scored 12 points above what the model predicted. Positive residual: the model underestimated this student's score.

Example 2: Identifying an Influential Point

x y Influential with point without point

Example 3: Using Cook's Distance

Given \(n = 25\), \(p = 2\), a point has standardized residual \(r_i = 2.5\) and leverage \(h_{ii} = 0.18\). Is it influential?

1
Compute Cook's distance: \( D_i = \frac{(2.5)^2}{2} \cdot \frac{0.18}{1 - 0.18} = \frac{6.25}{2} \cdot \frac{0.18}{0.82} = 3.125 \times 0.2195 \approx 0.686 \)
2
Compare to threshold: \( 4/n = 4/25 = 0.16 \). Since \( 0.686 \gg 0.16 \), this point is highly influential.
3
Also check outlier status: \( |r_i| = 2.5 > 2 \), so it is also a potential outlier.
4
Also check leverage: \( h_{ii} = 0.18 > 2(2)/25 = 0.16 \), so it has high leverage too.

Common Mistakes to Avoid

✕ Deleting outliers automatically
Never remove a point just because it has a large residual. Investigate why it's unusual: data error, different population, or genuine variability.
✕ Confusing outlier with influential
An outlier in the middle of the \(x\)-range may have almost no influence on the regression line. Always check Cook's distance.
✕ Ignoring residual plots
A high \(R^2\) doesn't guarantee a good model. Always examine the residual plot for patterns before trusting predictions.

Summary: Diagnostic Measures

Measure What It Detects Threshold
Residual \(e_i\) Model misfit at point \(i\) Context-dependent
Standardized residual \(r_i\) Outliers (unusual \(y\)) \( |r_i| > 2 \)
Leverage \(h_{ii}\) Extreme \(x\)-values \( h_{ii} > 2p/n \)
Cook's distance \(D_i\) Overall influence \( D_i > 4/n \) or \( D_i > 1 \)

Question 1 of 5

A regression model predicts \(\hat{y} = 25\) for an observation, but the actual value is \(y = 19\). What is the residual?

Question 2 of 5

Which residual plot pattern indicates that a linear model is inappropriate?

Question 3 of 5

A point has a standardized residual of \(r_i = 0.3\) and leverage \(h_{ii} = 0.45\). This point is best described as:

Question 4 of 5

With \(n = 50\) observations and \(p = 3\) parameters, what is the leverage threshold for flagging a high-leverage point?

Question 5 of 5

A data point in the center of the \(x\)-range has a very large positive residual. Which statement is most accurate?