Residuals &
Diagnostics
Learn how residuals reveal the quality of a regression model and how diagnostic plots help you identify outliers, leverage, and influential points.
What Is a Residual?
A residual is the vertical distance between an observed data point and the regression line. It measures how far the model's prediction misses the actual value:
A positive residual means the point sits above the line. A negative residual means it sits below. If a model fits well, residuals should be small and show no pattern.
Visualizing Residuals
Why Residuals Matter
In business decisions, a model with patterned residuals can lead to biased forecasts and poor resource allocation. Diagnostics catch these issues before they cost money.
The Residual Formula
Standardized Residuals
Raw residuals are hard to compare across observations because different points have different expected variability. We standardize them:
Residual vs. Fitted Plot
Problem Patterns in Residuals
Outliers vs. Leverage vs. Influence
| Outlier | High Leverage | Influential | |
|---|---|---|---|
| Definition | Large residual in \( y \) | Extreme in \( x \) | Changes the fit when removed |
| Detected by | Standardized residual | Leverage \( h_{ii} \) | Cook's Distance |
| Threshold | \( |z_i| > 2 \) | \( h_{ii} > \frac{2p}{n} \) | \( D_i > 1 \) |
| Always bad? | Not necessarily | Not necessarily | Investigate carefully |
Leverage and Cook's Distance
Cook's Distance Formula
How to Diagnose a Regression
Example 1: Computing a Residual
A company models monthly sales (\( y \), in thousands) from ad spending (\( x \), in thousands). The regression equation is:
In one month, the company spent \( x = 8 \) thousand on ads and observed \( y = 45 \) thousand in sales. Find the residual.
Example 2: Standardized Residual
Using the same model with \( s_e = 4.2 \) (residual standard error from 20 observations), is the observation from Example 1 an outlier?
Example 3: Identifying Influence
A new observation has \( x = 25 \) (far beyond the data range of 2 to 12) and \( y = 60 \). The model predicts \( \hat{y} = 99.5 \). With \( h_{ii} = 0.42 \), \( p = 2 \), and \( \text{MSE} = 17.64 \):
Common Mistakes
Diagnostic Summary
| Tool | What It Checks | Red Flag | |
|---|---|---|---|
| Residual Plot | \( e_i \) vs. \( \hat{y}_i \) | Linearity, constant variance | Curves or fans |
| Q-Q Plot | Normal quantiles | Normality of residuals | Deviations from diagonal |
| Standardized Residual | \( z_i = e_i / s_e \) | Outliers in \( y \) | \( |z_i| > 2 \) |
| Leverage | \( h_{ii} \) | Extreme \( x \)-values | \( h_{ii} > \frac{2p}{n} \) |
| Cook's Distance | \( D_i \) | Overall influence | \( D_i > 1 \) |
Question 1 of 5
A regression model predicts \( \hat{y} = 50 \) for an observation where the actual value is \( y = 42 \). What is the residual?
Question 2 of 5
A residual vs. fitted plot shows a clear U-shaped curve. This indicates:
Question 3 of 5
An observation has a standardized residual of \( z = 2.8 \). This means the observation is:
Question 4 of 5
Which measure combines leverage and residual size to assess a single observation's overall effect on the regression?
Question 5 of 5
In OLS regression, the sum of all residuals \( \sum e_i \) equals: