Tutorials › Introduction to Statistics › Finding Response Outliers With Studentized Residuals

Residuals and Transformations · Tutorial 286 of 996

Finding Response Outliers With Studentized Residuals

Use studentized residuals to flag responses that differ unusually from a fitted regression value, while distinguishing response outliers from influential observations.

Intermediate 10 min read

What You'll Learn

  • Distinguish raw, internally studentized, and externally studentized residuals.
  • State the regression assumptions needed to interpret studentized residuals.
  • Calculate an internally studentized residual using the residual and its fitted-value variance.
  • Calculate an externally studentized residual and use its reference distribution.
  • Treat large residuals as diagnostic flags rather than proof of influence or model failure.
  • Recognize how checking many observations affects outlier screening.

Why Residual Size Needs a Reference

A residual is the difference between an observed response and the response predicted by a fitted regression line. Its sign tells us whether the observation lies above or below the line, and its size is measured in the response variable’s units. But a residual of 8 points may be large in one analysis and ordinary in another. Even within the same regression, residuals do not all have the same expected variability. Studentized residuals address these issues by scaling a residual against an estimate of its variability.

A studentized residual helps identify a response outlier: an observation whose response is unusually far from the fitted value for its predictor value. It is a diagnostic flag, not a verdict. In particular, a large residual alone does not establish that the observation substantially changes the fitted line. That distinct question concerns influence.

Model and Definitions

For simple linear regression, consider the model \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\), where \(x_i\) is the predictor value for case \(i\), \(Y_i\) is its response, and \(\varepsilon_i\) is its error. For the standard studentized-residual calculations, assume the errors are independent, have mean 0 and common variance \(\sigma^2\), and are normally distributed when using exact \(t\)-based inference. The predictor values may be treated as fixed, or the calculations may be understood conditionally on the observed predictor values.

The fitted response is \(\hat{y}_i\), and the raw residual is \(e_i=y_i-\hat{y}_i\). The design must have full rank, meaning the intercept and slope can be estimated separately; in simple linear regression this requires at least two distinct predictor values. The residual standard error \(s\) estimates \(\sigma\) using \(s=\sqrt{\mathrm{SSE}/(n-2)}\), where \(\mathrm{SSE}=\sum e_i^2\). Thus, \(n>2\) is required to estimate \(s\).

Definition: Let \(h_{ii}\) be the \(i\)th diagonal entry of the regression hat matrix, a quantity determined by the predictor values and the regression fit. It accounts for the fact that the fitted response at case \(i\) is estimated using that case. The internally studentized residual is \(r_i=e_i/[s\sqrt{1-h_{ii}}]\). The externally studentized residual, also called the deleted studentized residual, is \(t_i=e_i/[s_{(i)}\sqrt{1-h_{ii}}]\), where \(s_{(i)}\) estimates the error standard deviation after case \(i\) is omitted from estimating the line and its residual variation.

Both statistics are dimensionless: the residual and its estimated standard deviation are in the same response units, so those units cancel. A positive value means the observed response is above its fitted value; a negative value means it is below. The word “studentized” indicates that the residual has been scaled to account for estimated variability. In particular, \(s\sqrt{1-h_{ii}}\), not just \(s\), is the estimated standard deviation of residual \(e_i\).

Why the Scaling Includes the Fitted-Value Adjustment

The factor \(\sqrt{1-h_{ii}}\) arises because a residual is not simply the original error \(\varepsilon_i\). The fitted line was estimated from the data, including case \(i\), so the residual is partly constrained by that fitting process. In matrix notation, the vector of fitted values is \(H\mathbf{Y}\), where \(H\) is the hat matrix, and the vector of residuals is \((I-H)\mathbf{Y}\). Under the model, the residual vector is \((I-H)\boldsymbol{\varepsilon}\), since the fitted regression component is removed by \(I-H\).

The error covariance matrix is \(\sigma^2 I\) under the independence and equal-variance assumptions. The variance of the \(i\)th residual is therefore the \(i\)th diagonal element of \(\sigma^2(I-H)\), which gives:

$$ \operatorname{Var}(e_i\mid X) =\sigma^2(1-h_{ii}). $$

Replacing the unknown \(\sigma\) with \(s\) gives the internal scaling. The external version instead uses an error-variation estimate that does not include case \(i\). This can be useful because an extreme residual can inflate the full-data estimate \(s\), making its own internally studentized value less extreme.

Calculating and Using Studentized Residuals

For simple linear regression, there are two fitted coefficients, the intercept and slope. The externally studentized statistic uses the residual variation from the regression fitted without the case being checked. If that deleted fit has full rank, it has \(n-1\) observations and \(n-3\) residual degrees of freedom. In particular, \(n>3\) is needed for a positive residual degrees of freedom. Under the normal-error model, the externally studentized residual has a \(t\) distribution with \(n-3\) degrees of freedom when the case is not an outlier under that model. This reference distribution is conditional on the predictor values and the stated assumptions.

A commonly used algebraic calculation for the deleted residual standard error is:

$$ s_{(i)}^2= \frac{\mathrm{SSE}-e_i^2/(1-h_{ii})}{n-3}. $$

This formula requires that omitting case \(i\) still leaves a full-rank regression design. An externally studentized value can be compared with a \(t\) distribution to assess whether that individual response is unusually far from its fitted value. Such an assessment depends on the normal-error model being a reasonable description; residual plots and the data context still matter.

Worked Example: An Internally Studentized Residual

Suppose a hypothetical regression predicts quiz scores from study hours. For one student, the observed score is 51 points and the fitted score is 43 points. The regression has \(s=4.0\) points, and the case has \(h_{ii}=0.20\). Calculate and interpret its internally studentized residual.

