Tutorials › Exam SRM - Statistics for Risk Modeling › Distinguishing Mean and Prediction Intervals

Exam SRM · Regression and Selection Cases · Tutorial 841 of 926

Distinguishing Mean and Prediction Intervals

Use regression leverage and residual variance to calculate and interpret intervals for a conditional mean and for an individual future response.

Advanced 10 min read

What You'll Learn

  • Distinguish uncertainty about a conditional mean from uncertainty about a new response.
  • Calculate the leverage of a predictor location in simple and multiple regression.
  • Construct mean and prediction intervals using the appropriate standard errors and degrees of freedom.
  • Explain why prediction intervals are wider and why both interval widths depend on predictor location.
  • Determine how a change in residual standard error scales interval widths.
  • Identify common traps involving the extra prediction-error term and interval endpoints.

Two Different Questions, Two Different Intervals

A fitted regression model can be used to answer two related but distinct questions. First: what is the average response among observations with predictor values \(x_0\)? Second: what response might occur for one new observation at those same predictor values? The first concerns a conditional mean; the second concerns an individual response. Because individual responses vary around their mean, the second question requires a wider interval.

This distinction matters in applications such as estimating an average claim amount for a group of policies versus predicting the claim amount for one new policy. Both quantities are uncertain, but for different reasons. Estimating the mean is uncertain because the regression line is estimated from a finite sample. Predicting a new response has that same uncertainty, plus the new response’s own deviation from the mean.

The formulas below assume a correctly specified linear regression model with independent errors of mean zero and constant variance \(\sigma^2\). For exact \(t\)-intervals, also assume normally distributed errors. The predictor values are treated as fixed, and the model is treated as specified rather than selected using the same data. If the variance changes with predictors, observations are dependent, or the response model is misspecified, these standard intervals need not have their stated coverage.

Definition: At predictor vector \(x_0\), the conditional mean is \(E[Y\mid x_0]\). A confidence interval for this mean quantifies uncertainty in estimating \(E[Y\mid x_0]\). A prediction interval concerns one new response \(Y_{\text{new}}\) at \(x_0\), and includes both uncertainty in the estimated mean and the new response’s residual variation.

Leverage and the Two Standard Errors

Write the multiple linear regression model as \(Y=X\beta+\varepsilon\), where \(X\) has \(p\) columns, including the intercept, and \(n\) rows. Let \(x_0\) be the predictor vector for the location of interest, including its intercept entry. The fitted conditional mean is \(\hat{Y}_0=x_0^\mathsf{T}\hat{\beta}\). Define the leverage at that location by

$$ h_0=x_0^\mathsf{T}(X^\mathsf{T}X)^{-1}x_0. $$

Let \(s=\sqrt{\mathrm{SSE}/(n-p)}\) be the residual standard error, with \(n-p\) residual degrees of freedom. For a two-sided interval with critical value \(t^*=t_{1-\alpha/2,n-p}\), the standard errors and intervals are:

$$ \begin{aligned} \operatorname{SE}(\hat{Y}_0)&=s\sqrt{h_0},\\ \text{confidence interval for }E[Y\mid x_0] &:\quad \hat{Y}_0\ \pm\ t^*s\sqrt{h_0},\\[3pt] \operatorname{SE}(Y_{\text{new}}-\hat{Y}_0)&=s\sqrt{1+h_0},\\ \text{prediction interval for }Y_{\text{new}} &:\quad \hat{Y}_0\ \pm\ t^*s\sqrt{1+h_0}. \end{aligned} $$

For simple linear regression with an intercept and one predictor, \(p=2\), and the leverage has the convenient form

$$ h_0=\frac{1}{n}+\frac{(x_0-\bar{x})^2}{S_{xx}}, \qquad S_{xx}=\sum_{i=1}^n(x_i-\bar{x})^2. $$

The term \(1/n\) reflects uncertainty in estimating the intercept or overall level. The second term reflects the extra uncertainty from estimating the slope when \(x_0\) is away from the sample mean. In multiple regression, the vector formula for \(h_0\) accounts for the location of all predictors together.

Why the Prediction Interval Has an Extra Term

The estimated mean has sampling variance \(\sigma^2h_0\). A new response can be written as its true conditional mean plus a new error: \(Y_{\text{new}}=x_0^\mathsf{T}\beta+\varepsilon_{\text{new}}\). Its prediction error is therefore

