Author-reviewedEvidence: highv1.0.1

Standardised Residual

A standardised residual is a regression residual divided by its estimated standard deviation, used to flag outlying patients in cost and outcome models.

Status
Published, version 1.0.1
Last reviewed
29 Oct 2026, by Dr Darrin Baines
Report a problem
Tell us if something is wrong or out of date

Concept Architecture

Standardised Residual in Cost Regressions and Meta-Analysis

A standardised residual expresses how far one patient's observed cost or outcome lies from the value a fitted model predicts, in units of that residual's own standard error instead of pounds or QALYs. Health economists check them after fitting cost, utility and resource-use regressions, and meta-analysts read the same quantity to see whether one study sits apart from the pooled model. The rescaling matters because raw residuals from one model do not share a common variance, so a patient with unusual covariate values can fit badly while showing a small raw gap. Three different statistics are reported under this name by common software, and a value of 2.5 can only be judged once the analyst knows which of them was computed.

Why raw residuals need rescaling

The raw residual of patient ii is the observed outcome minus the fitted value, so its size depends on the units of measurement. A residual of GBP 800 is large in a model of outpatient costs and trivial in a model of transplant costs, and Penn State's regression course notes that this dependence on units makes ordinary residuals hard to use for detecting unusual outcomes. Dividing by a standard error removes the units.

A less obvious problem is that the residuals from one fitted model have different variances even when the true errors all share one variance. The Stata manual for regress postestimation gives the variance of each residual from an ordinary least squares fit as follows.

Var⁡(ei)=σ2(1−hii)\operatorname{Var}(e_i) = \sigma^2 (1 - h_{ii})

where ei=yi−y^ie_i = y_i - \hat{y}_i is the raw residual of patient ii, yiy_i is the observed outcome, y^i\hat{y}_i is the fitted value, σ2\sigma^2 is the error variance and hiih_{ii} is the hat value, the iith diagonal element of the hat matrix X(X⊤X)−1X⊤X(X^{\top}X)^{-1}X^{\top} with XX the design matrix. NIST's regression diagnostics guidance states that hat values run between 1n\frac{1}{n} and 1, with an average of pn\frac{p}{n}, where nn is the number of observations and pp the number of fitted coefficients. A patient with a hat value near 1 pulls the fitted line towards its own outcome, so its residual has little room to be large, and the Stata manual notes that the observations with the largest hat values have the residuals with the smallest variance.

Three statistics that share one name

The Stata manual notes that the terms standardised and studentised residual have meant different things to different authors. The simplest version divides each raw residual by ss, the residual standard error, and ignores the hat value. The version that Stata, R and Minitab call the standardised residual adds the hat value to the denominator.

ri=eis1−hiiti=eis(i)1−hiir_i = \frac{e_i}{s\sqrt{1 - h_{ii}}} \qquad t_i = \frac{e_i}{s_{(i)}\sqrt{1 - h_{ii}}}

where s=RSS/(n−p)s = \sqrt{\mathrm{RSS}/(n - p)} is the residual standard error of the full fit, RSS\mathrm{RSS} is the residual sum of squares, rir_i is the internal version and tit_i is the external version, in which s(i)s_{(i)} is the residual standard error of the same model refitted without patient ii. The table shows how the labels map across sources.

DenominatorLabel in Stata and RLabel in NIST and Penn State
ss onlyno separate predict option or functionstandardised residual (NIST)
s1−hiis\sqrt{1 - h_{ii}}standardised residual (rstandard)internally studentised residual
s(i)1−hiis_{(i)}\sqrt{1 - h_{ii}}studentised residual (rstudent)externally studentised, or studentised deleted, residual

The R documentation describes rstandard and rstudent as rescaling residuals to unit variance using an overall and a leave-one-out estimate of the error variance. An article or model report that gives a standardised residual without its formula leaves the reader unable to tell which of the three is meant.

Converting between the internal and external versions

