A regression line gives a single predicted value, ŷ, for any given x — but a single number always understates real uncertainty. Regression offers two different types of interval around that prediction, and they answer genuinely different questions: a confidence interval estimates where the average y-value sits for a given x, while a prediction interval estimates where one individual new observation is likely to fall. Confusing the two is one of the more consequential mistakes in applied regression, since prediction intervals are always meaningfully wider.
- Why the two intervals ask different questions, and why prediction intervals are always wider
- The formulas, built directly on the residual standard error
- A full worked example computing both, using the ice-cream-sales data from simple linear regression
- Which interval to use for which real-world question
Two Different Questions
Building on the ice cream shop example from simple linear regression (temperature predicting daily ice cream sales), consider two superficially similar but genuinely different questions at temperature x=26°C: "what's the average number of ice creams sold across all days at 26°C?" versus "how many ice creams will be sold on one specific upcoming day at 26°C?" The first question has less uncertainty — averages are inherently more stable than individual observations, since the random day-to-day noise that makes any single day unpredictable partially cancels out when averaging across many days. The second question inherits both the uncertainty in the average and the full random variability of one individual day, which never cancels out no matter how much historical data is available.
The Formulas
Both intervals are built around the same predicted value, ŷ₀, but with different standard errors:
Here s is the residual standard error (roughly, the typical size of a prediction miss on the data used to fit the model), n is the sample size, x₀ is the x-value being predicted at, x̄ is the mean of the observed x-values, and Sₓₓ = Σ(xᵢ−x̄)² measures how spread out the observed x-values were. The prediction interval's formula is identical to the confidence interval's, except for the extra "+1" inside the square root — that single term is what accounts for one individual observation's own random variability, on top of the uncertainty in estimating the average. Both intervals then take the same general form as any other confidence interval on this site: estimate ± (critical value × standard error), using a t critical value with n−2 degrees of freedom.
Worked Example
Problem: Using the ice cream data — (18,45), (22,58), (25,70), (28,82), (30,95), giving ŷ = −30.34 + 4.08x — construct both a 95% confidence interval and a 95% prediction interval for x₀ = 26°C.
First, the predicted value: ŷ₀ = −30.34 + 4.08(26) ≈ 75.71 ice creams.
The residual standard error, computed from how far each of the 5 original data points fell from the fitted line, works out to s ≈ 2.62. With x̄ = 24.6, Sₓₓ = 91.2, and n = 5:
SE(mean) = 2.62 × √[1/5 + (26−24.6)²/91.2] ≈ 1.23
SE(prediction) = 2.62 × √[1 + 1/5 + (26−24.6)²/91.2] ≈ 2.90
With df = n−2 = 3, the 95% t critical value is 3.182:
95% confidence interval for the mean: 75.71 ± 3.182(1.23) ≈ (71.78, 79.64) ice creams
95% prediction interval for one day: 75.71 ± 3.182(2.90) ≈ (66.49, 84.93) ice creams
The prediction interval (66.49 to 84.93, a width of about 18.4) is more than twice as wide as the confidence interval (71.78 to 79.64, a width of about 7.9) — both centered on the identical predicted value of 75.71, but answering genuinely different questions with genuinely different amounts of honest uncertainty attached. Reporting the narrower confidence interval as if it applied to a single day's expected sales would substantially understate how much any one particular day could plausibly deviate from the trend.
Why the Gap Between Them Shrinks (But Never Disappears) With More Data
As sample size n grows, SE(mean) shrinks toward zero — with enough data, the average response at a given x can in principle be pinned down with near-perfect precision. SE(prediction), however, never shrinks below the residual standard error s, no matter how large n gets, because the "+1" term inside its square root doesn't depend on n at all. This reflects something genuinely irreducible: no amount of historical data can shrink the day-to-day randomness of one new, not-yet-observed outcome — more data makes the underlying trend line more precise, but it can't make any single future day less inherently variable.
Which Interval to Use
Use a confidence interval when the question is about an average or a typical value — "what's the average ice cream sales figure across all days this warm?" — the kind of question relevant to planning average inventory needs, setting typical staffing levels, or describing a general trend.
Use a prediction interval when the question is about one specific, individual upcoming outcome — "how much stock should be on hand for tomorrow specifically, given tomorrow's forecast temperature?" — where the actual random variability of that one day matters, not just the average trend.
Real-World Uses
Inventory and staffing decisions: as the ice cream example suggests, a business deciding how much stock to have on hand for one specific upcoming day needs the wider prediction interval, since understocking or overstocking for that one actual day is what carries real cost — a narrower confidence interval for the long-run average would understate the risk of an unusually busy or unusually slow individual day.
Scientific reporting of a new measurement: when a lab reports the expected range for one new sample's measurement based on a calibration curve fit from known reference samples, a prediction interval is the statistically honest choice, since the new sample is a single individual observation, not an average across many.
Communicating trend estimates: when the goal is describing how a quantity behaves on average across a range of x-values — a general scientific or business trend — a confidence interval around the fitted line is the more appropriate and more precise choice, since averaging is genuinely the question being asked.
Common Mistakes
Reporting a confidence interval when a prediction interval was actually needed. This is the single most common error with these two intervals — a confidence interval looks reassuringly narrow, but using it to bound one individual future observation systematically understates real uncertainty, sometimes substantially.
Assuming the two intervals converge as sample size grows. As explained above, they don't — the prediction interval has an irreducible floor set by the residual standard error s, however large the sample becomes.
Are confidence and prediction intervals both centered on the same predicted value?
Why does the interval get wider farther from x̄, the mean of the observed x-values?
Do multiple regression models have prediction intervals too?
What happens to both intervals if the residuals aren't normally distributed?
Share this article
Written by
Statistics Fundamentals Editorial Team
Written and reviewed by our team of statistics educators. Content is aligned with GCSE, A-Level, AP Statistics, and undergraduate curricula.
About Statistics Fundamentals →