Tutorials › Introduction to Statistics › Cook’s Distance for Influential Observations

Residuals and Transformations · Tutorial 288 of 996

Cook's Distance for Influential Observations

Use Cook’s distance to identify cases that may substantially affect a fitted regression, and understand what the measure can and cannot tell you.

Intermediate 9 min read

What You'll Learn

  • Define Cook’s distance for a fitted least-squares regression model.
  • Calculate Cook’s distance from a residual, leverage, and residual mean square.
  • Relate Cook’s distance to an internally standardized residual.
  • Explain why both residual size and leverage matter for influence.
  • Use screening guidelines without treating them as automatic deletion rules.

Why Consider Cook’s Distance?

A point can matter to a regression fit for more than one reason. Its response may be far from the value predicted by the fitted line, or its predictor value may be unusual relative to the other cases. A large residual signals a poor fit for that case; high leverage means its predictor position gives it the potential to pull the fitted line. Neither feature by itself tells the whole story about how much the fitted regression may be affected.

Cook’s distance combines these features into one measure of a case’s potential influence on the fitted regression. It is useful for screening observations for closer examination, but it does not establish that a case is erroneous or that it should be removed. The measure is best understood alongside the regression context and other diagnostics.

Definition and Calculation

Consider a least-squares regression with \(n\) observations and \(p\) estimated coefficients, including the intercept. For example, simple linear regression estimates an intercept and a slope, so \(p=2\). Let \(e_i=y_i-\hat{y}_i\) be the residual for case \(i\), \(h_{ii}\) its leverage, and \(MSE=SSE/(n-p)\) the residual mean square from the fitted model.

Definition: Cook’s distance for case \(i\) is \[ D_i=\frac{e_i^2}{p\,MSE}\frac{h_{ii}}{(1-h_{ii})^2}. \] It is a dimensionless measure of how much the fitted regression can be affected by case \(i\). Larger values indicate greater potential influence; the value is not a probability or a test statistic with a universal cutoff.

This formula uses the model fitted to all \(n\) observations. The squared residual \(e_i^2\) measures how far the response is from its fitted value. The leverage term \(h_{ii}/(1-h_{ii})^2\) increases the contribution when the predictor position is unusual. The factor \(p\) accounts for the number of fitted coefficients, and division by \(MSE\) scales the residual relative to the model’s typical squared error.

The regression model should be a sensible representation of the relationship being studied. In the usual linear model, the response has a linear mean in the predictors, errors have mean zero and constant variance, and errors are independent across observations. These conditions support interpretation of the fitted regression and its diagnostics. Normal errors are not required merely to calculate Cook’s distance. As with leverage, a case’s predictor values determine its leverage; the residual reflects how well the response fits the model.

An equivalent form uses the internally standardized residual \(r_i=e_i/\sqrt{MSE(1-h_{ii})}\):

$$ D_i=\frac{r_i^2}{p}\frac{h_{ii}}{1-h_{ii}}. $$

This form makes the combination especially visible: Cook’s distance increases with the squared standardized residual and with leverage. A modest residual can still contribute to a large distance when leverage is very high, while a large residual at ordinary leverage may also warrant attention.

Worked Example: Calculating Cook’s Distance

Suppose a hypothetical simple linear regression has \(n=12\) observations. For case A, the full-data fit has residual \(e_A=10\) units, leverage \(h_{AA}=0.30\), and \(MSE=25\) squared units. Calculate its Cook’s distance. The model estimates an intercept and one slope, so \(p=2\).

Substitute the values into the formula:

$$ D_A=\frac{10^2}{2(25)}\frac{0.30}{(1-0.30)^2} =\frac{100}{50}\frac{0.30}{0.49} =2(0.6122) \approx 1.224. $$

The residual and \(MSE\) are in compatible response units, so their squared units cancel. Cook’s distance is dimensionless. A value around 1.224 is a signal to inspect case A’s role in the fit; it is not a probability, nor proof of an error. The calculation alone does not say why the case has this value or whether it should be retained.

As a check using the equivalent form, \(r_A=10/\sqrt{25(0.70)}\approx2.390\), giving \(D_A=(2.390^2/2)(0.30/0.70)\approx1.224\), apart from rounding.

Why Residual Size and Leverage Both Matter

A case with a large residual is poorly predicted by the fitted line, but if its predictor value is near the center of the other predictor values, it may not shift the fitted line much. Conversely, a case far from the center of the predictor values has high leverage, but if it lies close to the pattern followed by the other observations, it may have only a small residual. Cook’s distance is designed to combine both ingredients rather than label either one alone as influence.

In the equivalent expression, \(r_i^2\) represents the response discrepancy on a scale that accounts for the residual variation and leverage. The multiplier \(h_{ii}/(1-h_{ii})\) then gives more weight to high-leverage cases. The result summarizes potential impact on the fitted regression as a whole; it is not a directional measure. It does not indicate whether a slope will increase or decrease.

