Tutorials › Regression Analysis (Undergraduate) › Leverage and the Width of a Prediction Interval

Prediction Intervals for New Outcomes · Tutorial 725 of 991

Leverage and the Width of a Prediction Interval

Learn to calculate prediction leverage, separate the two sources of prediction uncertainty, and interpret their effect on interval width.

Intermediate 9 min read

What You'll Learn

  • Define prediction leverage for a specified multiple-regression predictor profile.
  • Distinguish uncertainty in the fitted mean from future residual variation.
  • Derive the prediction-error variance as the sum of those two components.
  • Calculate a prediction interval using leverage, residual standard error, and a t critical value.
  • Explain why higher leverage widens a prediction interval, all else equal.

Why Leverage Matters for a New Outcome

A multiple-regression prediction interval for a new outcome accounts for two kinds of uncertainty. The fitted regression mean at the specified predictor values is estimated from a sample, so that mean is uncertain. In addition, a future individual outcome varies around its mean because of residual variation. Prediction leverage measures the first contribution for a particular predictor profile: it tells us how uncertain the fitted mean is at that profile, relative to the residual variance.

This distinction matters because an interval for a future outcome is not just an interval for the regression mean. Even if the mean were known exactly, a future outcome could differ from it. Conversely, uncertainty in estimating the mean adds to that future-outcome variation. The leverage term expresses the second contribution in a way that depends on the specified predictor values and the observed design.

Model and Definition

Suppose the observed data follow a multiple linear regression model with \(n\) observations and \(p\) regression coefficients, including the intercept. Let \(X\) be the \(n\)-by-\(p\) design matrix, with one row of predictor values for each observation. For a new case, let \(\mathbf{x}_0\) be the \(p\)-by-1 vector of predictor values, including a 1 for the intercept. The model for the new outcome is

$$ Y_{\text{new}}=\mathbf{x}_0^\mathsf{T}\boldsymbol{\beta}+\varepsilon_{\text{new}}. $$

Here, \(\boldsymbol{\beta}\) is the vector of regression coefficients. For the usual t-based prediction interval, assume the regression mean is correctly specified and that the errors are independent, have mean zero and a common variance \(\sigma^2\), and are normally distributed. Treat the predictor values, including \(\mathbf{x}_0\), as fixed. Also assume \(X\) has full column rank, so the least-squares coefficient estimates can be calculated. The future error \(\varepsilon_{\text{new}}\) is independent of the errors used to fit the model.

Write \(\hat{\boldsymbol{\beta}}\) for the least-squares coefficient estimates. The fitted mean at the new profile is \(\hat{Y}_0=\mathbf{x}_0^\mathsf{T}\hat{\boldsymbol{\beta}}\). The prediction leverage at this profile is the scalar

Definition: The prediction leverage for a specified predictor vector \(\mathbf{x}_0\) is \(h_0=\mathbf{x}_0^\mathsf{T}(X^\mathsf{T}X)^{-1}\mathbf{x}_0\). It is nonnegative when \(X\) has full column rank. It measures the contribution of coefficient-estimation uncertainty at that profile, scaled relative to the residual variance.

Leverage is a property of the predictor profile and the fitted design, not of the future outcome’s residual. It has no measurement units. If the profile is one of the observed cases, this quadratic form gives the corresponding diagonal element of the usual hat matrix. For a new case, it is more precise to call it prediction leverage.

How Leverage Enters the Prediction-Error Variance

The prediction error is the future outcome minus the fitted mean, \(Y_{\text{new}}-\hat{Y}_0\). Substituting the model for the future outcome separates this error into two pieces: the future residual \(\varepsilon_{\text{new}}\), and the error in estimating the mean. Since the new residual is independent of the fitted coefficients, the two pieces have covariance zero.

