Tutorials › Exam SRM - Statistics for Risk Modeling › Influence Plots Combining Residuals and Leverage

Exam SRM · Regression Diagnostics · Tutorial 108 of 926

Influence Plots Combining Residuals and Leverage

Learn how residual size and leverage combine in an influence plot, and how Cook’s-distance contours help identify observations for closer review.

Intermediate 10 min read

What You'll Learn

  • Read leverage and studentized residuals as complementary coordinates on an influence plot
  • Distinguish response outliers from high-leverage cases and influential observations
  • Interpret Cook’s-distance contours using internally studentized residuals
  • Adjust Cook’s-distance calculations when a plot uses externally studentized residuals
  • Use diagnostic cutoffs as review signals rather than automatic deletion rules

Why Combine Residuals and Leverage?

A regression diagnostic can flag an observation for different reasons. Its response may be unusual relative to the fitted model, its predictor values may be far from the rest of the data, or it may affect the fitted regression substantially. These are related but distinct features. An influence plot brings two of them together by placing studentized residuals against leverage, often adding Cook’s-distance contours or point sizes.

The plot is useful because neither coordinate alone gives the full picture. A large residual at low leverage may have little effect on the fitted regression. A high-leverage case with a small residual may fit the model closely and have modest influence. Cook’s distance summarizes how residual size and leverage combine to measure a case’s effect on the fitted coefficients.

Definition: In a linear regression with \(n\) observations and \(p\) fitted coefficients, an influence plot typically places the leverage \(h_{ii}\) on the horizontal axis and a studentized residual for observation \(i\) on the vertical axis. Cook’s distance \(D_i\) summarizes the change in the fitted coefficients when that observation is omitted. A plot may display \(D_i\) using contours, point sizes, or both.

What the Plot Displays

Assume the ordinary least-squares model is fitted using a full-rank design matrix \(X\), with \(n\) rows and \(p\) columns, including the intercept column if the model has an intercept. The hat matrix is \(H=X(X^\mathsf{T}X)^{-1}X^\mathsf{T}\); the diagonal entry \(h_{ii}\) is observation \(i\)’s leverage. Leverage depends on the predictor values, not on the observed response.

Let \(e_i=y_i-\hat y_i\) be the ordinary residual, and let \(s^2=\mathrm{SSE}/(n-p)\) be the full-model residual mean square. The internally studentized residual is \(r_i=e_i/[s\sqrt{1-h_{ii}}]\). It accounts for the fact that observations with higher leverage tend to have smaller residual variance under the model. An externally studentized residual instead uses the residual standard error \(s_{(i)}\) estimated after omitting observation \(i\): \(t_i=e_i/[s_{(i)}\sqrt{1-h_{ii}}]\).

Many influence plots use the externally studentized residual, but conventions vary. Check the plot’s legend or documentation before interpreting numerical contours. The direct Cook’s-distance contour formula below uses the internally studentized residual. When the vertical axis is externally studentized, the conversion is different.

Key distinction: A large absolute studentized residual suggests a response that is unusual given the fitted model. High leverage indicates an unusual predictor pattern. A point is influential when its combination of residual and leverage produces a substantial change in the fitted regression. These labels are not interchangeable.

Cook’s-Distance Contours

For the full least-squares fit, Cook’s distance for observation \(i\) is

$$ D_i=\frac{(\hat{\boldsymbol{\beta}}-\hat{\boldsymbol{\beta}}_{(i)})^\mathsf{T}X^\mathsf{T}X(\hat{\boldsymbol{\beta}}-\hat{\boldsymbol{\beta}}_{(i)})}{p s^2} =\frac{r_i^2}{p}\frac{h_{ii}}{1-h_{ii}}, $$

where \(\hat{\boldsymbol{\beta}}\) is the full-model coefficient estimate and \(\hat{\boldsymbol{\beta}}_{(i)}\) is the estimate after deleting observation \(i\). The first expression measures the coefficient change on a scale that accounts for the design and residual variance. The second expression shows why Cook’s distance can be read from the residual and leverage coordinates together.

For a fixed Cook’s-distance contour \(D_i=c\), the internally studentized-residual magnitude at leverage \(h_{ii}\) is

$$ |r_i|=\sqrt{\frac{c p(1-h_{ii})}{h_{ii}}}. $$

As leverage increases, a smaller residual magnitude can reach the same Cook’s-distance contour. Conversely, at low leverage, the residual must be larger to produce the same value of \(D_i\). This is the central visual message of the contours.

Why the Formula Holds

The case-deletion identity for least squares gives \(\hat{\boldsymbol{\beta}}-\hat{\boldsymbol{\beta}}_{(i)} =(X^\mathsf{T}X)^{-1}\mathbf{x}_i e_i/(1-h_{ii})\), where \(\mathbf{x}_i\) is the predictor vector for observation \(i\). Substituting this coefficient change into the defining quadratic form yields