Key interpretation: A large Cook’s distance flags a case whose combination of residual size and leverage suggests that it may have substantial influence on the fitted regression. It is a diagnostic prompt for investigation, not an automatic instruction to delete the case.

Worked Example: Comparing Residuals and Leverage

Consider two hypothetical observations from the same simple linear regression. The model has \(p=2\) coefficients and \(MSE=16\) squared response units. Case B has \(e_B=8\) and \(h_{BB}=0.10\); case C has \(e_C=4\) and \(h_{CC}=0.40\). Compare their Cook’s distances.

For case B:

$$ D_B=\frac{8^2}{2(16)}\frac{0.10}{(1-0.10)^2} =\frac{64}{32}\frac{0.10}{0.81} \approx 0.2469. $$

For case C:

$$ D_C=\frac{4^2}{2(16)}\frac{0.40}{(1-0.40)^2} =\frac{16}{32}\frac{0.40}{0.36} \approx 0.5556. $$

Case B has the larger raw residual, but case C has the larger Cook’s distance because its leverage is much higher. This comparison illustrates why ranking cases by residual size alone can miss potentially influential observations. It does not show that C is definitely more consequential in every modeling decision; Cook’s distance is a combined diagnostic summary.

Screening Guidelines and Their Limits

There is no universal Cook’s-distance threshold that separates influential from non-influential observations in every data set. A common screening guideline flags values greater than \(4/n\); another rough guideline treats values near or above 1 as deserving attention. These are rules of thumb, not hypothesis tests. A value below a guideline does not prove that the case has no effect, and crossing one does not prove that the case is invalid.

Worked Example: Applying a Screening Guideline

A hypothetical simple linear regression is based on \(n=20\) cases. Suppose three cases have Cook’s distances \(0.05\), \(0.18\), and \(0.42\). Apply the \(4/n\) guideline as a screen.

The guideline is \(4/20=0.20\). Thus, the case with distance \(0.42\) exceeds this screening value, while the cases with \(0.05\) and \(0.18\) do not. The value \(0.42\) warrants closer attention under this rule of thumb, but it does not establish that the case is erroneous or that its removal is appropriate. The guideline is not a significance level and does not give the probability that a case is influential.

Interpret the flagged case in context: check that its recorded values and units are credible, consider whether the model is appropriate for the data, and examine whether the observation represents a meaningful part of the population of interest. Those questions require subject-matter judgment, not just a cutoff.

A Short Algebraic Check

The equivalence of the two computational forms follows directly from the definition of the internally standardized residual. Start with \(r_i=e_i/\sqrt{MSE(1-h_{ii})}\). Squaring gives \(r_i^2=e_i^2/[MSE(1-h_{ii})]\), so \(e_i^2/MSE=r_i^2(1-h_{ii})\). Substituting this equality into the original Cook’s-distance formula gives:

$$ D_i=\frac{e_i^2}{pMSE}\frac{h_{ii}}{(1-h_{ii})^2} =\frac{r_i^2(1-h_{ii})}{p}\frac{h_{ii}}{(1-h_{ii})^2} =\frac{r_i^2}{p}\frac{h_{ii}}{1-h_{ii}}. $$

This identity is useful as a calculation check. Small rounding differences between the two forms are expected when intermediate values are rounded.

Common Mistakes

  • Calling every large residual influential. A large residual indicates a response that the model predicts poorly, but influence also depends on leverage. Use Cook’s distance to combine both features.
  • Equating high leverage with influence. An unusual predictor value gives a case potential to affect the fit, but a small residual can limit its Cook’s distance.
  • Treating \(4/n\) or 1 as a decisive cutoff. These are screening guidelines, not formal tests. A flag calls for examination, not automatic removal.
  • Interpreting Cook’s distance as a probability or direction. It is a nonnegative, dimensionless diagnostic measure. It does not give the probability a case is wrong or say which way a coefficient would move.

A careful analysis uses Cook’s distance as one piece of evidence about the fitted regression. A flagged case may reveal a recording error, a model limitation, a legitimately unusual observation, or a combination of these. The appropriate response depends on the evidence and the study question; the numerical diagnostic alone cannot decide.

Check Your Understanding

Use the definition and reasoning in this tutorial to answer the following questions.

  1. In a simple linear regression, how many coefficients are included in \(p\), and why is \(p\) needed in the Cook’s-distance formula?
  2. A case has high leverage but a very small residual. Explain why its Cook’s distance might still be modest.
  3. For \(p=2\), \(MSE=9\), \(e_i=6\), and \(h_{ii}=0.25\), calculate \(D_i\).
  4. Why is a Cook’s distance above \(4/n\) not sufficient reason to remove an observation?
  5. Can Cook’s distance alone tell whether a fitted slope increases or decreases when a case is influential? Explain.