Tutorials › Regression Analysis (Undergraduate) › A Worked Prediction Interval for a New Case

Prediction Intervals for New Outcomes · Tutorial 722 of 991

A Worked Prediction Interval for a New Case

Learn to calculate and interpret a 95% prediction interval for one new outcome in simple linear regression.

Intermediate 9 min read

What You'll Learn

  • Identify the outcome and predictor values targeted by a prediction interval.
  • Calculate a fitted value for a new case from a simple-regression equation.
  • Apply the prediction standard error formula, including its future-outcome variation term.
  • Select the t critical value using the residual degrees of freedom.
  • Calculate and interpret interval endpoints in the outcome’s units.
  • Recognize common calculation and interpretation errors.

Why Predicting One New Outcome Requires an Interval

A fitted regression line gives a point prediction for an outcome at a specified predictor value. But a new individual outcome can differ from that fitted value for two reasons: the estimated line is uncertain, and the individual outcome varies around the line. A prediction interval accounts for both sources of uncertainty and gives a range for one new outcome.

This tutorial works through the calculation for simple linear regression. The focus is the interval for a single new case at predictor value \(x_0\), not a range for the average outcome among cases with that predictor value.

Definition: A 95% prediction interval for a new outcome \(Y_{\text{new}}\) at predictor value \(x_0\) is an interval calculated from the sample to predict that individual outcome. Under the regression model and its assumptions, the interval-producing method has 95% coverage in repeated applications to comparable new cases.

The Model and the Calculation

For observed cases \(i=1,\ldots,n\), assume the simple linear regression model

$$ Y_i=\beta_0+\beta_1x_i+\varepsilon_i. $$

Here, \(\beta_0\) and \(\beta_1\) are the population intercept and slope. For the usual t-based prediction interval, the errors are independent, have mean zero and common variance \(\sigma^2\), and are normally distributed. The predictor values are treated as fixed. The mean outcome is linear in \(x_i\); a new case at \(x_0\) follows the same model, with an error independent of the errors in the observed cases. These assumptions are about the model and data-generating process, not guarantees supplied by the formula.

Let \(\bar{x}\) be the sample mean of the predictor values, \(S_{xx}=\sum_{i=1}^n(x_i-\bar{x})^2\), and \(s\) the residual standard deviation. The fitted value at \(x_0\) is \(\hat{y}_0=\hat{\beta}_0+\hat{\beta}_1x_0\). With \(df=n-2\), the 95% prediction interval is

$$ \hat{y}_0 \ \pm\ t_{0.975,\,n-2}\;s\sqrt{1+\frac{1}{n}+\frac{(x_0-\bar{x})^2}{S_{xx}}}. $$

The quantity multiplying the t critical value is the prediction standard error. The leading \(1\) inside the square root accounts for the variation of a new individual outcome around its population mean. The other terms account for uncertainty in estimating that mean at \(x_0\). The t critical value \(t_{0.975,\,n-2}\) leaves 2.5% in each tail of a t distribution with \(n-2\) degrees of freedom.

Why the Prediction Standard Error Has These Terms

A short variance argument explains why the formula differs from the uncertainty in the fitted mean. Write the new outcome as \(Y_{\text{new}}=\beta_0+\beta_1x_0+\varepsilon_{\text{new}}\). Its prediction error is the difference between this outcome and the fitted value. That error consists of the new case’s error plus the error in estimating the mean at \(x_0\):

$$ Y_{\text{new}}-\hat{y}_0 = \varepsilon_{\text{new}}+ \left(\beta_0+\beta_1x_0-\hat{y}_0\right). $$

Under the model, the new error is independent of the estimation error. The two variances therefore add. The first is \(\sigma^2\); the second, for simple regression with fixed predictor values, is \(\sigma^2\left[1/n+(x_0-\bar{x})^2/S_{xx}\right]\). Thus,

$$ \operatorname{Var}(Y_{\text{new}}-\hat{y}_0) = \sigma^2\left[1+\frac{1}{n}+\frac{(x_0-\bar{x})^2}{S_{xx}}\right]. $$

Replacing \(\sigma\) with its estimate \(s\) gives the prediction standard error in the interval formula. The future-outcome term is essential: the target is one new outcome, not just its estimated mean.

Worked Example: Predicting a New Patient’s Measurement

Hypothetical example. A simple regression relates a measurement in points to a predictor measured in hours. There are \(n=9\) observed cases with predictor values 6 through 14, so \(\bar{x}=10\) and \(S_{xx}=60\). The fitted equation is \(\hat{y}=18+2x\), and the residual standard deviation is \(s=2\) points. Find a 95% prediction interval for one new case with \(x_0=12\) hours.

Assume the cases were independently observed, the relationship is adequately linear, and hypothetical residual checks show roughly constant spread and no severe departure from normality. The new case is assumed to come from the same process, and 12 hours lies within the observed predictor range. These conditions make the stated t-based calculation appropriate for this example.

Fitted value. Substitute the new predictor value into the fitted equation:

$$ \hat{y}_0=18+2(12)=42\text{ points}. $$

Prediction standard error. Here \(n-2=7\), and \(x_0-\bar{x}=12-10=2\) hours:

$$ SE_{\text{pred}} = 2\sqrt{1+\frac{1}{9}+\frac{(12-10)^2}{60}} = 2\sqrt{1.17778} \approx 2.17051\text{ points}. $$

For 7 degrees of freedom, \(t_{0.975,7}\approx2.3646\). Using the unrounded standard error, the margin of error is \(2.3646(2.17051)\approx5.132\) points. Therefore,

$$ 42\pm5.132 \quad\Longrightarrow\quad (36.87,\ 47.13)\text{ points}. $$

