In statistics, a studentized residual is the dimensionless ratio resulting from the division of a residual by an estimate of its standard deviation, both expressed in the same units. It is a form of a Student's t-statistic, with the estimate of error varying between points.
This is an important technique in the detection of outliers. It is among several named in honor of William Sealey Gosset, who wrote under the pseudonym "Student" (e.g., Student's distribution). Dividing a statistic by a sample standard deviation is called studentizing, in analogy with standardizing and normalizing.
See also: Errors and residuals in statistics.
The key reason for studentizing is that, in regression analysis of a multivariate distribution, the variances of the residuals at different input variable values may differ, even if the variances of the errors at these different input variable values are equal. The issue is the difference between errors and residuals in statistics, particularly the behavior of residuals in regressions.
Consider the simple linear regression model
Y=\alpha0+\alpha1X+\varepsilon.
Given a random sample (Xi, Yi), i = 1, ..., n, each pair (Xi, Yi) satisfies
Yi=\alpha0+\alpha1Xi+\varepsiloni,
where the errors
\varepsiloni
\sigma2
\alpha0
\alpha1
\widehat{\varepsilon}
\varepsilon
n | |
\sum | |
i=1 |
\widehat{\varepsilon}i=0
and
n | |
\sum | |
i=1 |
\widehat{\varepsilon}ixi=0.
(Here εi is the ith error, and
\widehat{\varepsilon}i
The residuals, unlike the errors, do not all have the same variance: the variance decreases as the corresponding x-value gets farther from the average x-value. This is not a feature of the data itself, but of the regression better fitting values at the ends of the domain. It is also reflected in the influence functions of various data points on the regression coefficients: endpoints have more influence. This can also be seen because the residuals at endpoints depend greatly on the slope of a fitted line, while the residuals at the middle are relatively insensitive to the slope. The fact that the variances of the residuals differ, even though the variances of the true errors are all equal to each other, is the principal reason for the need for studentization.
It is not simply a matter of the population parameters (mean and standard deviation) being unknown – it is that regressions yield different residual distributions at different data points, unlike point estimators of univariate distributions, which share a common distribution for residuals.
For this simple model, the design matrix is
X=\left[\begin{matrix}1&x1\ \vdots&\vdots\ 1&xn\end{matrix}\right]
and the hat matrix H is the matrix of the orthogonal projection onto the column space of the design matrix:
H=X(XTX)-1XT.
The leverage hii is the ith diagonal entry in the hat matrix. The variance of the ith residual is
2(1-h | |
\operatorname{var}(\widehat{\varepsilon} | |
ii |
).
In case the design matrix X has only two columns (as in the example above), this is equal to
2\left( | |
\operatorname{var}(\widehat{\varepsilon} | |
i)=\sigma |
1-
1n | ||||||||||||
|
\right).
In the case of an arithmetic mean, the design matrix X has only one column (a vector of ones), and this is simply:
2\left( | |
\operatorname{var}(\widehat{\varepsilon} | |
i)=\sigma |
1-
1n | |
\right). |
Given the definitions above, the Studentized residual is then
ti={\widehat{\varepsilon}i\over\widehat{\sigma}\sqrt{1-hii }}
where hii is the leverage, where
\widehat{\sigma}
In the case of a mean, this is equal to:
ti={\widehat{\varepsilon}i\over\widehat{\sigma}\sqrt{(n-1)/n}}
The usual estimate of σ2 is the internally studentized residual
\widehat{\sigma}2={1\over
n | |
n-m}\sum | |
j=1 |
2 | |
\widehat{\varepsilon} | |
j |
.
where m is the number of parameters in the model (2 in our example).
But if the i th case is suspected of being improbably large, then it would also not be normally distributed. Hence it is prudent to exclude the i th observation from the process of estimating the variance when one is considering whether the i th case may be an outlier, and instead use the externally studentized residual, which is
2={1 | |
\widehat{\sigma} | |
(i) |
\overn-m-1}\sum\begin{smallmatrixj=1\\j\nei\end{smallmatrix}}n
2 | |
\widehat{\varepsilon} | |
j |
,
based on all the residuals except the suspect i th residual. Here is to emphasize that
2 | |
\widehat{\varepsilon} | |
j |
(j\nei)
If the estimate σ2 includes the i th case, then it is called the internally studentized residual,
ti
2 | |
\widehat{\sigma} | |
(i) |
ti(i)
If the errors are independent and normally distributed with expected value 0 and variance σ2, then the probability distribution of the ith externally studentized residual
ti(i)
\scriptstyle-infty
\scriptstyle+infty
On the other hand, the internally studentized residuals are in the range
\scriptstyle0\pm\sqrt{\nu}
ti\sim\sqrt{\nu}{t\over\sqrt{t2+\nu-1}}
where t is a random variable distributed as Student's t-distribution with ν − 1 degrees of freedom. In fact, this implies that ti2 /ν follows the beta distribution B(1/2,(ν − 1)/2).The distribution above is sometimes referred to as the tau distribution;[2] it was first derived by Thompson in 1935.[3]
When ν = 3, the internally studentized residuals are uniformly distributed between
\scriptstyle-\sqrt{3}
\scriptstyle+\sqrt{3}
The standard deviation of the distribution of internally studentized residuals is always 1, but this does not imply that the standard deviation of all the ti of a particular experiment is 1.For instance, the internally studentized residuals when fitting a straight line going through (0, 0) to the points (1, 4), (2, −1), (2, −1) are
\sqrt{2}, -\sqrt{5}/5, -\sqrt{5}/5
Note that any pair of studentized residual ti and tj (where
i ≠ j
Many programs and statistics packages, such as R, Python, etc., include implementations of Studentized residual.
Language/Program | Function | Notes | |
---|---|---|---|
rstandard(model, ...) | internally studentized. See https://stat.ethz.ch/R-manual/R-devel/library/stats/html/influence.measures.html | ||
rstudent(model, ...) | externally studentized. See https://stat.ethz.ch/R-manual/R-devel/library/stats/html/influence.measures.html |