Regression Prediction Interval Calculator
A regression line gives a single point estimate for a given x₀, but how uncertain that estimate is depends on the question you are asking. "What is the mean Y of ALL units having this x₀?" is answered by the confidence interval for the mean response. "What will the Y of a NEW unit with this x₀ be?" is answered by the prediction interval, which is always wider.
This calculator works out both intervals side by side, shows the difference numerically, and gives the leverage h₀ = 1/n + (x₀ − x̄)²/Sxx step by step. It also raises an extrapolation warning when x₀ falls outside the observed data range, draws both bands across the observed range of x, and provides a comparison table for a selection of x values.
Confidence Interval for the Mean Response and Prediction Interval
Point prediction: ŷ₀ = b₀ + b₁·x₀ Leverage: h₀ = 1/n + (x₀ − x̄)² / Σ(xᵢ − x̄)² Residual std. error: RSE = √[ Σ(yᵢ − ŷᵢ)² / (n − 2) ] Mean response CI: ŷ₀ ± t_(1−α/2, n−2) · RSE · √h₀ Prediction interval: ŷ₀ ± t_(1−α/2, n−2) · RSE · √(1 + h₀) Width ratio: √((1 + h₀) / h₀) Narrowest point: h₀ = 1/n at x₀ = x̄ (its smallest possible value)
The only difference between the two intervals is the 1 inside the square root: the mean response interval carries only the uncertainty in the position of the line, while the prediction interval also carries the error term of the individual observation, with variance σ². That is why the prediction interval is always wider and does not shrink to zero as n → ∞.
How to Calculate
- Enter the X and Y values in the same order; each row must belong to the same observation and both fields must hold the same number of values.
- Enter the x₀ value you want a prediction for; where possible, pick a value inside the observed range of X.
- Choose the confidence level (90%, 95%, or 99%); the higher the level, the wider both intervals become.
- Compare the confidence interval for the mean response with the prediction interval for a single observation, and report the one that answers your question.
- Look at the leverage h₀: close to 1/n means x₀ sits near the center of the data and the prediction is reliable; a large value means x₀ is out at the edges and the intervals widen.
- Study how the two bands open out on the band chart, and avoid reporting the prediction at all if the extrapolation warning appears.
Worked Examples
Predicting sales from an advertising budget
In the model ŷ = 26.724 + 2.840·x, the point prediction for x₀ = 30 is 111.912. With a leverage of h₀ = 0.0979, the mean response interval runs from 110.996 to 112.828 (width 1.832), while the prediction interval for a single observation runs from 108.845 to 114.979 (width 6.134): the prediction interval is 3.35 times as wide.
Point prediction (x₀ = 30.00): 111.912 · 95% confidence interval for the mean response: 110.996 – 112.828 · Width of the mean response interval: 1.832
A point far from the center of the data (leverage rises)
In the same model, choosing x₀ = 40 moves away from x̄ = 26.3333, so the leverage climbs to 0.2858; the point prediction becomes 140.308 and the mean response interval opens out noticeably to 138.743 – 141.873 (width 3.130). The single-observation interval is 136.989 – 143.627 (width 6.639) and is now only 2.12 times as wide: the further you move from x̄, the closer the two intervals get to each other.
Point prediction (x₀ = 40.00): 140.308 · 95% confidence interval for the mean response: 138.743 – 141.873 · Width of the mean response interval: 3.130
Extrapolation warning
With an observed range of 1 – 8, asking for x₀ = 15 makes the calculator raise an extrapolation warning. The point prediction is 59.000, but the leverage jumps from its floor of 1/n = 0.125 to 2.7500; the mean response interval is 56.058 – 61.942 (width 5.885) and the prediction interval is 55.564 – 62.436 (width 6.872). The ratio between them falls to 1.17: in this region the uncertainty is dominated by the position of the line, and because the model has never been tested there, the numbers remain purely formal.
Point prediction (x₀ = 15.00): 59.000 · 95% confidence interval for the mean response: 56.058 – 61.942 · Width of the mean response interval: 5.885