Regression Prediction Interval Calculator

StatisticsLast updated: August 22, 2026

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.

The X values the model is fitted on. They must be in the same order and the same number as Y.
Each value belongs to the observation in the matching position of the X field.
The confidence interval for the mean response and the prediction interval for a single observation are computed at this point.
The probability that the interval covers the true parameter.

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

  1. 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.
  2. Enter the x₀ value you want a prediction for; where possible, pick a value inside the observed range of X.
  3. Choose the confidence level (90%, 95%, or 99%); the higher the level, the wider both intervals become.
  4. Compare the confidence interval for the mean response with the prediction interval for a single observation, and report the one that answers your question.
  5. 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.
  6. 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

Frequently Asked Questions

What is the difference between a confidence interval and a prediction interval?
A confidence interval covers a PARAMETER — the mean Y of the units having the value x₀. A prediction interval covers a SINGLE Y value that will be observed in the future. Because an individual observation is affected both by the uncertainty in the position of the line and by its own random error, the prediction interval is always wider. Confusing the two is one of the most common mistakes in regression write-ups.
What does the leverage (h₀) mean?
h₀ measures how far the point x₀ sits from the center of the data, and it directly determines the uncertainty of the prediction. Its smallest value is 1/n, reached at x₀ = x̄; as x₀ moves away, the (x₀ − x̄)² term grows, h₀ increases, and the intervals widen. An observed point whose leverage exceeds 2(k+1)/n is regarded as influential.
Why does the prediction interval not shrink when I collect more data?
The mean response interval scales with RSE·√h₀, and since h₀ ≥ 1/n it approaches zero as n grows. The prediction interval scales with RSE·√(1 + h₀); the 1 there is the error variance of the individual observation, and no amount of extra data reduces it. Even with infinite data you could only predict an individual outcome to within roughly ±t·RSE.
Why is extrapolation risky?
The model has only been tested over the observed range of X. Outside it there is no guarantee that the relationship keeps the same linear form: the trend may flatten, saturate, or reverse. Worse, the interval formulas ASSUME the model is correct, so in the wrong region they produce intervals that look narrow and reassuring. The calculator shows a warning in that case.
What assumptions do the intervals rest on?
Linearity, independence of the errors, constant error variance (homoscedasticity), and normally distributed errors. When constant variance fails, the interval is too narrow in one region and too wide in another; when normality fails, the coverage rate drops, especially in small samples. Do not report the intervals without inspecting a residual plot.
Does it give the same result as Excel, SPSS, or R?
Yes. In R, predict(model, newdata, interval="confidence") gives the mean response interval and interval="prediction" gives the prediction interval, using the same formulas. In SPSS, the Mean and Individual options under Regression → Save correspond to these two intervals. Excel has no built-in function; you take the point prediction with FORECAST and compute h₀ and the RSE by hand.
What changes if I choose 99% confidence?
The critical t value grows, so both intervals widen; coverage becomes safer while the prediction becomes less useful. For df = 10, for instance, the t value rises from 2.228 at 95% to 3.169 at 99%, widening the intervals by roughly 42%. Always state the confidence level explicitly in your report.