SECTION 1
Historical Context & Motivation
The method of least squares was independently developed by Adrien-Marie Legendre and Carl Friedrich Gauss in the early nineteenth century, giving researchers a principled way to fit a line through scattered data. Yet for more than a century, practitioners largely trusted the global fit without examining whether individual observations might be distorting the results. As datasets grew in complexity through the twentieth century, statisticians realized that a single aberrant point could drastically alter slope estimates, confidence intervals, and hypothesis tests. This recognition catalyzed the development of formal diagnostic tools designed to detect problematic observations and assess their impact on regression output.
1805 • Legendre Publishes Least Squares
1977 • Cook's Distance
1980 • Belsley, Kuh & Welsch Diagnostics
1986 • Studentized Residuals Standardized
2000s • Automated Diagnostics in Software
The central question driving this topic is deceptively simple: can we trust our regression line? A well-fitting model might conceal the fact that one or two observations are pulling the line toward themselves, masking the true pattern in the remaining data. Residual analysis provides the lens through which we inspect each observation's contribution to the model, while influence diagnostics quantify the degree to which removing a single point would alter the conclusions. Together, these tools form an indispensable part of responsible regression modeling.
SECTION 2
Core Principles & Definitions
Before examining computational formulas, it is essential to distinguish the key concepts that underpin residual analysis. A residual is defined as the difference between an observed response value and the value predicted by the fitted regression model. When we examine the collection of all residuals — their distribution, spread, and patterns — we gain critical information about whether our modeling assumptions (linearity, constant variance, normality, independence) are satisfied. Beyond assumption checking, specific observations may warrant special scrutiny because they are unusual in predictable ways.
Residual
Outlier
Leverage Point
Influential Observation
Standardized vs. Studentized Residual
KEY TAKEAWAY
SECTION 3
Visual Explanation — Residuals on a Scatterplot
The most intuitive way to understand residuals is to see them. The diagram below displays a simple linear regression scenario with several data points, the fitted regression line, and vertical line segments representing each residual. Notice how points above the line have positive residuals and points below the line have negative residuals. The diagram also highlights three special cases: a high-leverage point at an extreme x-value, an outlier with a large residual, and an influential observation that exhibits both properties simultaneously.
Observe that high leverage alone does not necessarily distort the regression line — the cyan point sits close to where the line already passes. Similarly, the pink outlier has a large residual but is located near the center of the x-distribution, giving it limited mechanical advantage to tilt the line. The amber point, however, sits far from the x-mean and far from the line, creating a "lever arm" effect that can substantially shift the estimated slope and intercept. This is why influence is the product of outlyingness and leverage — both ingredients are necessary to meaningfully alter the regression fit.
SECTION 4
Mathematical Framework
The mathematical underpinnings of residual analysis rest on the hat matrix H, which projects the observed response vector y onto the column space of the design matrix X. In the ordinary least squares framework, the vector of fitted values is ŷ = Hy = X(XTX)−1XTy. The diagonal elements hᵢᵢ of H — called leverage values — measure how far observation i's predictor values are from the centroid of the predictor space, thereby quantifying its potential to influence the fit.
ORDINARY RESIDUAL
where yᵢ is the observed response and ŷᵢ is the predicted value from the fitted model. The residual eᵢ has variance σ²(1 − hᵢᵢ), so points with high leverage have smaller residual variance — they are pulled closer to the line by construction.
INTERNALLY STUDENTIZED RESIDUAL
where s is the root mean square error (RMSE) estimated from all n observations and hᵢᵢ is the leverage of observation i. This rescaling accounts for the fact that residuals of high-leverage points are expected to be smaller, making comparisons across observations more meaningful.
EXTERNALLY STUDENTIZED (DELETED) RESIDUAL
Here s₍₋ᵢ₎ denotes the RMSE computed from the model fitted without observation i. Under the null hypothesis that observation i belongs to the model, tᵢ follows a t-distribution with n − p − 2 degrees of freedom. Values of |tᵢ| exceeding roughly 2–3 warrant investigation as potential outliers.
COOK'S DISTANCE
Cook's distance combines the squared standardized residual (measuring outlyingness in y) with the leverage ratio hᵢᵢ/(1 − hᵢᵢ) (measuring extremity in x). A common guideline flags Dᵢ > 4/n or Dᵢ > 1 as indicative of an influential observation, where p is the number of estimated parameters including the intercept.
Why Delete-One?
SECTION 5
Diagnostic Measures & Classification
Beyond Cook's distance, several complementary diagnostics exist. DFFITS measures the change in the fitted value for observation i when it is deleted, expressed in units of the standard error of ŷᵢ. DFBETAS provides a separate measure for each regression coefficient, quantifying how much bⱼ changes (in units of its standard error) when observation i is removed. Leverage values (hᵢᵢ) from the hat matrix provide a purely predictor-space measure of unusualness. The table below summarizes these diagnostics, their formulas, and commonly used thresholds.
| Diagnostic | What It Measures | Formula / Key Idea | Common Threshold |
|---|---|---|---|
| Leverage (hᵢᵢ) | Extremity of predictor values | Diagonal of H = X(XᵀX)⁻¹Xᵀ | hᵢᵢ > 2p/n |
| Studentized Residual (tᵢ) | Outlyingness of response | eᵢ / (s₍₋ᵢ₎√(1 − hᵢᵢ)) | |tᵢ| > 2 or Bonferroni-adjusted |
| Cook's Distance (Dᵢ) | Overall influence on all fitted values | (rᵢ²/p) × hᵢᵢ/(1 − hᵢᵢ) | Dᵢ > 4/n or Dᵢ > 1 |
| DFFITS | Change in ŷᵢ when obs i removed | tᵢ × √(hᵢᵢ/(1 − hᵢᵢ)) | |DFFITS| > 2√(p/n) |
| DFBETAS(j) | Change in coefficient bⱼ when obs i removed | (bⱼ − bⱼ₍₋ᵢ₎)/SE(bⱼ₍₋ᵢ₎) | |DFBETAS| > 2/√n |
Summary of key regression diagnostics and their thresholds
This four-quadrant framework is the conceptual backbone of influence analysis. In practice, you will use numerical diagnostics (Cook's distance, DFFITS) rather than visual quadrant placement, but the intuition remains: an observation must be unusual in both predictor space and response space to exert meaningful influence on the regression coefficients. A point that is only a leverage point or only an outlier may merit attention for other reasons (model misspecification, data recording errors) but typically does not distort the overall fit as severely.
SECTION 6
Worked Example — Computing Diagnostics
Suppose we fit the simple linear regression ŷ = 2.5 + 1.8x to n = 20 observations with p = 2 parameters (intercept + slope). We obtain RMSE s = 3.2 from the full model. Consider observation i = 14, which has x₁₄ = 15 (the sample mean of x is 8) and y₁₄ = 38. The model predicts ŷ₁₄ = 2.5 + 1.8(15) = 29.5. Additional information: the leverage value h₁₄,₁₄ = 0.31, and the RMSE computed without observation 14 is s₍₋₁₄₎ = 2.9. We will compute the key diagnostics.
Diagnosing Observation 14
- 1
Step 1 — Compute the Residual
The ordinary residual is e₁₄ = y₁₄ − ŷ₁₄ = 38 − 29.5 = 8.5. This positive value tells us the observed response is considerably higher than the model predicts.e₁₄ = 8.5 - 2
Step 2 — Compute the Internally Studentized Residual
Using the full-data RMSE: r₁₄ = e₁₄ / (s × √(1 − h₁₄,₁₄)) = 8.5 / (3.2 × √(1 − 0.31)) = 8.5 / (3.2 × √0.69) = 8.5 / (3.2 × 0.8307) = 8.5 / 2.658 ≈ 3.20. This is well above 2, indicating potential outlyingness.r₁₄ ≈ 3.20 - 3
Step 3 — Compute the Externally Studentized (Deleted) Residual
Using the leave-one-out RMSE: t₁₄ = e₁₄ / (s₍₋₁₄₎ × √(1 − h₁₄,₁₄)) = 8.5 / (2.9 × 0.8307) = 8.5 / 2.409 ≈ 3.53. Under the null hypothesis, this follows a t-distribution with n − p − 2 = 20 − 2 − 2 = 16 degrees of freedom. The two-tailed p-value for |t| = 3.53 with 16 df is approximately 0.003, confirming this is a statistically significant outlier.t₁₄ ≈ 3.53 (p ≈ 0.003) - 4
Step 4 — Assess Leverage
The leverage threshold is 2p/n = 2(2)/20 = 0.20. Since h₁₄,₁₄ = 0.31 > 0.20, observation 14 is a high-leverage point. This makes sense because x₁₄ = 15 is far from the mean of 8.h₁₄,₁₄ = 0.31 > 0.20 → High leverage - 5
Step 5 — Compute Cook's Distance
Dᵢ = (rᵢ² / p) × (hᵢᵢ / (1 − hᵢᵢ)) = (3.20² / 2) × (0.31 / 0.69) = (10.24 / 2) × 0.4493 = 5.12 × 0.4493 ≈ 2.30. Compared to the 4/n = 4/20 = 0.20 threshold, D₁₄ = 2.30 far exceeds it, and it also exceeds the more conservative threshold of 1.0. Observation 14 is unambiguously influential.D₁₄ ≈ 2.30 ≫ 0.20 → Highly influential - 6
Step 6 — Interpretation and Action
Observation 14 is both a statistical outlier (|t₁₄| = 3.53) and a high-leverage point (h₁₄,₁₄ = 0.31), yielding a very large Cook's distance. The analyst should investigate whether this observation reflects a data entry error, a genuinely different population, or unusual but valid data. If it is a legitimate observation, the analyst might report regression results both with and without observation 14 to demonstrate the sensitivity of the conclusions.
SECTION 7
Strengths & Limitations of Diagnostic Measures
No single diagnostic captures every facet of data quality. Each tool has particular strengths and blind spots, so experienced practitioners typically examine several diagnostics in concert rather than relying on any one measure. The table below compares the most widely used diagnostics across several evaluative dimensions.
| Diagnostic | Strengths | Limitations |
|---|---|---|
| Ordinary Residuals | Simple to compute and interpret; directly show model misfit at each point; useful in residual-vs-fitted and residual-vs-predictor plots for detecting non-linearity and heteroscedasticity. | Unequal variances across observations — high-leverage points have artificially small residuals, masking potential problems. Not directly comparable across observations without standardization. |
| Studentized Residuals | Account for heterogeneous residual variances; externally studentized version follows a t-distribution under the null, enabling formal hypothesis testing for outliers. | Multiple testing issues when examining all n residuals simultaneously — Bonferroni or similar corrections are needed. May suffer from masking when multiple outliers cluster together. |
| Leverage (hᵢᵢ) | Depends only on predictor values, so it can be computed before observing responses; directly interpretable as the weight observation i exerts on its own fitted value. | Does not account for the response — a high-leverage point near the regression surface is benign. Must be paired with a residual measure to assess actual influence. |
| Cook's Distance | Combines leverage and outlyingness into a single summary; intuitive interpretation as the distance between full-data and deleted-data fitted-value vectors; widely implemented in software. | Threshold rules (Dᵢ > 4/n, Dᵢ > 1) are guidelines, not formal tests. Can be dominated by a single extreme observation, causing less extreme but still problematic points to appear benign. |
| DFBETAS / DFFITS | DFBETAS provides coefficient-specific sensitivity; DFFITS provides prediction-specific sensitivity. Together they give a granular view of where influence is concentrated. | Produce a large volume of output in models with many predictors, making manual inspection tedious. Thresholds depend on sample size and may be overly liberal or conservative. |
Comparative strengths and limitations of regression diagnostics
KEY TAKEAWAY
SECTION 8
Connection to Advanced Theory
The diagnostic framework presented here extends naturally into more advanced settings. In multiple regression with many predictors, leverage reflects the Mahalanobis distance of an observation's predictor vector from the centroid of the predictor space, accounting for correlations among predictors. In generalized linear models (GLMs), residuals are replaced by deviance residuals or Pearson residuals, and the hat matrix is replaced by the generalized hat matrix derived from the iteratively reweighted least squares algorithm. Robust regression methods, such as M-estimation and least trimmed squares, are designed to automatically downweight or exclude influential observations, providing an alternative to the detect-then-decide approach of classical diagnostics.
| Concept | Classical OLS Setting | Advanced / Extended Setting |
|---|---|---|
| Residual Type | Ordinary, standardized, or studentized residual (eᵢ, rᵢ, tᵢ) | Deviance residuals, Pearson residuals, Anscombe residuals in GLMs; martingale residuals in survival models |
| Leverage | Diagonal of H = X(XᵀX)⁻¹Xᵀ | Generalized leverage from IRLS; Mahalanobis distance for multivariate predictors; partial leverage in variable-added plots |
| Influence Measure | Cook's D, DFFITS, DFBETAS with exact deletion formulas | One-step approximations in large-sample GLMs; case-deletion diagnostics for mixed models; influence functions in semiparametric models |
| Remedial Action | Investigate, report with/without point, transform | Robust regression (M-estimation, LTS, MM-estimators); Bayesian hierarchical models with heavy-tailed priors; penalized regression |
Classical diagnostics and their advanced counterparts
Understanding the classical residual and influence framework thoroughly prepares you for these extensions. The underlying logic — quantify how much an individual observation affects the model fit, then decide whether that effect is substantively important — remains unchanged regardless of the model class. In courses on generalized linear models, survival analysis, or Bayesian statistics, you will encounter analogous diagnostics built on the same conceptual foundation, making this material a gateway to advanced model-checking methodology.
SECTION 9
Practice Problems
Question 1: CONCEPTUAL
Show answer
Question 2: BASIC CALCULATION
Show answer
Question 3: INTERMEDIATE
Show answer
Question 4: APPLIED
Show answer
Question 5: CRITICAL THINKING
Show answer
SUMMARY
Summary — Residual Analysis and Influence Concepts
Summary
Residual analysis is the practice of examining the differences eᵢ = yᵢ − ŷᵢ between observed and predicted values to assess model adequacy and identify problematic observations. Outliers are observations with large studentized residuals, indicating poor model fit for that case. Leverage points have extreme predictor values (high hᵢᵢ), giving them disproportionate potential to shift the fitted line. An observation becomes influential when it combines both outlyingness and leverage — a condition quantified by Cook's distance, DFFITS, and DFBETAS.
Responsible regression practice demands examining multiple diagnostics together — residual plots for assumption checking, leverage values for predictor-space extremity, and influence measures for coefficient sensitivity. When a flagged observation is identified, the analyst should investigate its source (data error, different population, or legitimate extreme case) rather than reflexively deleting it. Reporting results with and without the observation provides transparency and demonstrates the robustness — or fragility — of the conclusions. This framework extends naturally to generalized linear models and robust regression, making it a foundational skill for any data analyst.