$$ Y_{\text{new}}-\hat{Y}_0 = \varepsilon_{\text{new}}-x_0^\mathsf{T}(\hat{\beta}-\beta). $$

The new error has variance \(\sigma^2\). It is independent of the errors used to estimate \(\hat{\beta}\), so the covariance between the two terms is zero. The variance of the prediction error is consequently the sum of the two variances:

$$ \operatorname{Var}(Y_{\text{new}}-\hat{Y}_0) = \sigma^2+\sigma^2h_0 = \sigma^2(1+h_0). $$

Replacing \(\sigma\) with \(s\) gives the prediction standard error. For the mean, there is no new response error to add, so its standard error uses \(s\sqrt{h_0}\) alone. Since \(h_0\geq 0\), \(1+h_0>h_0\), and thus the prediction interval is wider whenever the same positive critical value and residual standard error are used.

Worked Example: Calculating Both Intervals in Simple Regression

A hypothetical regression has \(n=10\), \(\bar{x}=5\), \(S_{xx}=40\), and residual standard error \(s=1.5\). At \(x_0=7\), the fitted response is \(\hat{Y}_0=18\). Use the supplied critical value \(t^*=2.262\) to calculate both intervals. The critical value is given for this calculation; do not substitute a different one.

Method. Calculate the simple-regression leverage, then use \(h_0\) for the mean standard error and \(1+h_0\) for the prediction standard error.

First calculate leverage:

$$ h_0=\frac{1}{10}+\frac{(7-5)^2}{40} =0.1+\frac{4}{40} =0.2000. $$

The mean standard error is \(1.5\sqrt{0.2}=0.6708204\), so its margin is \(2.262(0.6708204)=1.5174\), rounded to four decimal places. The confidence interval for the conditional mean is therefore

$$ 18\pm1.5174=[16.4826,\ 19.5174]. $$

For an individual new response, the standard error is \(1.5\sqrt{1.2}=1.6431677\). The margin is \(2.262(1.6431677)=3.7168453\). Rounding the endpoints to four decimal places gives the prediction interval

$$ 18\pm3.7168453=[14.2832,\ 21.7168]. $$

Check. Both intervals are centered at 18, and the prediction interval is wider. The method avoids the common mistake of using \(s\sqrt{h_0}\) for both intervals, which would omit the new response’s residual variation.

Predictor Location Changes Both Widths

In simple regression, leverage is smallest at \(x_0=\bar{x}\) and increases as \(x_0\) moves away from \(\bar{x}\). Consequently, both intervals widen away from the predictor center. This does not mean the mean and prediction intervals widen by the same amount: their standard errors involve \(\sqrt{h_0}\) and \(\sqrt{1+h_0}\), respectively.

Worked Example: Comparing a Central and an Away-from-Center Location

A hypothetical simple regression has \(n=9\), \(\bar{x}=10\), \(S_{xx}=40\), and \(s=2\). Its fitted values are 60 at \(x_0=10\) and 68 at \(x_0=14\). Use \(t^*=2.365\) at both locations. Calculate the interval widths and the intervals themselves.

Method. Find the leverage at each location. A two-sided interval has width twice its margin of error.

At the center, \(x_0=10\):

$$ h_{10}=\frac{1}{9}+\frac{(10-10)^2}{40} =\frac{1}{9}. $$

The mean margin is \(2.365(2)\sqrt{1/9}=9.46/3=3.1533\), so the mean interval is \([56.8467,63.1533]\), with width \(6.3067\). The prediction margin is \(9.46\sqrt{10/9}=9.9717\), giving \([50.0283,69.9717]\), with width \(19.9434\).

At \(x_0=14\):

$$ h_{14}=\frac{1}{9}+\frac{(14-10)^2}{40} =\frac{1}{9}+\frac{16}{40} =\frac{23}{45}. $$

The mean margin is \(9.46\sqrt{23/45}=6.7631\). Its interval is \([61.2369,74.7631]\), with width \(13.5263\). The prediction margin is \(9.46\sqrt{1+23/45}=9.46\sqrt{68/45}=11.6289\). Its interval is \([56.3711,79.6289]\), with width \(23.2578\). Endpoints and widths are rounded to four decimal places.

Check. Both widths increase at \(x_0=14\), where leverage is larger. At each location the prediction interval remains wider than the mean interval. The calculation avoids treating the fitted value’s location as if it had no effect on uncertainty.