First, the raw residual is \(e_i=51-43=8\) points. The estimated standard deviation of this residual is \(s\sqrt{1-h_{ii}}\):

$$ 4.0\sqrt{1-0.20} =4.0\sqrt{0.80} \approx 3.578\text{ points}. $$

Therefore,

$$ r_i=\frac{8}{4.0\sqrt{0.80}} \approx 2.236. $$

The positive sign indicates a score above the fitted value. Its response is about 2.24 estimated residual standard deviations above that value. This makes the case worth checking, but does not alone establish that the response is an outlier under a formal test or that the case changes the fitted line substantially.

Worked Example: Comparing Internal and External Studentization

In a hypothetical study, a simple regression has \(n=12\) cases and full-data residual standard error \(s=3.8\) units. One case has residual \(e_i=-9\) units and \(h_{ii}=0.10\). Assume the regression design remains full rank when this case is omitted. Calculate both studentized residuals.

The internally studentized residual is:

$$ r_i=\frac{-9}{3.8\sqrt{1-0.10}} =\frac{-9}{3.8\sqrt{0.90}} \approx -2.497. $$

For the external calculation, first recover the full-data sum of squared errors from \(s^2=\mathrm{SSE}/(n-2)\):

$$ \mathrm{SSE}=s^2(n-2) =(3.8)^2(12-2) =14.44(10) =144.4. $$

The deleted residual standard error is then:

$$ s_{(i)}^2 =\frac{144.4-(-9)^2/(1-0.10)}{12-3} =\frac{144.4-90}{9} =\frac{54.4}{9} \approx 6.044, $$ $$ s_{(i)}\approx \sqrt{6.044}\approx 2.459. $$

Thus,

$$ t_i=\frac{-9}{2.459\sqrt{0.90}} \approx -3.859. $$

The negative sign again indicates a response below its fitted value. Here the externally studentized residual is more extreme than the internal one because omitting the case lowers the estimated residual variation. Under the stated normal-error assumptions, this statistic is compared with a \(t\) distribution with \(12-3=9\) degrees of freedom. A two-sided comparison gives a p-value of approximately 0.004. This is evidence that this response is unusual relative to its fitted value under the model, not proof that the model is correct or that the case is influential.

Worked Example: Screening Several Responses

Suppose a hypothetical analysis has 18 cases, and its internally studentized residuals include \(+2.6\), \(-2.2\), and \(+0.7\). An analyst uses \(|r_i|>2\) as an informal screening rule. Which cases merit closer examination?

For the first case, \(|2.6|=2.6>2\), so it is flagged; its response is above its fitted value. For the second, \(|-2.2|=2.2>2\), so it is also flagged; its response is below its fitted value. For the third, \(|0.7|=0.7<2\), so it is not flagged by this rule.

The rule is a prompt to inspect the cases, not a universal significance cutoff. If many residuals are screened, even a well-fitting model can produce one or more apparently large values by chance. The analyst should consider the number of cases checked, the model assumptions, the original records, and relevant context before drawing conclusions.

What a Large Studentized Residual Does—and Does Not—Show

A large absolute studentized residual points to an unusual response compared with the fitted response at that predictor value, relative to estimated residual variation. It can motivate checking for recording errors, unusual circumstances, or a feature of the relationship the model does not capture. It does not tell us which explanation is correct. Nor does it prove that the regression is useless: one unusual observation can coexist with a useful overall model.

Most importantly, response unusualness and influence are different questions. A studentized residual measures how far a response falls from its fitted value after scaling. Influence asks how much the fitted regression results would change if a case were omitted. That change depends on more than residual size. A case with an extreme response residual is not automatically influential, and an observation need not have a large residual to warrant a separate diagnostic check.

The size of a studentized residual is also not a substitute for checking model assumptions. Dependence, unequal error variance, or a systematic pattern in residuals can make the usual reference calculations misleading. A \(t\)-based p-value for an externally studentized residual relies on the stated model, including normal errors. For practical diagnostics, interpret the statistic alongside the residual patterns and the data-generating context.

Common Mistakes

  • Using the raw residual alone. A raw residual is in response units and does not account for residual variability or the fitted-value adjustment. Compare a suitably studentized residual when screening for unusual responses.
  • Calling every value beyond 2 a proven outlier. A threshold such as \(|r_i|>2\) is an informal flag, not a universal rule. A formal assessment must use an appropriate reference distribution and account for how many cases were examined.
  • Calling a response outlier influential. A large studentized residual identifies distance from a fitted value, not the size of the change in the fitted regression when that case is removed.
  • Using the external \(t\) reference without its conditions. The simple-regression reference uses \(n-3\) degrees of freedom, requires \(n>3\), and depends on the normal-error model and a full-rank deleted fit.
Key takeaway: Studentized residuals express response departures in estimated residual standard-deviation units. They help flag responses unusually far from fitted values, but a flag is a reason to investigate—not proof of an error, model failure, or influence.

Check Your Understanding

Answer each question using the definitions and conditions above.

  1. A case has observed response 26, fitted response 30, residual standard error 2, and \(h_{ii}=0.36\). Calculate its internally studentized residual and interpret its sign.
  2. Why does the internally studentized residual use \(s\sqrt{1-h_{ii}}\) rather than just \(s\) in its denominator?
  3. In simple linear regression, how many residual degrees of freedom are used for the deleted error estimate, and what minimum sample size is required for them to be positive?
  4. Explain why a large absolute studentized residual does not by itself show that a case strongly changes the fitted line.
  5. Why should an analyst be cautious about treating the largest residual as statistically unusual after screening many cases?