Under the model assumptions, this method gives a 95% prediction interval of approximately 36.87 to 47.13 points for the measurement of one new case with a 12-hour predictor value. The interval is centered at the fitted value, but it extends on either side to allow for uncertainty and individual variation.

Two More Worked Calculations

Worked Example: Predicting at the Mean Predictor Value

Hypothetical example. A simple regression predicts a score in points from a study-time variable measured in hours. Eight independent cases have predictor values \(1,2,3,4,4,5,6,7\), giving \(\bar{x}=4\) and \(S_{xx}=28\). Suppose the fitted equation is \(\hat{y}=50+4.5x\), with residual standard deviation \(s=3\) points. Find a 95% prediction interval for one new case at \(x_0=4\) hours.

Assume a linear mean relationship and that hypothetical residual checks support independent errors, approximately constant variance, and an adequate normal approximation. The new case is assumed to follow the same process. The target predictor value is in the observed range.

The fitted value is \(\hat{y}_0=50+4.5(4)=68\) points. Because \(x_0=\bar{x}\), the location term is zero. With \(df=8-2=6\),

$$ SE_{\text{pred}} = 3\sqrt{1+\frac{1}{8}+\frac{(4-4)^2}{28}} = 3\sqrt{1.125} \approx3.18198\text{ points}. $$

The 95% critical value is \(t_{0.975,6}\approx2.447\). The margin of error is \(2.447(3.18198)\approx7.786\) points, giving

$$ 68\pm7.786 \quad\Longrightarrow\quad (60.21,\ 75.79)\text{ points}. $$

The resulting 95% prediction interval for one new case with 4 hours of study time is approximately 60.21 to 75.79 points. Being at the sample mean predictor value makes the mean-estimation location term zero, but it does not remove the individual-outcome variation represented by the leading \(1\).

Worked Example: Predicting Away From the Mean Predictor Value

Hypothetical example. A simple regression predicts a response in centimeters from a predictor measured in units. Twelve independent cases have predictor values \(15,16,17,18,19,20,20,21,22,23,24,25\), so \(\bar{x}=20\) and \(S_{xx}=110\). The fitted equation is \(\hat{y}=11.5+0.8x\), and \(s=1.5\) centimeters. Find a 95% prediction interval for a new case at \(x_0=25\).

Assume the linear model is suitable and, for this hypothetical data set, residual checks show no substantial pattern or change in spread and are reasonably consistent with normal errors. Independence and the same-process condition are also assumed. Since 25 is among the observed predictor values, this calculation is within the predictor range represented by the data.

The fitted value is \(\hat{y}_0=11.5+0.8(25)=31.5\) centimeters. The predictor is 5 units above its sample mean, and \(df=12-2=10\):

$$ SE_{\text{pred}} = 1.5\sqrt{1+\frac{1}{12}+\frac{(25-20)^2}{110}} = 1.5\sqrt{1.31061} \approx1.71723\text{ centimeters}. $$

Using \(t_{0.975,10}\approx2.228\), the margin of error is \(2.228(1.71723)\approx3.826\) centimeters. Thus,

$$ 31.5\pm3.826 \quad\Longrightarrow\quad (27.67,\ 35.33)\text{ centimeters}. $$

Under the model assumptions, the 95% prediction interval for one new response at a predictor value of 25 is approximately 27.67 to 35.33 centimeters. The location term increases the prediction standard error relative to what it would be at \(\bar{x}\), while the outcome and fitted-value calculations remain in the same units.

Calculation Checks and a Common Pitfall

A reliable calculation keeps the fitted value, standard error, critical value, margin of error, and endpoints visible as separate steps. Check that the standard error and margin of error have the outcome’s units, while the t critical value is unitless. The margin of error must be nonnegative, and the two endpoints must lie the same distance from the fitted value before rounding.

  • Wrong reasoning: “The standard error of the fitted mean is enough, so I can omit the leading 1.” This leaves out the variation of the new individual outcome around its mean.
  • Correction: For a new outcome, use \(s\sqrt{1+1/n+(x_0-\bar{x})^2/S_{xx}}\). The leading 1 represents the future error, so it must be included.
  • Wrong reasoning: “A 95% prediction interval means there is a 95% probability that the fixed outcome is inside the particular calculated interval.”
  • Correction: The outcome is not a fixed parameter, but its value is unknown until observed. The 95% statement describes the long-run coverage of the interval-producing method under the model assumptions, not a probability assigned to the already calculated interval containing that outcome.
  • Arithmetic check: Multiply the displayed critical value and standard error consistently. If rounded values produce a slightly different margin of error from a calculation using unrounded values, say which values were used and round the final endpoints appropriately.

Prediction intervals are useful whenever a decision concerns an individual future measurement, such as planning for a particular patient’s response or anticipating one manufactured part’s dimension. They are only as credible as the model conditions and the relevance of the new case to the data. The interval is in the response variable’s units, so its width also helps convey the scale of individual-outcome uncertainty.

Check Your Understanding

For each question, identify the calculation or interpretation needed; retain units where the situation provides them.

  1. In the prediction standard error formula, what does the leading \(1\) represent?
  2. A simple regression has \(n=14\) observations. How many residual degrees of freedom are used for the t critical value?
  3. At \(x_0=\bar{x}\), which term in the prediction standard error becomes zero, and which source of variation remains?
  4. Why is it incorrect to report a prediction interval for a new outcome using only the uncertainty in the fitted mean?
  5. Suppose a prediction interval has endpoints 18 and 30 points. What is its fitted-value center, before considering rounding?
  6. Explain what 95% coverage means for the prediction-interval method, without assigning a 95% probability to a fixed unknown parameter.