The external version does not require refitting the model once per patient. Penn State gives a conversion that uses only quantities from the full fit.

ti=ri(n−p−1n−p−ri2)1/2t_i = r_i \left( \frac{n - p - 1}{n - p - r_i^2} \right)^{1/2}

where tit_i is the externally studentised residual, rir_i is the internally standardised residual, nn is the number of observations and pp is the number of coefficients including the intercept. Penn State states that tit_i follows a t distribution with n−p−1n - p - 1 degrees of freedom, a result that rests on normally distributed errors. The Stata manual adds that tit_i equals the t statistic for adding a dummy variable that is 1 for patient ii and 0 for everyone else, which is a formal test of whether that patient follows the model.

The conversion also shows a limit on the internal version. The denominator n−p−ri2n - p - r_i^2 must stay positive, so ri2r_i^2 can never exceed n−pn - p, and ∣ri∣|r_i| can never exceed n−p\sqrt{n - p}. In a small data set the internal statistic therefore cannot reach the thresholds analysts often use.

Worked example with six patients and annual costs

The data are illustrative and are the same six registry patients used on the Cook's distance page. Annual healthcare cost in GBP thousand is regressed on the number of chronic conditions by ordinary least squares, giving an intercept of 2.184 and a slope of 0.6947. The residual sum of squares is 0.9316 on n−p=4n - p = 4 degrees of freedom, so the mean squared error is 0.9316 / 4 = 0.2329 and s=0.2329=0.4826s = \sqrt{0.2329} = 0.4826.

PatientConditionsCostRaw residualHat valueResidual over ssInternal rir_iExternal tit_i
102-0.1840.342-0.382-0.471-0.419
2130.1210.2530.2510.2900.254
323-0.5740.195-1.189-1.325-1.531
4350.7320.1681.5161.6622.589
5450.0370.1740.0760.0840.073
6109-0.1320.868-0.273-0.752-0.702

Step 1. Patient 4, the largest residual. The raw residual is 5 minus 4.2684, or 0.7316, and the hat value is 0.1684, so 1−0.1684=0.9119\sqrt{1 - 0.1684} = 0.9119.

r4=0.73160.4826×0.9119=0.73160.4401=1.662r_4 = \frac{0.7316}{0.4826 \times 0.9119} = \frac{0.7316}{0.4401} = 1.662

where 0.7316 is the raw residual of patient 4 in GBP thousand, 0.4826 is ss and 0.9119 is the square root of one minus the hat value.

Step 2. The external version for patient 4. With n−p−1=3n - p - 1 = 3 and r42=2.763r_4^2 = 2.763, the ratio is 34−2.763=31.237=2.425\frac{3}{4 - 2.763} = \frac{3}{1.237} = 2.425, with square root 1.557.

t4=1.662×1.557=2.588t_4 = 1.662 \times 1.557 = 2.588

where 1.557 is the conversion factor from the previous paragraph, and the unrounded result is 2.589. Refitting without patient 4 gives s(4)=0.3098s_{(4)} = 0.3098, and 0.7316 / (0.3098 × 0.9119) gives 2.590, the same value to rounding, as the Stata formula for s(i)s_{(i)} predicts.

Step 3. Patient 6, the unusual patient. Patient 6 has a hat value of 0.8684, so 1−0.8684=0.3627\sqrt{1 - 0.8684} = 0.3627. The residual over ss alone is −0.1316/0.4826=−0.273-0.1316/0.4826 = -0.273, but the internal version is −0.1316/(0.4826×0.3627)=−0.1316/0.1750=−0.752-0.1316/(0.4826 \times 0.3627) = -0.1316/0.1750 = -0.752, close to three times larger in size.

Step 4. Interpretation. No patient is flagged. The bound n−p=4=2\sqrt{n - p} = \sqrt{4} = 2 means no internal value in this data set could pass 2, let alone 3. Patient 4's external value of 2.589 lies inside the 2.5% and 97.5% points of a t distribution with 3 degrees of freedom, which are minus and plus 3.182. Yet Cook's distance for patient 6 is 1.864, the largest, because removing that patient raises the cost per additional condition by about GBP 105 a year. The residual checks find no single cost surprising given the model, while the influence check shows that one patient holds the slope in place.

