Statistics Quest

Confidence vs prediction intervals in regression

A confidence interval estimates the mean response at x₀; a prediction interval covers a single new observation and is always wider.

y^0±t1−α/2, n−p σ^x0⊤(X⊤X)−1x0\hat y_0 \pm t_{1-\alpha/2,\,n-p}\,\hat\sigma\sqrt{\mathbf{x}_0^\top (X^\top X)^{-1}\mathbf{x}_0}
Confidence interval for the mean response
y^0\hat y_0
fitted value at the new predictor values
x0\mathbf{x}_0
row of predictor values (with a 1 for the intercept)
XX
model matrix of the fitted data
y^0±t1−α/2, n−p σ^1+x0⊤(X⊤X)−1x0\hat y_0 \pm t_{1-\alpha/2,\,n-p}\,\hat\sigma\sqrt{1 + \mathbf{x}_0^\top (X^\top X)^{-1}\mathbf{x}_0}
Prediction interval for one new observation
11
the extra term for the new observation's own error variance
x0⊤(X⊤X)−1x0=1n+(x0−xˉ)2Sxx\mathbf{x}_0^\top (X^\top X)^{-1}\mathbf{x}_0 = \frac{1}{n} + \frac{(x_0-\xbar)^2}{S_{xx}}
Simple regression form
x0x_0
the predictor value at which you predict

When to use

  • Confidence interval: "What is the average y for all units with x = x₀?"
  • Prediction interval: "Where will the next individual with x = x₀ fall?"

Assumptions

Those of regression inference. Prediction intervals additionally rely heavily on normal, constant-variance errors — they do not improve with n the way confidence intervals do.

How to interpret

  • Both are narrowest at x0=xˉx_0 = \xbar and widen as x0x_0 moves away.
  • As n grows the confidence interval shrinks towards zero width; the prediction interval shrinks towards y^0±zσ\hat y_0 \pm z\sigma, never to zero.

Common mistakes

  • Using the confidence interval to describe where individual observations will fall (far too narrow).
  • Predicting outside the range of the data, where neither interval is trustworthy.

Example

Spend–sales line at x₀ = 4: y^0=6.6\hat y_0 = 6.6, t(4 df) = 2.776.

  • Mean response: SE = 0.356, 95% CI (5.61, 7.59).
  • One new week: SE = 0.909, 95% PI (4.08, 9.12) — about 2.5 times wider.