Prediction Interval Calculator
Compute the prediction interval for a new observation from a fitted regression line.
Enter regression stats and a new x value to get the interval bounds.
A prediction interval tells you where a single new observation is likely to fall, given a fitted regression line. It is wider than a confidence interval for the mean response because it has to account for two sources of uncertainty: the uncertainty in where the true mean response is, and the random scatter of individual observations around that mean.
The formula for a prediction interval at a new x value x* is:
y-hat +/- t * s * sqrt(1 + 1/n + (x* - x-bar)^2 / Sxx)
where y-hat is the predicted value from the regression line, s is the residual standard error, n is the sample size, x-bar is the mean of the x values in the training data, Sxx is the sum of squared deviations of x, and t is the t-critical value with n-2 degrees of freedom.
The extra 1 inside the square root is what makes prediction intervals wider than confidence intervals for the mean. The confidence interval for the mean response uses sqrt(1/n + (x* - x-bar)^2 / Sxx), which captures uncertainty in the mean regression line but not observation-level scatter.
The term (x* - x-bar)^2 / Sxx grows as x* moves away from the center of the data. Predictions near x-bar are more reliable than predictions at the extremes. This is why extrapolating a regression line far outside the data range produces very wide intervals and is generally inadvisable.
To use this calculator: fit a linear regression in your statistics software, record the residual standard error (often labeled s or RMSE), the sample size, and the Sxx from the summary. Then plug in any new x* to get the interval.
A 95% prediction interval means: if you repeated the study many times, about 95% of the intervals you compute would contain the actual new observation. It does not mean there is a 95% chance the new observation falls in this specific interval.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.