Reading the size of a standardised residual

Rules of thumb are screening cues and not tests. Penn State states that an observation whose internal value exceeds 3 in absolute size is generally deemed an outlier, and reports that Minitab flags any value above 2. Some analysts reserve the word outlier for an external value above 3, so a report should state which version a cut-off was applied to.

Under normal errors about 5% of patients show an internal value beyond 2 by chance, and Penn State's hospital example calls five such flags among 112 hospitals about the right number. The Stata manual warns that residuals which are individually significant at the 5% level are far less significant jointly, so a large data set will almost always produce some flags.

Healthcare costs break the normal reference distribution directly. Mihaylova and colleagues, reviewing statistical methods for cost data, describe costs as non-negative, often with substantial positive skew, heavy tails and a mass at zero for non-users. In a least squares cost model the largest positive standardised residuals will therefore belong to valid high-cost patients more often than a normal table suggests. The same review regards such apparent outliers as part of the true distribution of costs. Deleting high-cost patients on residual grounds would therefore bias the mean cost on which budgets are based.

Unusual patients that hide their own residual

A standardised residual measures fit, not influence. NIST notes that cases with high hat values tend to generate small residuals even when they are outliers, which is why the deleted residual and the external version exist. Patient 6 in the worked example fits this pattern.

The external version can still miss a group. Penn State's hospital infection example regresses infection risk on average length of stay for 112 hospitals in the United States. Two hospitals with very long stays pull the line towards themselves, so neither has a large internal or external value, and deleting one leaves the other to hold the line in place. Residual checks therefore sit alongside hat values and Cook's distance within wider model diagnostics, and a plot of residuals against hat values shows both features at once.

Generalised linear models for cost data

Cost and resource-use models are often fitted as a generalised linear model, for example with a log link. The R documentation for rstandard offers Pearson and deviance types for such models, and states that its diagnostic values for generalised linear models are approximations that can be poor when some cases have large influence. The deviance residual page covers the deviance-based version.

Studies that stand apart in a meta-analysis

Evidence synthesis uses the same logic with studies in place of patients. Viechtbauer and Cheung adapted the standard diagnostic procedures of linear regression for fixed-effect and random or mixed-effects meta-analytic models. In the metafor package, rstandard returns internally standardised residuals and rstudent returns externally standardised residuals, in which each study is deleted, the model refitted and the study's deviation from its predicted value divided by its standard error. The package documentation states that if a study fits the model, its standardised residual follows, asymptotically, a standard normal distribution.

Viechtbauer's paper on the package gives an example with 13 studies of BCG vaccine against tuberculosis and a meta-regression on absolute latitude and publication year. Studies 7, 12 and 13 look discrepant on a plot, but the external values are -2.60 for study 7, 2.13 for study 13 and only 1.47 for study 12, whose estimate is the least precise of the 13. A raw gap from the model's predicted effect means little until it is set against the study's standard error and the residual between-study variance, and the standardised residual does that scaling. A flagged study in a meta-analysis that feeds a decision model calls for a check of its population and data extraction before any sensitivity analysis that omits the study.

Misreadings and limits

Most errors come from treating the number as a verdict on the data instead of a pointer for investigation. Several of them matter more in health economics than in textbook regression, because cost data are skewed and many meta-analyses contain few studies.

  1. Deleting flagged patients or studies. Penn State advises correcting data entry errors and not deleting points just because they do not fit a preconceived model. When unsure, the data are analysed with and without the point and both results reported.
  2. Applying fixed cut-offs in small samples. With n−pn - p below 9, an internal value can never pass 3.
  3. Reading a small value as good fit. Patients with high hat values and pairs of similar unusual patients can hide their own residuals.
  4. Using the normal table for skewed costs. Large positive values are expected in cost data and are not by themselves errors.
  5. Ignoring the multiple comparisons. Some residuals beyond 2 are expected in any large data set.

