Prediction Interval Calculator Formula

Understand the math behind the prediction interval calculator. Each variable explained with a worked example.

Formulas Used

Prediction Margin

margin = t_value * se_reg * sqrt(1 + 1/n)

Lower Prediction Limit

lower = y_hat - t_value * se_reg * sqrt(1 + 1/n)

Upper Prediction Limit

upper = y_hat + t_value * se_reg * sqrt(1 + 1/n)

Variables

VariableDescriptionDefault
y_hatPredicted Value (y-hat)50
se_regStandard Error of Regression (Se)5
nSample Size (n)30
t_valuet-Critical Value (e.g., 2.048 for 95%, df=28)2.048

How It Works

Prediction Interval for New Observation

A prediction interval estimates the range where a single new observation is likely to fall, accounting for both estimation uncertainty and individual variability.

Simplified Formula (at x-bar)

PI = y-hat ± t × Se × sqrt(1 + 1/n)

Prediction intervals are always wider than confidence intervals for the mean because they must account for individual observation scatter. The full formula also includes a term for distance from x-bar.

Worked Example

Predicted value 50, Se = 5, n = 30, 95% confidence (t = 2.048).

y_hat = 50se_reg = 5n = 30t_value = 2.048
  1. 01sqrt(1 + 1/30) = sqrt(1.0333) = 1.0165
  2. 02Margin = 2.048 × 5 × 1.0165 = 10.41
  3. 03PI: 50 ± 10.41 = (39.59, 60.41)

Frequently Asked Questions

How is a prediction interval different from a confidence interval?

A confidence interval estimates where the mean response lies (narrows with more data). A prediction interval estimates where a single new observation will fall (never narrows below Se even with infinite data).

Why is the prediction interval wider far from x-bar?

The full formula includes a term (x0 - x-bar)²/Sxx that increases as you move away from the center of the data. This reflects greater uncertainty in the regression line position at extreme x values.

Can I use prediction intervals for extrapolation?

Technically you can calculate them, but they become unreliable outside the range of observed x values. The linear relationship may not hold, and the intervals will be overly optimistic about prediction accuracy.

Ready to run the numbers?

Open Prediction Interval Calculator