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
| Variable | Description | Default |
|---|---|---|
y_hat | Predicted Value (y-hat) | 50 |
se_reg | Standard Error of Regression (Se) | 5 |
n | Sample Size (n) | 30 |
t_value | t-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).
- 01sqrt(1 + 1/30) = sqrt(1.0333) = 1.0165
- 02Margin = 2.048 × 5 × 1.0165 = 10.41
- 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