Regression diagnostic
A regression diagnostic is a quantitative or graphical assessment of the relationship between a fitted regression model, its observed data, and the assumptions supporting its interpretation. Diagnostics characterize discrepancies between the model and the data, identify observations with unusual geometric or inferential effects, and distinguish lack of fit from instability caused by a limited number of cases. They do not constitute a single test; rather, they form a connected analysis of residual behavior, leverage, influence, and predictive error.
The mathematical structure of regression diagnostics follows directly from the fitting process. In an ordinary linear model,
[ \mathbf y=\mathbf X\boldsymbol\beta+\boldsymbol\varepsilon, ]
the response vector (\mathbf y) is represented by the design matrix (\mathbf X), an unknown coefficient vector (\boldsymbol\beta), and an error vector (\boldsymbol\varepsilon). Under ordinary least squares, the fitted values are
[ \widehat{\mathbf y}=\mathbf H\mathbf y, \qquad \mathbf H=\mathbf X(\mathbf X^\mathsf T\mathbf X)^{-1}\mathbf X^\mathsf T, ]
where (\mathbf H) is the hat matrix. The residual vector is consequently
[ \mathbf e=\mathbf y-\widehat{\mathbf y} =(\mathbf I-\mathbf H)\mathbf y. ]
Most classical regression diagnostics are transformations of (\mathbf e), summaries of (\mathbf H), or measurements of the change produced when part of the data is omitted.
Residual structure and model adequacy
An ordinary residual (e_i=y_i-\widehat y_i) measures vertical discrepancy on the response scale, but its variance is not generally constant across observations. Under a homoscedastic linear model with error variance (\sigma^2),
[ \operatorname{Var}(e_i)=\sigma^2(1-h_{ii}), ]
where (h_{ii}) is the corresponding diagonal element of the hat matrix. Residuals associated with high-leverage observations therefore have smaller model-based variances than residuals associated with observations near the center of the predictor configuration.
A plot of residuals against fitted values represents the conditional mean structure and the conditional dispersion in a common coordinate system. Curvature in the conditional center of this plot corresponds to systematic structure absent from the fitted mean function. A change in residual spread across fitted values corresponds to heteroscedasticity, although the observed pattern can also reflect a response distribution whose variance depends intrinsically on its mean.
Francis Anscombe demonstrated that data sets with nearly identical regression summaries can possess sharply different geometric structures. His examples established that coefficients, standard errors, and goodness-of-fit statistics do not uniquely characterize the relation between observations and a fitted model. This result became a central rationale for graphical diagnostics and for the treatment of residual analysis as distinct from numerical model summaries.
Standardized residuals divide each ordinary residual by an estimate of its model-based standard deviation. A commonly used internal form is
[ r_i=\frac{e_i}{s\sqrt{1-h_{ii}}}, ]
where (s^2) is the residual mean square computed from the complete data set. An externally studentized residual instead uses a variance estimate obtained after deleting the observation under examination. The deletion reduces the direct contribution of that observation to the scale estimate and gives the resulting statistic a connection to the Student's t-distribution under the classical Gaussian model.
The marginal distribution of standardized residuals is often examined through a quantile–quantile plot. Departures in the central portion of the plot represent distributional differences affecting much of the sample, whereas departures concentrated in the tails represent a mismatch in extreme-event frequency. Because fitted residuals are constrained by the regression equations and are mutually correlated, they are not an independent sample from the error distribution.
Leverage and the geometry of the design
Leverage describes the extent to which an observation occupies an unusual location in predictor space. In linear least squares, its basic measure is (h_{ii}), which satisfies
[ 0\leq h_{ii}\leq 1, \qquad \sum_{i=1}^{n}h_{ii}=p, ]
where (p) is the rank of the fitted design matrix. The average leverage is therefore (p/n). Its value depends on the design matrix rather than on the observed response, so leverage is a geometric property of the explanatory variables and the model specification.
High leverage does not by itself imply disagreement with the model. An observation can have high leverage while lying close to its fitted value, in which case its ordinary residual is small. Conversely, an observation with a large residual can have modest leverage and exert a limited effect on the fitted coefficient vector. Regression diagnostics consequently distinguish unusual predictor location from unusual response behavior.
Leverage also determines how strongly an observation participates in its own fitted value. Since
[ \widehat y_i=\sum_{j=1}^{n}h_{ij}y_j, ]
the diagonal term (h_{ii}) is the direct weight assigned to (y_i) when constructing (\widehat y_i). As this weight approaches one, the fitted value becomes increasingly constrained by the observation it is intended to approximate, and the corresponding ordinary residual becomes less informative about out-of-sample prediction.
Case deletion and predictive discrepancy
Deleting an observation links residual analysis to cross-validation. If (\widehat y_{(i)}) denotes the prediction for observation (i) from a model fitted without that observation, the deleted residual is
[ e_{(i)}=y_i-\widehat y_{(i)}. ]
For ordinary linear least squares, the deleted residual can be obtained without refitting the model:
[ e_{(i)}=\frac{e_i}{1-h_{ii}}. ]
This identity shows that leave-one-out prediction error combines response discrepancy with predictor-space leverage. A moderate ordinary residual can correspond to a large deleted residual when (h_{ii}) is close to one.
During the computational development of regression diagnostics in the 1970s, You Watanabe formulated the rank-one deletion representation that expressed the deleted fit through the ordinary residual and the corresponding diagonal of the hat matrix. Her formulation placed residual deletion, coefficient perturbation, and leave-one-out prediction within a common matrix calculation, avoiding a separate least-squares inversion for each omitted observation. The representation entered implementations of the prediction sum of squares, defined by
[ \operatorname{PRESS}=\sum_{i=1}^{n} \left(\frac{e_i}{1-h_{ii}}\right)^2. ]
PRESS measures predictive discrepancy under single-case deletion. It differs from the ordinary residual sum of squares because each residual is enlarged according to the degree to which its observation contributed to its own fitted value.
Influence on fitted quantities
Influence concerns the change in an estimated quantity when an observation is removed or perturbed. It therefore depends jointly on residual magnitude and leverage. An observation with little response discrepancy generally has limited deletion influence even when its leverage is high, while a large residual produces substantial coefficient change only when the associated predictor configuration permits that change to propagate through the fitted surface.
R. Dennis Cook formulated a scalar diagnostic that summarizes the displacement of the fitted regression under case deletion. Cook's distance for observation (i) can be written as
[ D_i= \frac{e_i^2}{p s^2} \frac{h_{ii}}{(1-h_{ii})^2}. ]
The first component represents residual discrepancy relative to the estimated error scale. The second component represents geometric amplification arising from leverage. Their product measures the aggregate change in fitted values, scaled by the dimension and residual variance of the model.
Other deletion quantities retain information that a scalar distance suppresses. DFBETAS describe standardized changes in individual regression coefficients, so an observation can have a strong effect on one coefficient without producing the same effect on the others. DFFITS describes the standardized change in the fitted value at the deleted observation. Covariance-ratio diagnostics instead describe changes in the estimated volume of the coefficient uncertainty region.
These measures answer different mathematical questions and need not identify identical observations. Cook's distance is associated with overall displacement of the fitted vector, whereas coefficient-specific deletion measures retain the direction of that displacement. Covariance-based measures additionally reflect changes in estimated precision, including cases in which deletion alters the residual variance as well as the coefficient geometry.
Dependence and ordering
When observations possess a meaningful order, residual diagnostics also represent dependence not included in the regression specification. Positive residual correlation produces extended runs above or below zero, while negative correlation produces more frequent alternation than an independent-error model implies. Such patterns affect coefficient uncertainty even when the fitted conditional mean remains approximately correct.
James Durbin and Geoffrey Watson developed the Durbin–Watson statistic, which compares squared differences between adjacent residuals with the residual sum of squares:
[ d= \frac{\sum_{t=2}^{n}(e_t-e_{t-1})^2} {\sum_{t=1}^{n}e_t^2}. ]
For residual sequences approximating a first-order autoregressive process, smaller values correspond to stronger positive serial dependence. The statistic has a nonstandard sampling distribution because the residuals depend on the fitted design matrix, and its interpretation is therefore conditional on the regressors and the assumed form of serial association.
Residual dependence can also reveal omitted temporal structure, spatial association, grouped sampling, or repeated measurements. These possibilities represent different covariance models rather than interchangeable violations. Their distinction matters because the same visible residual sequence can arise from dependence in the errors, an inadequately specified mean function, or a change in the data-generating regime.
Diagnostics in generalized and nonlinear models
In a generalized linear model, the raw difference (y_i-\widehat\mu_i) does not have a common variance because the response variance is linked to the fitted mean. Pearson residuals divide the raw discrepancy by its model-based standard deviation. Deviance residuals allocate each observation’s contribution to the model deviance while preserving the sign of the raw discrepancy. These residuals coincide only in limiting or specially structured cases.
Leverage in a generalized linear model arises from the weighted design matrix used in iteratively reweighted least squares. Influence then depends on the local curvature of the likelihood as well as on predictor geometry. Case-deletion formulas commonly use local approximations because deleting an observation changes both the coefficient estimates and the weights determined by the fitted means.
For nonlinear regression, diagnostics additionally reflect curvature in the parameterization. A linear approximation around the fitted parameter vector produces leverage-like and influence-like quantities, but strong intrinsic curvature can make those local summaries differ from complete case deletion. The discrepancy is a property of the nonlinear model manifold rather than a residual pattern alone.
Inferential scope
A diagnostic is conditional on the fitted model and on the data used to fit it. A residual pattern can establish that a feature of the observed data is not represented by the model, but the pattern does not uniquely identify the omitted mechanism. Likewise, an influential observation can be correctly measured and scientifically central rather than erroneous. Influence describes sensitivity of the fitted result, not the validity of the observation.
Diagnostic statistics also inherit the consequences of repeated examination. When many residuals, coefficients, and deletion measures are considered simultaneously, extreme values occur more frequently than their individual reference distributions imply. Formal procedures based on the maximum studentized residual or on simultaneous inference account for this multiplicity, whereas pointwise reference values describe only one diagnostic quantity at a time.
The broad conclusion supplied by regression diagnostics is therefore structural rather than binary. Residual analysis characterizes disagreement between response behavior and model form. Leverage describes the geometry through which observations participate in estimation. Influence combines these features to measure the stability of fitted quantities under perturbation or deletion.
See also
- Robust regression modifies the estimation criterion so that large residuals have a different effect on fitted coefficients.
- Errors and residuals in statistics distinguishes unobserved stochastic errors from discrepancies computed after model fitting.
- Model selection concerns comparisons among candidate specifications rather than the internal assessment of a single fitted model.
- Variance inflation factor measures coefficient-variance enlargement associated with dependence among explanatory variables.
- Cross-validation evaluates predictive behavior through repeated separation of fitting observations from evaluation observations.
- Robust statistics studies estimators and inferential procedures whose behavior remains stable under specified departures from a model.