$$ \begin{aligned} Y_{\text{new}}-\hat{Y}_0 &=\varepsilon_{\text{new}}+\mathbf{x}_0^\mathsf{T} (\boldsymbol{\beta}-\hat{\boldsymbol{\beta}}),\\ \operatorname{Var}(Y_{\text{new}}-\hat{Y}_0\mid X,\mathbf{x}_0) &=\operatorname{Var}(\varepsilon_{\text{new}}) +\operatorname{Var}\!\left(\mathbf{x}_0^\mathsf{T} (\hat{\boldsymbol{\beta}}-\boldsymbol{\beta})\right)\\ &=\sigma^2+\mathbf{x}_0^\mathsf{T} \left\{\sigma^2(X^\mathsf{T}X)^{-1}\right\}\mathbf{x}_0\\ &=\sigma^2(1+h_0). \end{aligned} $$

The coefficient-estimation term follows from the least-squares covariance matrix, \(\operatorname{Var}(\hat{\boldsymbol{\beta}})=\sigma^2(X^\mathsf{T}X)^{-1}\). The expression shows why leverage adds to the future residual variation rather than replacing it: the prediction-error variance contains \(\sigma^2\) for the new residual and \(\sigma^2h_0\) for uncertainty in the fitted mean.

In practice, \(\sigma\) is unknown and is estimated by the residual standard error \(s\). With \(df=n-p\), the usual t-based prediction interval is

$$ \hat{Y}_0 \ \pm\ t^*_{df}\,s\sqrt{1+h_0}. $$

Here \(t^*_{df}\) is the positive t critical value for the chosen confidence level and residual degrees of freedom. The standard error for predicting a new outcome is \(s\sqrt{1+h_0}\). By comparison, the standard error for the fitted mean alone is \(s\sqrt{h_0}\). Thus the interval for a new outcome includes both sources of uncertainty.

Worked Example: Calculating an Interval From Prediction Leverage

In a hypothetical regression model for a health measurement, a specified patient profile has fitted mean \(\hat{Y}_0=42.0\) units and prediction leverage \(h_0=0.0800\). The residual standard error is \(s=5.00\) units, and the residual degrees of freedom are 24. Find a 95% prediction interval. Use \(t^*_{24}=2.064\).

First calculate the prediction standard error. The term 1 represents future residual variation; the leverage term adds fitted-mean uncertainty.

$$ SE_{\text{pred}}=s\sqrt{1+h_0} =5.00\sqrt{1+0.0800} =5.00\sqrt{1.0800} \approx 5.196\text{ units}. $$

The margin of error is

$$ 2.064(5.196)\approx 10.72\text{ units}. $$

Therefore, the prediction interval is

$$ 42.0\pm 10.72 \quad\Longrightarrow\quad (31.28,\ 52.72)\text{ units}. $$

Under the stated model and assumptions, this interval is intended to cover the outcome of one future case with this predictor profile, not the average outcome of all cases at the profile. The leverage contributes \(s^2h_0=25.0(0.0800)=2.00\) square units to the estimated prediction-error variance, in addition to \(s^2=25.0\) square units for the future residual.

Comparing Widths at Two Profiles

For a fixed fitted model and confidence level, the interval width is \(2t^*_{df}s\sqrt{1+h_0}\). Therefore, if the residual standard error and degrees of freedom are held fixed, a profile with larger prediction leverage has a larger prediction standard error and a wider prediction interval. This comparison concerns leverage’s contribution to width; it does not imply that the future residual variation itself has changed.

Worked Example: Same Model, Different Prediction Leverages

A hypothetical regression has residual standard error \(s=3.20\) minutes, \(df=30\), and 95% critical value \(t^*_{30}=2.042\). Two new profiles have the same fitted mean, 18.0 minutes, but prediction leverages \(0.0400\) and \(0.360\). Compare their prediction intervals.

For the first profile,

$$ SE_{\text{pred},1} =3.20\sqrt{1+0.0400} =3.20\sqrt{1.0400} \approx 3.263\text{ minutes}. $$

Its margin is \(2.042(3.263)\approx6.664\) minutes, giving the interval \[ 18.0\pm6.664=(11.34,\ 24.66)\text{ minutes}. \]

For the second profile,

$$ SE_{\text{pred},2} =3.20\sqrt{1+0.360} =3.20\sqrt{1.360} \approx 3.732\text{ minutes}. $$

