Why Prediction Intervals Use a t Critical Value
A prediction interval for a new outcome must allow for two sources of uncertainty: the fitted regression line is estimated from a sample, and the new outcome has its own random error. The simple-regression prediction-interval formula combines these sources in a standard error. But that standard error contains an estimated residual standard deviation, not the unknown population standard deviation. Accounting for that estimation is why the interval uses a t critical value.
The degrees of freedom for that t value matter. In simple linear regression, the fitted line estimates two coefficients: an intercept and a slope. The residual variance is therefore estimated using \(n-2\) degrees of freedom, where \(n\) is the number of observations used to fit the regression. This tutorial connects that residual degrees of freedom to the t calibration and shows how to select a quantile for a specified prediction level.
The Model Behind the Calibration
The t-based result relies on a model, not just on the shape of a formula. For the training observations, suppose the predictor values \(x_i\) are fixed and the outcomes follow \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\), where the errors are independent and each has distribution \(N(0,\sigma^2)\). For the new case, suppose its predictor value \(x_0\) is fixed and its error is independent of the training errors with the same \(N(0,\sigma^2)\) distribution. These conditions say that the mean is linear in the predictor, errors have a common variance, and the errors are normal and independent.
Write \(\hat{y}_0\) for the fitted mean at \(x_0\), and define \(S_{xx}=\sum_{i=1}^{n}(x_i-\bar{x})^2\). The simple-regression prediction standard error is \(s\sqrt{h_0}\), where \(h_0=1+\frac{1}{n}+\frac{(x_0-\bar{x})^2}{S_{xx}}\). The \(1\) accounts for the new outcome’s own error; the other terms account for uncertainty in the fitted mean. The corresponding prediction interval is centered on \(\hat{y}_0\), with its margin determined by this standard error and the chosen t critical value.
Here \(1-\alpha\) is the requested two-sided prediction level, and \(t_{q,\nu}\) denotes the \(q\) quantile of a t distribution with \(\nu\) degrees of freedom: if \(T\) has that distribution, then \(P(T\leq t_{q,\nu})=q\). The quantile is positive when \(q>0.5\). A 95% two-sided prediction interval has \(\alpha=0.05\), so its critical value is \(t_{0.975,n-2}\), not \(t_{0.95,n-2}\).
Why Estimating Residual Variance Leads to t
If \(\sigma\) were known, the prediction error could be divided by its true standard deviation to form a standard normal quantity under the model. In practice, \(\sigma\) is not known, so the calculation replaces it with \(s\). Because \(s\) varies from sample to sample, the resulting standardized prediction error has heavier tails than a standard normal variable. Under the stated normal-error model, it has a t distribution with the residual degrees of freedom.
The connection follows from two standard facts about normal linear regression. First, after fitting an intercept and a slope, the residual sum of squares divided by \(\sigma^2\) has a chi-square distribution with \(n-2\) degrees of freedom. Second, this scaled residual sum of squares is independent of the standardized prediction error when that error is formed using the true \(\sigma\). The fitted line uses two independent directions in the data—one for the intercept and one for the slope—leaving \(n-2\) residual directions to estimate the error variance.
To see how these facts produce the t statistic, let \(Y_0\) be the new outcome at \(x_0\), and let \(Z\) be the prediction error divided by its true standard deviation. Under the model, \(Z\sim N(0,1)\). Its true standard deviation is \(\sigma\sqrt{h_0}\), with \(h_0\) as defined above. The scaled residual sum of squares, \(U=\mathrm{SSE}/\sigma^2\), is independent of \(Z\) and has a chi-square distribution with \(n-2\) degrees of freedom. Substituting \(s^2=\sigma^2U/(n-2)\) into the prediction standard error gives the following standardized error:
This is the defining construction of a t random variable: a standard normal variable divided by the square root of an independent chi-square variable divided by its degrees of freedom. The denominator adds uncertainty because the residual standard deviation was estimated. The degrees of freedom are \(n-2\) because that is the degrees of freedom of the residual sum of squares—not because the new case adds an observation to the regression fit.
Selecting the Quantile for the Requested Level
The prediction level and the number of tails determine the quantile. For a central two-sided prediction interval with level \(C\), the total probability placed outside the interval is \(\alpha=1-C\). Half of that probability is in each tail, so the upper quantile is \(t_{1-\alpha/2,n-2}\). For a one-sided 95% upper prediction bound, all of the excluded 5% is in the upper tail, so the quantile is \(t_{0.95,n-2}\). A one-sided lower bound uses the corresponding lower-tail quantile, \(t_{0.05,n-2}\), which is the negative of \(t_{0.95,n-2}\) by symmetry.
Always identify both the requested level and whether the result is one-sided or two-sided before looking up a critical value. The same degrees of freedom can give different critical values for different quantiles. The table below gives the quantile choice; the actual numerical value still depends on \(n\).
| Requested result | Tail allocation | Critical value |
|---|---|---|
| 95% two-sided prediction interval | 2.5% in each tail | \(t_{0.975,n-2}\) |
| 90% two-sided prediction interval | 5% in each tail | \(t_{0.95,n-2}\) |
| 95% one-sided upper prediction bound | 5% in the upper tail | \(t_{0.95,n-2}\) |
| 95% one-sided lower prediction bound | 5% in the lower tail | \(t_{0.05,n-2}\) |
Worked Example: A 95% Two-Sided Prediction Interval
Suppose a hypothetical simple regression has \(n=8\), \(\bar{x}=4\), \(S_{xx}=28\), \(\mathrm{SSE}=18\), and fitted equation \(\hat{y}=10+2x\). A new case has \(x_0=5\). Assume the model conditions described above are reasonable for these hypothetical data. Find the 95% prediction margin and interval.
There are two fitted coefficients, so \(df=n-2=8-2=6\). The residual standard deviation is \(s=\sqrt{18/6}=\sqrt{3}=1.732\) outcome units. The fitted value is \(\hat{y}_0=10+2(5)=20\) outcome units.
The prediction standard error is \(\displaystyle s\sqrt{1+\frac{1}{n}+\frac{(x_0-\bar{x})^2}{S_{xx}}}\). Substituting the summaries gives \(\displaystyle 1.732\sqrt{1+\frac{1}{8}+\frac{(5-4)^2}{28}} =1.732\sqrt{1.160714}=1.866\) outcome units.
For a 95% two-sided interval, \(\alpha=0.05\), and the required critical value is \(t_{1-\alpha/2,6}=t_{0.975,6}=2.447\). Thus the margin is \(2.447(1.866)=4.566\) outcome units, and the interval is \(20\pm4.566\), or approximately \((15.43,\ 24.57)\) outcome units. Under the model, this procedure is designed to cover the new outcome at the stated prediction level over repeated applications.
Worked Example: A 95% One-Sided Upper Bound
Consider a hypothetical regression with \(n=15\), \(\bar{x}=10\), \(S_{xx}=140\), \(\mathrm{SSE}=52\), and fitted value \(\hat{y}_0=40.0\) at \(x_0=12\). Assume the model conditions are reasonable. Calculate a 95% one-sided upper prediction bound.
The residual degrees of freedom are \(15-2=13\), and \(s=\sqrt{52/13}=2.000\) outcome units. The prediction standard error is \(\displaystyle 2.000\sqrt{1+\frac{1}{15}+\frac{(12-10)^2}{140}} =2.000\sqrt{1.095238}=2.093\) outcome units.
Because the requested result is a one-sided upper bound, the critical value is \(t_{0.95,13}=1.771\), not the two-sided 95% critical value. The margin is \(1.771(2.093)=3.707\) outcome units. The upper bound is therefore \(40.0+3.707=43.71\) outcome units. This is not a two-sided interval: it supplies an upper endpoint, with the chosen one-sided calibration.
Worked Example: Why Small Samples Need the Correct t Quantile
Suppose a hypothetical regression has \(n=5\), \(\bar{x}=2\), \(S_{xx}=4\), \(x_0=3\), and \(\mathrm{SSE}=4.32\). Assume the model conditions are reasonable. Find the margin for a 90% two-sided prediction interval.
The residual degrees of freedom are \(5-2=3\), and the residual standard deviation is \(s=\sqrt{4.32/3}=\sqrt{1.44}=1.200\) outcome units. The prediction standard error is \(\displaystyle 1.200\sqrt{1+\frac{1}{5}+\frac{(3-2)^2}{4}} =1.200\sqrt{1.45}=1.445\) outcome units.
For a 90% two-sided interval, \(\alpha=0.10\), so the critical value is \(t_{0.95,3}=2.353\). The margin is \(2.353(1.445)=3.401\) outcome units. Using a standard-normal critical value of 1.645 instead would give a margin of only \(1.645(1.445)=2.376\) outcome units. That smaller value ignores the extra uncertainty from estimating residual variance, especially consequential here with only 3 residual degrees of freedom.
Common Mistakes and Why the Choice Matters
A frequent error is to use \(n-1\) degrees of freedom because a sample standard deviation often uses \(n-1\). That is not the residual variance calculation in simple regression. The fitted intercept and slope use two degrees of freedom, so the residual variance estimate divides \(\mathrm{SSE}\) by \(n-2\). Another error is to select a quantile by the stated percentage alone. A 95% two-sided interval needs the 0.975 quantile; a 95% one-sided upper bound needs the 0.95 quantile.
A third mistake is to use a standard-normal critical value simply because the prediction error would be normal if \(\sigma\) were known. The standard deviation is estimated in the usual procedure. The t distribution accounts for that estimation, and its heavier tails generally produce a larger critical value than the normal distribution at the same central level, particularly with few residual degrees of freedom.
The calibration is only as appropriate as its assumptions. The examples explicitly treated the model conditions as reasonable; the numerical summaries alone cannot establish independence, constant error variance, or normality. The t critical value does not correct a wrongly specified mean relationship or other failures of the model. Its role is narrower: it accounts for the sampling variability introduced by estimating \(\sigma\) from regression residuals.
For simple regression with an intercept and slope, calculate \(df=n-2\).
Decide whether the request is a two-sided interval or a one-sided bound.
For a two-sided level \(C\), use \(t_{(1+C)/2,df}\); for a one-sided upper bound at level \(C\), use \(t_{C,df}\).
Multiply the selected critical value by \(s\sqrt{h_0}\), then use the margin in the requested interval or bound.
Check Your Understanding
For each question, state the relevant degrees of freedom or quantile, and explain your choice.
- A simple regression uses 22 observations and estimates an intercept and a slope. What residual degrees of freedom should be used for the t critical value?
- For a 90% two-sided prediction interval with \(n=12\), which t quantile is required?
- For a 95% one-sided lower prediction bound with \(n=18\), which t quantile is required?
- Explain why \(n-1\) is not the residual degrees of freedom for the simple-regression prediction interval.
- What uncertainty does the t critical value account for that a standard-normal critical value would not account for when \(\sigma\) is unknown?