Sources

Library

Publications

1
  • Book

    Statistical Analysis of Cost-Effectiveness Data — Willan & Briggs, 1st Edition ed., 2006 (John Wiley & Sons)

    A synthesis of statistical methods for analysing cost-effectiveness data, including net-benefit regression, confidence intervals for the ICER, cost-effectiveness acceptability curves, and covariate adjustment. Part of the Wiley Statistics in Practice series.

Frequently Asked Questions (6)

  • What is a standardised residual?

    A standardised residual is a regression residual divided by its estimated standard deviation, used to flag outlying patients in cost and outcome models.

    Source: StataCorp 2025

  • What does a standardised residual put on a common scale?

    Raw residuals are measured in the units of the outcome, such as pounds or QALYs, so a gap of GBP 800 can be large in one cost model and trivial in another. Dividing each residual by its own estimated standard error removes those units and places every patient on one scale. It also allows for unequal variances, because in an ordinary least squares fit the variance of a residual is the error variance multiplied by one minus the patient's hat value. The Stata manual notes that patients with the largest hat values have the residuals with the smallest variance, so their small raw gaps can hide a poor fit.

    Source: StataCorp 2025

  • How is a standardised residual calculated?

    The version that Stata and R report divides the raw residual, the observed outcome minus the fitted value, by the residual standard error multiplied by the square root of one minus the hat value. The residual standard error is the square root of the residual sum of squares divided by the number of observations minus the number of fitted coefficients. In the six-patient cost example on the page, patient 4 has a raw residual of 0.7316 in GBP thousand, a residual standard error of 0.4826 and a hat value of 0.1684, giving 0.7316 divided by 0.4401, or 1.662. The external version replaces the residual standard error with the one from a refit that leaves the patient out.

    Source: StataCorp 2025

  • Why are standardised residuals used?

    Standardised residuals give a quick check of whether any single observation is surprising given a fitted model, in cost and utility regressions and equally in meta-regression. Viechtbauer's metafor package applies the same diagnostic to studies, with rstandard and rstudent returning internally and externally standardised residuals. In his example of 13 BCG vaccine trials, studies 7, 12 and 13 look discrepant on a plot, yet the external values are -2.60 for study 7 and 2.13 for study 13 but only 1.47 for study 12, whose estimate is the least precise of the 13. The scaling sets each raw gap against the precision of the study and the residual heterogeneity, which a raw gap ignores.

    Source: Viechtbauer 2010

  • How are standardised residuals interpreted?

    Penn State's regression course states that an observation whose internally studentised residual, the version Stata and R call standardised, exceeds 3 in absolute size is generally deemed an outlier, and reports that Minitab flags any value above 2. Under normal errors about 5% of observations pass 2 by chance, so five flags among 112 hospitals in its example is about the right number. The internal value can never exceed the square root of the residual degrees of freedom, so with fewer than 9 of them it cannot reach 3. Penn State advises correcting entry errors and, when unsure, analysing the data with and without the point and reporting both.

    Source: Penn State Eberly College of Science 2026

  • How do standardised residuals differ from studentized residuals?

    The two names describe different denominators, and the Stata manual notes that the terms have meant different things to different authors. In Stata and R the standardised residual divides the raw residual by the full-fit residual standard error times the square root of one minus the hat value, while the studentised residual uses the residual standard error from a regression with that observation removed. Other texts call the first an internally studentised residual, so a reported value needs its formula before it can be judged. Stata adds that the studentised residual equals the t statistic for a dummy variable that is 1 for that observation and 0 elsewhere.

    Source: StataCorp 2025

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 29 Oct 2026

Content version: 1.0.1

Canonical Identity

Term code
HE-ES-SA-202

Stable URI · Machine-readable · Resolvable · CC BY 4.0