$$ (\hat{\boldsymbol{\beta}}-\hat{\boldsymbol{\beta}}_{(i)})^\mathsf{T} X^\mathsf{T}X (\hat{\boldsymbol{\beta}}-\hat{\boldsymbol{\beta}}_{(i)}) =\frac{e_i^2\,\mathbf{x}_i^\mathsf{T}(X^\mathsf{T}X)^{-1}\mathbf{x}_i}{(1-h_{ii})^2} =\frac{e_i^2h_{ii}}{(1-h_{ii})^2}. $$

The last equality follows from the definition \(h_{ii}=\mathbf{x}_i^\mathsf{T}(X^\mathsf{T}X)^{-1}\mathbf{x}_i\). Dividing by \(p s^2\), then using \(r_i^2=e_i^2/[s^2(1-h_{ii})]\), gives \(D_i=r_i^2h_{ii}/[p(1-h_{ii})]\). This algebraic identity holds for the least-squares fit when the deletion is defined; its interpretation as a measure of model influence does not require normally distributed errors.

Worked Example: Classifying Points From Their Plot Coordinates

A hypothetical regression has \(n=40\) observations and \(p=3\) coefficients. Its influence plot uses internally studentized residuals. Four points have the following coordinates: A \((h_{ii}=0.10,r_i=1.0)\), B \((0.40,1.5)\), C \((0.08,3.0)\), and D \((0.25,2.0)\). Calculate Cook’s distance for each and describe the diagnostic pattern. Use \(4/n\) only as a rough review flag.

Method. Substitute each point’s leverage and squared residual into \(D_i=r_i^2h_{ii}/[p(1-h_{ii})]\), with \(p=3\).

For A, \(r_i^2=1.00\), so \(D_A=1.00(0.10)/[3(0.90)]=0.10/2.70=0.0370\).

For B, \(r_i^2=2.25\), so \(D_B=2.25(0.40)/[3(0.60)]=0.90/1.80=0.5000\).

For C, \(r_i^2=9.00\), so \(D_C=9.00(0.08)/[3(0.92)]=0.72/2.76=0.2609\).

For D, \(r_i^2=4.00\), so \(D_D=4.00(0.25)/[3(0.75)]=1.00/2.25=0.4444\). The rough reference value is \(4/n=4/40=0.10\). B has the greatest leverage and a Cook’s distance of 0.5000; C has the largest residual magnitude but lower leverage; D combines a moderately large residual with moderate leverage. All three exceed the rough reference value, so each merits review, while A does not. These flags do not establish that any observation is erroneous.

Common mistake avoided. Calling C the only influential point because it has the largest residual ignores leverage. The Cook’s-distance calculation shows that B and D also combine their residuals and leverage to produce substantial case-deletion measures.

When the Plot Uses Externally Studentized Residuals

If the vertical coordinate is the externally studentized residual \(t_i\), do not substitute \(t_i\) directly into the internally studentized contour formula. Let \(\nu=n-p\). The deleted residual variance satisfies \(s_{(i)}^2/s^2=(\nu-r_i^2)/(\nu-1)\), and therefore \(t_i^2=r_i^2(\nu-1)/(\nu-r_i^2)\). Solving for \(r_i^2\) gives

$$ r_i^2=\frac{t_i^2\nu}{\nu-1+t_i^2}. $$

Thus the corresponding Cook’s distance, expressed using the external residual, is \(D_i=\dfrac{h_{ii}}{p(1-h_{ii})}\dfrac{t_i^2\nu}{\nu-1+t_i^2}\). Under the usual independent, constant-variance normal-error model, the externally studentized residual also has a \(t\) distribution with \(\nu-1\) degrees of freedom when the model is correct. That distributional result is useful for residual testing, but it is not needed for the conversion or the Cook’s-distance identity.

Worked Example: Converting an External Residual to Cook’s Distance

A hypothetical regression has \(n=30\), \(p=3\), leverage \(h_{ii}=0.30\), and externally studentized residual \(t_i=2.00\). Find the internally studentized residual magnitude and Cook’s distance. Then check the result by showing why direct substitution of \(t_i\) into the internal-residual formula is incorrect.

Method. Here \(\nu=n-p=30-3=27\). Convert from the external to the internal residual before applying the Cook’s-distance identity.

First, \(t_i^2=4.00\), so \(r_i^2=4.00(27)/[27-1+4.00]=108/30=3.60\). Hence \(|r_i|=\sqrt{3.60}=1.8974\), rounded to four decimal places.

Next, \(D_i=3.60(0.30)/[3(1-0.30)]=1.08/[3(0.70)]=1.08/2.10=0.5143\), rounded to four decimal places.

Directly substituting \(t_i=2.00\) would give \(4.00(0.30)/2.10=0.5714\), which is not the correct Cook’s distance. The discrepancy occurs because \(t_i\) uses the deleted-case variance estimate, while the contour identity uses \(r_i\), based on the full-model estimate.

Check. The conversion gives \(r_i^2=3.60\), and substituting that value into the internally studentized formula gives \(D_i=0.5143\), as calculated. The common mistake is mixing residual definitions in a formula without converting between them.