Residual Variance Scales Interval Widths

For fixed predictors, \(h_0\), degrees of freedom, and critical value, each interval margin is proportional to \(s\). If \(s\) is multiplied by a factor \(c\), both widths are multiplied by \(c\). This is a statement holding the design and critical value fixed; in a refitted model, the estimated leverage or degrees of freedom might also change.

Worked Example: Effect of a Smaller Residual Standard Error

A hypothetical fitted model gives \(\hat{Y}_0=80\), \(h_0=0.25\), and \(t^*=2.000\). First use \(s=6\) to calculate both intervals. Then suppose a revised residual standard error is \(s=4.5\), with the fitted value, leverage, and critical value held fixed. Find the new widths.

Method. Calculate the standard errors and margins at \(s=6\), then use proportional scaling for the new value of \(s\).

At \(s=6\), the mean standard error is \(6\sqrt{0.25}=3\), so the margin is \(2(3)=6\). The mean interval is \([74,86]\), with width \(12\). The prediction standard error is \(6\sqrt{1.25}=6.7082\), so its margin is \(13.4164\). The prediction interval is \([66.5836,93.4164]\), with width \(26.8328\). Values are rounded to four decimal places where needed.

The residual standard error changes by the factor \(4.5/6=0.75\). Thus each width is multiplied by 0.75. The new mean width is \(0.75(12)=9\), and the new prediction width is \(0.75(26.8328)=20.1246\). As a direct check, the new mean margin is \(2(4.5)\sqrt{0.25}=4.5\), giving width 9; the new prediction margin is \(9\sqrt{1.25}=10.0623\), giving width \(20.1246\).

Check. Both widths fall by 25%, while the prediction interval remains wider. The method avoids scaling interval endpoints around zero: it is the width or margin around the fitted value that scales with \(s\).

Interpretation and Common Exam Traps

A confidence interval for the conditional mean is not an interval containing a specified proportion of individual responses. A prediction interval is the appropriate standard interval for one new response, under the stated model assumptions. Neither interval is a guarantee about a particular future observation. Their coverage interpretation is repeated-sampling: under the model, the interval procedure covers the target mean or new response at its stated rate over repeated samples.

A frequent error is to use the mean standard error when asked for a new observation. For example, with \(h_0=0.2\), the incorrect prediction standard error \(s\sqrt{0.2}\) is smaller than the correct one \(s\sqrt{1.2}\). The correction is to include the extra \(1\) inside the prediction standard error’s square root. Another trap is to say that intervals always have the same width at every predictor value. In simple regression, the squared distance from \(\bar{x}\) changes leverage; in multiple regression, the vector location changes \(h_0\).

Finally, the standard formulas quantify uncertainty conditional on the regression model and its predictor values. They do not automatically account for model-selection uncertainty, omitted predictors, or violations of constant variance and independence. A numerically correct interval can still be misleading if these assumptions are substantially inappropriate.

Key takeaway: Use \(s\sqrt{h_0}\) for uncertainty in the fitted conditional mean and \(s\sqrt{1+h_0}\) for prediction of one new response. Larger leverage widens both intervals, while larger residual standard error scales both widths upward.

Check Your Understanding

For each problem, distinguish the target before choosing the standard error. Answers use the supplied critical values.

  1. A simple regression has \(n=16\), \(\bar{x}=4\), and \(S_{xx}=60\). At \(x_0=7\), calculate \(h_0\) and state the variance multipliers for the fitted mean and a new response. (Answer: \(h_0=0.2125\); multipliers \(0.2125\) and \(1.2125\).)
  2. A multiple regression gives \(\hat{Y}_0=40\), \(s=5\), \(h_0=0.12\), and \(t^*=2.06\). Calculate the mean and prediction intervals, rounding endpoints to four decimals. (Answer: mean \([36.4320,43.5680]\); prediction \([29.0995,50.9005]\).)
  3. For a fixed design and critical value, a model’s residual standard error increases from 2 to 3. By what factor do the mean and prediction interval widths change? (Answer: Both widths are multiplied by \(3/2=1.5\).)
  4. In a simple regression with an intercept, compare leverage at \(x_0=\bar{x}\) and \(x_0=\bar{x}+\sqrt{S_{xx}}\). State which location has wider intervals, and give the two leverages in terms of \(n\). (Answer: The leverages are \(1/n\) and \(1/n+1\); both intervals are wider at the second location.)
Clinical Biostats