Why Predicting One New Outcome Needs Its Own Interval
A fitted regression line gives a point prediction at a chosen predictor value. But a future response will generally differ from that fitted value: the line estimates the conditional mean, while an individual outcome also contains its own random error. A prediction interval accounts for both sources of uncertainty. This tutorial develops the two-sided t prediction-interval formula for simple linear regression and shows how to use its components.
The interval is for one future response at a specified predictor value \(x_0\). It is not an interval for the mean response at \(x_0\). The extra variation associated with the new outcome is reflected in the formula’s leading \(1\) under the square root.
Model, Conditions, and Notation
Suppose the observed responses \(Y_1,\ldots,Y_n\) are related to predictor values \(x_1,\ldots,x_n\) by the simple linear regression model
For the usual t-based prediction interval, assume the mean response is linear in \(x_i\), the errors are independent with mean \(0\) and common variance \(\sigma^2\), and the errors are normally distributed. For predicting a new response, also assume the future error is independent of the errors used to fit the line and has the same variance. These conditions make the formula appropriate for predicting a new outcome from the same process at \(x_0\).
Let \(\hat{y}_0=\hat{\beta}_0+\hat{\beta}_1x_0\) be the fitted value at \(x_0\), and define
Here \(s\) is the residual standard error, an estimate of the standard deviation \(\sigma\) of the regression errors. The quantity
is the predictor-dependent leverage term for estimating the mean at \(x_0\). Its value depends on where \(x_0\) lies relative to the observed predictor values and their spread.
The Simple-Regression Prediction-Interval Formula
With \(n-2\) degrees of freedom, let \(t_{1-\alpha/2,n-2}\) denote the positive t critical value with upper-tail probability \(\alpha/2\). The two-sided prediction interval is
Equivalently, the lower and upper endpoints are
The \(1\) inside the square root accounts for the error in the new outcome. The remaining terms, \(1/n+(x_0-\bar{x})^2/S_{xx}\), account for uncertainty in the fitted mean at that predictor value. The residual standard error \(s\) scales both contributions into the response’s units.
Why the Prediction Standard Error Has This Form
Write the future response as \(Y_{\mathrm{new}}=\beta_0+\beta_1x_0+\varepsilon_{\mathrm{new}}\). Its prediction error is the difference between that response and the fitted value:
The first term is the new outcome’s random error. The second is the error from estimating the conditional mean with the fitted line. Under the model conditions, the new error is independent of the estimation errors. The variance of the new error is \(\sigma^2\), and the variance of the fitted-mean estimation error at \(x_0\) is \(\sigma^2h_0\). Therefore the prediction-error variance is the sum:
Replacing the unknown \(\sigma\) by the residual standard error \(s\) gives the estimated prediction standard error \(s\sqrt{1+h_0}\). The t multiplier calibrates this estimated standard error for the interval. In simple linear regression, fitting the intercept and slope leaves \(n-2\) residual degrees of freedom. The details of t-based calibration are a separate topic; here, the critical value is used as part of the formula.
Worked Example: Predicting at the Sample Mean
Consider a hypothetical regression of a laboratory measurement, in points, on a quantitative predictor. The fitted value at \(x_0=\bar{x}\) is \(20\) points, the residual standard error is \(s=4\) points, and the fit used \(n=10\) observations. Construct a 95% prediction interval for one new measurement at \(x_0=\bar{x}\). Use \(t_{0.975,8}\approx2.306\).
Because \(x_0=\bar{x}\), the squared-distance term is zero. The leverage term is
The estimated prediction standard error is
The margin of error, calculated before rounding the standard error, is
Thus the interval is \(20\pm9.674\), or approximately \((10.33,\ 29.67)\) points. Under the model conditions, this procedure gives a 95% prediction interval for one new measurement at the sample mean predictor value. The interval concerns a future individual measurement, not the mean measurement at that predictor value.
Working Through the Predictor-Dependent Term
Away from \(\bar{x}\), the squared-distance term increases \(h_0\). It is important to use the predictor values in the same units as the fitted regression and to square the difference \(x_0-\bar{x}\). The next example makes those steps explicit.
Worked Example: Predicting Away From the Predictor Mean
A hypothetical regression predicts a response in minutes from a predictor measured in units. Suppose \(n=12\), \(\bar{x}=50\), \(S_{xx}=1100\), and \(s=3\) minutes. At \(x_0=60\), the fitted value is \(\hat{y}_0=72.5\) minutes. Construct a 95% prediction interval using \(t_{0.975,10}\approx2.228\).
First calculate the leverage term:
Then calculate the estimated prediction standard error:
Using the unrounded intermediate values, the margin of error is approximately \(2.228(3.2509)=7.243\) minutes. The interval is
The interval predicts one future response, in minutes, for a case with predictor value \(60\). The predictor’s distance from its sample mean contributes to the width through \(h_0\).
A Second Calculation and a Reporting Pitfall
The formula has several components, so it helps to keep the sequence consistent: find \(h_0\), add \(1\), multiply its square root by \(s\), and then multiply by the t critical value. The response units belong on the prediction standard error, margin of error, and interval endpoints.
Worked Example: Keeping the Components and Units Straight
Suppose a hypothetical regression predicts a crop measurement in centimeters. Its summary values are \(n=16\), \(\bar{x}=4\), \(S_{xx}=60\), and \(s=2.5\) cm. At \(x_0=7\), the fitted value is \(18\) cm. For a 95% prediction interval, use \(t_{0.975,14}\approx2.145\).
The leverage term is
The prediction standard error is
The margin of error is approximately \(2.145(2.7528)=5.905\) cm. Therefore,
The calculation retains the \(1\) for the new outcome, and the reported limits are in centimeters because the fitted response and residual standard error are in centimeters.
Common Mistakes and a Reliable Procedure
A frequent error is to use only \(s\sqrt{h_0}\) as the prediction standard error. That expression leaves out the new outcome’s own variation. For an individual future response, use \(s\sqrt{1+h_0}\). Another mistake is to treat the fitted value as the entire prediction: \(\hat{y}_0\) is the interval’s center, not a guarantee of the future response.
A useful calculation sequence is:
Specify the predictor value \(x_0\) and confirm that the goal is an interval for one new response.
Calculate \(\hat{y}_0\) and \(h_0=1/n+(x_0-\bar{x})^2/S_{xx}\).
Use \(s\sqrt{1+h_0}\), including the leading \(1\).
Multiply the prediction standard error by \(t_{1-\alpha/2,n-2}\), then add and subtract the margin from \(\hat{y}_0\).
Give the interval’s response units and state that it predicts one new response at \(x_0\).
Do not describe a 95% interval as having a 95% probability of containing a particular fixed future value after the interval has been calculated. The confidence level describes the long-run performance of the interval procedure under its assumptions. For a specific prediction, report the calculated range and the case to which it applies.
Check Your Understanding
Use the formula and explanations above to answer these questions.
- In the simple-regression prediction standard error, what does the leading \(1\) under the square root account for?
- For a fixed fitted regression, how does \(h_0\) simplify when \(x_0=\bar{x}\)?
- A student uses \(s\sqrt{h_0}\) rather than \(s\sqrt{1+h_0}\) for a new response. What component has been omitted?
- For a two-sided 95% prediction interval based on \(n=14\) observations, what degrees of freedom index the t critical value?
- In context, what is the difference between the future quantity covered by a prediction interval and the fitted value at \(x_0\)?