Reading the Plot Without Overstating It

A practical reading separates the two axes before considering the Cook’s-distance contours. First note which points have large absolute studentized residuals. Then identify points with unusual leverage relative to the rest of the design. Finally, look for points that also lie near or beyond substantial Cook’s-distance contours, or that are drawn with conspicuously large Cook’s-distance bubbles.

1
Check the scale and legend.
Confirm which studentized residual is shown, how Cook’s distance is encoded, and whether the axes include a reference line at zero residual.
2
Assess residual size.
A point far above or below zero has a large residual in standardized units and may be an outlying response, subject to the model and the diagnostic’s limitations.
3
Assess leverage.
A point far to the right has a predictor pattern that is unusual relative to the design. High leverage alone does not imply a large response residual or strong influence.
4
Combine the evidence.
Use the contours or point sizes to find cases with larger Cook’s distance. Such points are candidates for closer investigation, not automatic deletions.

Reference values such as \(D_i=1\) or \(4/n\), and leverage rules based on multiples of \(p/n\), are screening conventions rather than universal decision boundaries. A point just below a reference can still matter in context, and a point above one is not automatically invalid. Check the data for recording problems, reconsider whether the model is appropriate, and report diagnostic findings with the analysis.

Worked Example: Finding the Residual Needed to Reach a Contour

A hypothetical model has \(p=4\) fitted coefficients, and an influence plot uses internally studentized residuals. Find the residual magnitude needed to reach the Cook’s-distance contour \(D_i=0.50\) at leverage \(h_{ii}=0.20\). Repeat at leverage \(h_{ii}=0.50\), and explain the comparison.

Method. Rearrange the contour equation to \(|r_i|=\sqrt{D_i p(1-h_{ii})/h_{ii}}\).

At \(h_{ii}=0.20\), the squared residual required is \(0.50(4)(1-0.20)/0.20=2(0.80)/0.20=8.00\). Therefore \(|r_i|=\sqrt{8.00}=2.8284\), rounded to four decimal places.

At \(h_{ii}=0.50\), the squared residual required is \(0.50(4)(1-0.50)/0.50=2(0.50)/0.50=2.00\). Therefore \(|r_i|=\sqrt{2.00}=1.4142\), rounded to four decimal places.

The higher-leverage point needs a smaller residual magnitude to reach the same Cook’s-distance contour. This follows directly from the factor \(h_{ii}/(1-h_{ii})\) in Cook’s distance. Common mistake avoided: treating a fixed residual magnitude as equally influential at every leverage value would miss this leverage adjustment.

Common Reading Errors

  • Equating a response outlier with an influential case. A large residual is one ingredient; leverage also affects Cook’s distance.
  • Equating leverage with influence. A high-leverage point can have a small residual and modest Cook’s distance.
  • Ignoring the residual definition. The simple contour equation uses internally studentized residuals. Convert an external residual first, or use a contour defined for that residual type.
  • Treating a contour as a deletion rule. A contour identifies a diagnostic signal to investigate; it does not prove an observation should be removed.
Key takeaway: An influence plot combines residual size and leverage, while Cook’s distance summarizes their joint case-deletion effect on the fitted coefficients. Read the axes and legend carefully, identify which cases merit investigation, and treat diagnostic cutoffs as prompts for review rather than verdicts.

Check Your Understanding

For each question, use the stated residual type and show enough intermediate work to verify the final value.

  1. A model has \(p=3\), with internally studentized residual \(r_i=1.50\) and leverage \(h_{ii}=0.20\). Calculate Cook’s distance. (Answer: \(D_i=0.1875\))
  2. A model has \(p=4\). At leverage \(h_{ii}=0.40\), what absolute internally studentized residual reaches the contour \(D_i=0.25\)? (Answer: \(|r_i|=\sqrt{1.50}\approx1.2247\))
  3. For a model with \(p=2\), compare point A with \((h_{ii}=0.05,r_i=4.00)\) and point B with \((h_{ii}=0.40,r_i=1.00)\). Calculate both Cook’s distances and identify which is larger. (Answer: \(D_A\approx0.4211\), \(D_B\approx0.3333\); point A has the larger Cook’s distance.)
  4. A model has \(n=24\), \(p=3\), \(h_{ii}=0.25\), and external studentized residual \(t_i=2.00\). Find \(r_i^2\) and Cook’s distance. (Answer: \(r_i^2=3.50\), \(D_i\approx0.3889\))
  5. A model has \(n=50\), \(p=3\). Point A has \(h_{ii}=0.05\), \(r_i=3.00\); point B has \(h_{ii}=0.35\), \(r_i=0.80\). Using \(4/n\) as a rough Cook’s-distance flag, calculate both distances and state whether each exceeds the flag. (Answer: \(D_A\approx0.1579\), \(D_B\approx0.1149\), and both exceed \(4/n=0.08\); A has the larger residual, while B has the larger leverage.)
Clinical Biostats