Historical Context & Motivation
The development of ordinary least squares regression by Legendre and Gauss in the early nineteenth century provided a powerful tool for modeling relationships between variables, yet for over a century practitioners had no systematic framework for evaluating whether individual observations were unduly controlling the fit. Early statisticians relied on visual inspection of scatter plots and subjective judgment to flag problematic data points, an approach that became untenable as datasets grew in dimensionality. The formalization of regression diagnostics as a rigorous subdiscipline emerged primarily in the 1970s and 1980s, when statisticians began exploiting the algebraic structure of the hat matrix and developing quantitative measures of leverage and influence. These tools address a fundamental question in applied modeling: even when a regression passes global tests such as the F-test or R² thresholds, can a small number of observations be disproportionately responsible for the estimated coefficients and apparent goodness of fit?
The central question that regression diagnostics address is: which observations exert disproportionate control over the fitted model, and how do the residuals reveal systematic departures from model assumptions? Without answering this question, a practitioner risks drawing inferences that rest on the peculiarities of a handful of data points rather than on genuine population-level relationships.
Core Principles & Definitions
Regression diagnostics revolve around three interconnected concepts. Leverage describes how far an observation's predictor values lie from the center of the predictor space, thereby measuring its potential to affect the fitted values. Influence captures the actual effect an observation has on the estimated coefficients or fitted values when it is included versus excluded from the analysis. Residual structure refers to the patterns and distributional properties of the differences between observed and fitted responses, which serve as primary evidence for or against the validity of model assumptions such as linearity, constant variance, and normality. Together, these three pillars allow a modeler to interrogate a regression fit at the observation level, moving beyond aggregate summaries like R² or the F-statistic.
Leverage (h_ii)
Influence (Cook's D, DFFITS)
Residual Types
Outlier vs. Influential Point
Residual Structure & Assumptions
Visual Explanation — Leverage vs. Influence
The diagram above captures the essential taxonomy of unusual observations. Leverage is a function of the predictor configuration alone—it tells us where the observation lives in predictor space relative to the centroid of the design matrix. An observation can have extreme x-values (high leverage) yet conform perfectly to the linear trend, in which case it stabilizes rather than distorts the fit. Conversely, an observation near the centroid of x-space has limited ability to rotate the regression hyperplane even if its y-value departs wildly from the fitted value. The truly problematic observations are those that combine both features: they sit in an extreme region of predictor space and deviate substantially from the pattern established by the remaining data.
Mathematical Framework
The Hat Matrix and Leverage
In the standard linear model y = Xβ + ε, the vector of fitted values is ŷ = Hy, where H is the hat matrix. This matrix is the orthogonal projection onto the column space of X and plays a central role in all diagnostic measures.
Residual Types
Influence Measures
Residual Structure & Diagnostic Plots
While scalar measures like Cook's distance and DFFITS flag individual observations, the full diagnostic picture requires examination of residual plots that reveal systematic departures from model assumptions. The four most informative diagnostic plots are: (1) residuals versus fitted values, which reveals non-linearity and heteroscedasticity; (2) the scale-location plot (√|standardized residuals| vs. fitted values), which focuses on variance structure; (3) the Q–Q plot of standardized residuals against theoretical normal quantiles, which assesses the normality assumption; and (4) the residuals-versus-leverage plot, which overlays Cook's distance contours to identify influential points. Together, these are often called the "regression diagnostic quartet" and are generated by default in statistical software packages such as R's plot(lm_object).
| Diagnostic Plot | What It Detects | Warning Signs |
|---|---|---|
| Residuals vs. Fitted | Non-linearity, heteroscedasticity | Curved smoothing line, funnel/megaphone pattern |
| Scale-Location (√|Std. Resid.| vs. Fitted) | Non-constant variance | Upward trending smoothing line, systematic spread changes |
| Normal Q–Q | Non-normality of residuals | S-shaped curve (heavy tails), banana curve (skewness), detached points |
| Residuals vs. Leverage | Influential observations | Points beyond Cook's distance contours (D > 0.5 or D > 1) |
Worked Example
Suppose we fit a simple linear regression y = β₀ + β₁x + ε to n = 10 observations and obtain the following information for observation i = 7: the hat matrix diagonal is h₇₇ = 0.45, the ordinary residual is e₇ = 4.2, the full-sample root mean squared error is σ̂ = 2.1, the leave-one-out root mean squared error is σ̂₍₋₇₎ = 1.8, and p = 2 parameters are estimated. We want to compute the leverage flag, the internally studentized residual, the externally studentized residual, Cook's distance, and DFFITS.
Strengths & Limitations of Diagnostic Measures
No single diagnostic statistic is sufficient for comprehensive model checking. Each measure captures a particular aspect of an observation's role in the regression, and understanding the strengths and limitations of the main diagnostics guides effective practice.
| Diagnostic Measure | Strengths | Limitations |
|---|---|---|
| Leverage (h_ii) | Computed from X alone, no model fitting required; identifies design space extremes | Does not account for the response; a high-leverage point on the regression line is benign |
| Cook's Distance | Combines leverage and residual size into one scalar; measures global coefficient change | Summarizes influence on all coefficients jointly, which may mask influence on a single coefficient; cutoffs are approximate |
| DFFITS | Uses externally studentized residuals; measures impact on the observation's own fitted value | Focused on the fitted value at the specific observation, not on any particular coefficient |
| DFBETAS | Identifies which specific coefficient(s) are most affected by each observation | Produces p values per observation, creating a large amount of output; harder to summarize |
| Externally Studentized Residuals | Has a known t-distribution under normality; enables formal outlier testing | Masking and swamping effects: multiple outliers can distort each other's residuals |
Extensions to GLMs and Beyond
The diagnostic framework developed for the normal linear model extends—with modifications—to generalized linear models (GLMs) and mixed-effects models. In GLMs, the hat matrix is replaced by its generalized analogue computed from the final iteration of the iteratively reweighted least squares (IRLS) algorithm, and residuals take specialized forms—Pearson residuals, deviance residuals, and Anscombe residuals—each correcting for the non-constant variance inherent in non-Gaussian responses. Cook's distance and DFFITS are redefined using the appropriate residual and leverage quantities, but the conceptual interpretation remains the same: influence = leverage × residual magnitude.
| Feature | Normal Linear Model | GLMs |
|---|---|---|
| Hat matrix | H = X(X⊤X)⁻¹X⊤, fixed | H = W^(1/2)X(X⊤WX)⁻¹X⊤W^(1/2), depends on fitted values via weight matrix W |
| Residual types | Ordinary, standardized, externally studentized | Pearson, deviance, Anscombe, working residuals |
| Variance structure | Var(y) = σ² (constant) | Var(y) = φ × V(μ), variance function of the mean |
| Cook's distance | Exact deletion formula available | One-step approximation based on IRLS; exact computation requires re-fitting |
| Normality of residuals | Expected under correct model | Deviance residuals are approximately normal for large samples; Pearson residuals can be skewed |
In modern high-dimensional settings where p may approach or exceed n, classical leverage becomes less informative because many observations have leverage close to 1. Research in this area has developed random-projection-based leverage approximations and regularization-aware influence diagnostics. Similarly, for mixed-effects models, influence can be assessed at both the observation level and the group level, using tools such as the likelihood displacement and conditional Cook's distance. As modeling methodologies continue to evolve, so too does the toolkit for diagnosing whether the conclusions drawn from a fitted model are robust or fragile.
Practice Problems
Summary
Regression diagnostics provide the critical toolset for moving beyond aggregate model summaries to observation-level scrutiny. Leverage, quantified by the hat matrix diagonal hii, identifies observations occupying extreme positions in predictor space. Influence measures such as Cook's distance and DFFITS combine leverage with residual magnitude to assess the actual distortion each observation causes. The key insight is that influence = leverage × discrepancy: an observation must be both extreme in X-space and poorly fit to substantially alter the model.
Residual structure analysis through the diagnostic quartet—residuals versus fitted values, scale-location plots, Q–Q plots, and residuals versus leverage—reveals violations of linearity, homoscedasticity, and normality. These tools extend naturally to GLMs through generalized residuals and weight-adjusted hat matrices. In all contexts, the diagnostic workflow should be investigative rather than mechanical: flagged observations warrant substantive inquiry, not automatic deletion.