Its margin is \(2.042(3.732)\approx7.620\) minutes, giving the interval \[ 18.0\pm7.620=(10.38,\ 25.62)\text{ minutes}. \]

The first interval has width about \(13.33\) minutes; the second has width about \(15.24\) minutes. Their centers and residual standard error are the same, but the larger leverage at the second profile increases the uncertainty in its fitted mean and therefore widens the prediction interval.

Reading Leverage From a Model Calculation

When the fitted model output does not provide prediction leverage directly, it can be calculated from \(\mathbf{x}_0^\mathsf{T}(X^\mathsf{T}X)^{-1}\mathbf{x}_0\). The intercept must be included in \(\mathbf{x}_0\), and the predictor values must use the same coding and units as the design matrix. Omitting a column or using different coding changes the calculation.

Worked Example: Calculating Leverage for a Predictor Profile

Suppose a hypothetical two-predictor regression has the following inverse cross-product matrix:

$$ (X^\mathsf{T}X)^{-1} = \begin{pmatrix} 0.100 & 0 & 0\\ 0 & 0.0200 & 0\\ 0 & 0 & 0.00500 \end{pmatrix}. $$

The predictor vector for a new profile is \(\mathbf{x}_0=(1,2,4)^\mathsf{T}\), where the first entry is the intercept column. Calculate its prediction leverage.

$$ \begin{aligned} h_0 &= \begin{pmatrix}1&2&4\end{pmatrix} \begin{pmatrix} 0.100 & 0 & 0\\ 0 & 0.0200 & 0\\ 0 & 0 & 0.00500 \end{pmatrix} \begin{pmatrix}1\\2\\4\end{pmatrix}\\ &=(1^2)(0.100)+(2^2)(0.0200)+(4^2)(0.00500)\\ &=0.100+0.0800+0.0800=0.260. \end{aligned} $$

For this profile, the fitted mean is 15.2 hours, \(s=2.50\) hours, \(df=18\), and \(t^*_{18}=2.101\) for a 95% interval. Then

$$ SE_{\text{pred}} =2.50\sqrt{1+0.260} =2.50\sqrt{1.260} \approx2.806\text{ hours}. $$

The margin is \(2.101(2.806)\approx5.896\) hours. The prediction interval is \(15.2\pm5.896\), or approximately \((9.304,\ 21.10)\) hours. The calculation uses the profile’s leverage to account for fitted-mean uncertainty as well as the future residual variation.

Common Mistakes and a Practical Check

A common mistake is to use \(s\sqrt{h_0}\) as the standard error for a new outcome. That is the standard error for estimating the fitted mean, not for predicting one future outcome. It omits the new case’s residual variation. The correction is to use \(s\sqrt{1+h_0}\) for a prediction interval. Another mistake is to treat leverage as an estimate of residual noise: leverage describes how much the estimated mean’s uncertainty contributes at a profile, while \(s\) estimates the model’s residual scale.

Before interpreting an interval, check that its leverage was calculated for the specified predictor profile, that the intercept and predictor coding match the fitted model, and that the interval is for a new individual outcome rather than a conditional mean. Also report the outcome’s units. Leverage alone does not determine whether the model is appropriate for prediction; the stated regression assumptions still matter.

Key takeaway: For a specified profile, prediction leverage \(h_0\) adds \(s^2h_0\) to the \(s^2\) contribution from a future residual. The prediction standard error is \(s\sqrt{1+h_0}\), so higher leverage widens the prediction interval when the other quantities are held fixed.

Check Your Understanding

Answer each question using the distinction between fitted-mean uncertainty and future residual variation.

  1. In the prediction-error variance \(\sigma^2(1+h_0)\), what does the 1 represent, and what does \(h_0\) represent?
  2. A profile has \(h_0=0.25\) and \(s=4\) outcome units. Calculate its estimated prediction standard error.
  3. For the same model and confidence level, two profiles have identical fitted means but different leverages. Which has the wider prediction interval, and why?
  4. Why is \(s\sqrt{h_0}\) not the standard error to use for predicting one new outcome?
  5. What must the entries of \(\mathbf{x}_0\) include, and why must their coding match the fitted design matrix?