1 Background and definition
1.1 Residuals in linear regression
In linear regression, a model produces fitted values \(\hat{y}_i\) for observations \((y_i, x_i)\). The residual for observation \(i\) is the difference between what was observed and what the model predicts: \[ e_i = y_i - \hat{y}_i. \] Residuals indicate where the model deviates from the data, but their raw magnitudes are not always directly comparable across observations because the model’s prediction uncertainty can vary from point to point.
1.2 Studentization concept
“Studentization” rescales residuals by an estimate of their standard deviation. The goal is to convert residuals into quantities measured in “standard deviation units,” enabling a more uniform interpretation across observations. In practice, this means dividing a residual by a standard error term that reflects variability associated with the fitted model at that observation.
1.3 Internal vs external studentization
Internally studentized residuals use an uncertainty estimate computed in a manner that excludes the observation being assessed. This “internal” aspect makes the scaling depend on the model fitted to the remaining data. By contrast, “externally” studentized residuals use uncertainty estimates derived from the full data in a different way (and may involve additional degrees-of-freedom adjustments). The internally studentized version is widely used because many software implementations provide it directly and it aligns well with leave-one-out variance ideas.
2 Mathematical formulation
2.1 The regression setup and notation
Consider a linear regression with design matrix \(X\) and coefficient vector \(\beta\). The model is \[ y = X\beta + \varepsilon, \] with \(y \in \mathbb{R}^n\). The fitted values are \[ \hat{y} = X\hat{\beta}, \quad \hat{\beta} = (X^\top X)^{-1}X^\top y, \] and the residual vector is \[ e = y - \hat{y}. \] Let \(h_{ii}\) denote the \(i\)th diagonal element of the hat matrix \(H = X(X^\top X)^{-1}X^\top\). These leverage values quantify how strongly observation \(i\) influences its own fitted value.
2.2 Deleted residuals and leave-one-out variance
Internally studentized residuals are based on a variance estimate derived from a model refit after removing the \(i\)th observation.
2.2.1 Computation of the internally estimated variance
Let \(SSE = \sum_{j=1}^n e_j^2\) be the residual sum of squares from the full fit. The deleted sum of squares for observation \(i\) is \[ SSE_{(i)} = \frac{SSE - e_i^2/(1-h_{ii})}{1}. \] Equivalently, one can express it using the fact that the leave-one-out residual for point \(i\) scales the ordinary residual by \((1-h_{ii})\). Software often computes the internally studentized variance via formulas that avoid explicit refitting.
With \(p\) as the number of estimated parameters (including the intercept), the degrees of freedom for the deleted fit are \(n-1-p\). A common variance estimator used in the internal studentization is \[ \hat{\sigma}^2_{(i)} = \frac{SSE_{(i)}}{n-1-p}. \] This variance is “internal” because it is computed from a dataset with the \(i\)th observation removed.
2.2.2 Link to the fitted values and leverage
The standard error of the prediction component relevant to observation \(i\) depends on leverage. For the residual-based diagnostic, the scaling typically involves \(\sqrt{\hat{\sigma}^2_{(i)}(1-h_{ii})}\). The factor \((1-h_{ii})\) reflects that points with higher leverage can produce different uncertainty levels for their fitted values.
2.3 Standardization and scaling by uncertainty
The internally studentized residual for observation \(i\) is typically written as \[ r_i^{(int)} = \frac{e_i}{\sqrt{\hat{\sigma}^2_{(i)}(1-h_{ii})}}. \] This quantity answers: “How large is the residual relative to the model’s expected noise level, where the noise level is estimated without using the same observation?” Under idealized regression assumptions, these residuals behave like standardized quantities that can be compared across observations.
3 Relation to diagnostics and influence
3.1 Connection to leverage (hat values)
Leverage \(h_{ii}\) indicates whether an observation has an unusual configuration of predictor values relative to the rest of the dataset. While leverage alone does not measure how wrong a prediction is, it affects the denominator of the internally studentized residual. As a result, an observation can appear exceptional either because its residual is large, because it has high leverage, or because both interact through the standardization.
3.2 Connection to Cook’s distance and influence measures
Influence measures aim to capture whether removing an observation changes the fitted model substantially. Internally studentized residuals relate to these ideas because they combine (i) the size of the residual and (ii) uncertainty scaling informed by deletion. Cook’s distance, for example, uses changes in fitted values aggregated over the sample and is closely tied to the residual and leverage structure. A large internally studentized residual often signals that the observation could meaningfully affect the fit, but the relationship is not one-to-one with Cook’s distance.
3.3 Interpreting sign and magnitude
3.3.1 Positive vs negative internally studentized residuals
The sign of \(r_i^{(int)}\) matches the sign of the ordinary residual \(e_i = y_i-\hat{y}_i\):
- Positive values indicate the observed response exceeds the model’s prediction.
- Negative values indicate the observed response falls below the model’s prediction.
The magnitude indicates how many estimated standard deviations the observation deviates, after accounting for uncertainty.
3.3.2 Typical ranges and heuristic thresholds
| There is no universal threshold, but large absolute values are typically treated as suspicious. In many workflows, values with \( | r_i^{(int)} | \) well above what is expected under the model’s typical noise are flagged for further review. The precise cutoff depends on sample size, model complexity, and how closely assumptions hold. Practitioners often use visual inspections and compare candidate points across multiple diagnostics rather than relying on a single numeric boundary. |
|---|
4 Practical computation and workflow
4.1 When to use internally studentized residuals
Internally studentized residuals are useful when analysts want residuals that are scaled for varying uncertainty, especially for identifying outlying observations that may reflect data problems or inadequacy in the model. They are particularly relevant in linear model checking where one expects a roughly constant variance structure and wants diagnostics that reduce the misleading effect of raw residual scale differences.
4.2 Step-by-step calculation in common software
Although formulas can be implemented manually, most users compute these diagnostics through statistical packages. A typical workflow is:
- Fit the linear regression model using ordinary least squares.
- Obtain leverage values \(h_{ii}\) and residuals \(e_i\).
- Compute a leave-one-out or deleted variance estimate \(\hat{\sigma}^2_{(i)}\), often via efficient algebra rather than explicit refitting.
- Form the standardized diagnostic:
\[ r_i^{(int)} = \frac{e_i}{\sqrt{\hat{\sigma}^2_{(i)}(1-h_{ii})}}. \] The software then reports these values or plots them to facilitate identification of notable cases.
4.3 Assumptions and prerequisites
4.3.1 Linearity and homoscedasticity considerations
Internally studentized residuals are derived under the linear model framework and rely on variance estimation aligned with the assumed error structure. If the model is misspecified (nonlinearity in the mean) or if the variance changes substantially with predictors, the diagnostic scaling may not behave as intended, and “large” residuals might reflect structural mismatch rather than isolated outliers.
4.3.2 Independence of errors and model specification
A further prerequisite is that errors are reasonably independent and that the model includes the relevant predictors in the correct functional form. If dependencies among errors exist (e.g., time series without adjustment) or if key variables are omitted, residual diagnostics can become harder to interpret because the standard error model no longer reflects the true uncertainty.
5 Interpretation and visualization
5.1 Residual plots for model checking
A common approach is to visualize internally studentized residuals against fitted values, predictors, or indices. Patterns—such as curvature, funnel shapes, or clusterings—can indicate nonlinearity or variance changes. Internally studentized residuals help make these patterns clearer by standardizing for expected noise variability.
5.2 Mapping residuals to potential outliers
A point with a large absolute internally studentized residual stands out as an observation where the response is unusually different from what the model predicts relative to the estimated uncertainty. Analysts typically cross-check such observations by:
- verifying data entry and measurement accuracy,
- checking whether the predictor values fall in a well-supported region of the covariate space,
- assessing whether the observation corresponds to a leverage regime where the model may extrapolate.
5.3 Comparing to ordinary studentized residuals
5.3.1 Differences in scaling across observations
Ordinary studentized residuals may use variance estimates that do not exclude the current observation in the same way, leading to slightly different scaling. Internally studentized residuals adjust the denominator using the deleted variance, which can change the relative ranking of borderline cases. The practical impact is usually most noticeable for influential points or small-sample settings where deletion meaningfully alters the estimated noise level.
6 Advanced notes
6.1 Generalized linear model extensions (conceptual overview)
In generalized linear models, residuals and variance estimates do not follow the same simple form as in ordinary least squares. Conceptually, the studentization idea persists: one rescales a deviation measure by an uncertainty term that depends on estimated variance and sensitivity of the fitted mean. Extensions often rely on working residuals, model-based weights, and leverages derived from the iterative fitting scheme.
6.2 Effects of heteroscedasticity and robust alternatives
When variance is not constant, internally studentized residuals based on homoscedastic assumptions can misstate relative uncertainty. Analysts may then consider robust covariance estimators, variance-stabilizing transformations, or alternative diagnostics designed for heteroscedastic settings. These approaches aim to align the standardization with the actual error variability so that flagged points better reflect genuine outliers rather than model-implied scaling errors.
6.3 Numerical and implementation details
Implementation details can matter:
- degrees of freedom calculations depend on parameter count,
- predictions and leverage must be computed consistently with the fitted model,
- numerical stability can be affected by near-collinearity in \(X\).
Most modern software handles these issues internally, but results can differ slightly across packages depending on conventions for residual types and variance estimation.
7 Limitations and common pitfalls
7.1 Over-reliance on single diagnostics
A large internally studentized residual suggests a deviation, yet it does not by itself establish causality or data error. It may reflect a true anomaly, a subpopulation effect, measurement noise, or a missing predictor. Relying solely on one diagnostic can lead to unnecessary exclusion of valid data or, conversely, to ignoring broader model problems revealed by other checks.
7.2 Multiple testing and repeated model fitting
When many models are tried or many residuals are inspected, the chance of finding extreme values by randomness increases. This phenomenon makes heuristic thresholds less reliable. A careful workflow often treats suspicious observations as candidates for investigation rather than applying a strict “reject” rule.
7.3 Misinterpretation under model misspecification
If the mean structure is wrong, residuals may become systematically large in certain regions of the predictor space. In such cases, internally studentized residuals may identify areas of misspecification rather than isolated outliers. Interpretation should therefore consider whether the model form aligns with the data-generating process, not only whether an individual point deviates.
8 Example-based illustration (lightweight)
8.1 Simple linear regression example
Suppose a dataset records how many hours someone studies and the resulting quiz score. A fitted linear regression model might predict the quiz score from study hours. Most points fall close to the regression line, but one observation could show an unexpectedly low score for a given number of study hours.
8.2 Identifying an observation with an unusually large residual
| In ordinary terms, the candidate observation has a large raw residual \(e_i\). The internally studentized residual further asks whether this deviation is large relative to the model’s typical noise level after deleting the point and accounting for its leverage. If \( | r_i^{(int)} | \) is notably high, the case becomes a prime suspect for being an outlier: perhaps there was a recording mistake, an unusual circumstance, or the relationship is different for that situation. |
|---|
8.3 Follow-up actions: refit, check assumptions, and investigate data quality
A common follow-up routine is:
- Re-check the data row for correctness (units, transcription, missing context).
- Examine residual plots for systematic patterns (curvature or changing variance).
- Consider whether the model needs additional predictors or a nonlinear term.
- Optionally, compare fit quality with and without the flagged observation to see whether conclusions change in a substantive way.