Which Statistical Test?
Confidence Interval or Prediction Interval? A Regression Example
You have fitted a regression and want to put a range around a number. Which range? Confidence interval and prediction interval sound alike, and software often reports both, yet they answer different questions. Mixing them up is one of the quietest mistakes in applied statistics.

Two different questions
A confidence interval estimates the mean response for a given predictor value: on average, what score do students who study 8 hours get? A prediction interval covers a single new observation: what score might one particular student who studies 8 hours get? Course notes make the same distinction, and explain why the second is wider (Penn State STAT 501).
An example with ten students
Take ten students whose study hours run from 1 to 10, with exam scores of 52, 55, 61, 58, 66, 64, 72, 70, 77 and 75. The simple linear regression calculator gives a line of about 50.1 + 2.70 × hours, with R² ≈ 0.92, and a residual standard deviation of about 2.5 points. The Pearson correlation calculator confirms a very strong relationship.
At 8 hours, the predicted score is 71.8. The 95% confidence interval for the mean score is 69.3 to 74.2, a width of under 5 points. The 95% prediction interval for one new student is 65.4 to 78.1, about 13 points wide.
Why the second is wider
A prediction interval must absorb two sources of uncertainty: where the true mean line sits, and how far an individual falls from that line. The first shrinks as the sample grows. The second does not, since people differ regardless of how many we study (Statistics LibreTexts).
With millions of observations, the confidence interval for the mean can become razor-thin while the prediction interval stays as wide as the scatter of individuals.
Both widen away from the center
Near the average number of hours, 5.5, the intervals are narrowest: the confidence interval is 63.2 to 66.8 and the prediction interval 58.9 to 71.1. At 10 hours, the edge of our data, they widen to 73.7 to 80.6 and 70.4 to 83.9.
Estimates are most trustworthy near the middle of the data.
The extrapolation trap
Push further and things break. At 20 hours the line predicts 104.2, above the maximum possible score, and the prediction interval, 93.0 to 115.3, includes impossible values. A model is only a description of the range where we have data. Our marathon training article showed a straight line failing in the same way.
Which one should you use?
Assumptions worth checking
Both intervals assume that the relationship is roughly linear, that the scatter around the line is similar at every level, and that observations are independent. Prediction intervals also lean on the errors being roughly normal, because they describe individuals rather than averages. A residual plot is the quick check.
Always state the confidence level, usually 95%, and the units, so readers know what range they are looking at.
Use a confidence interval when the question is about an average or a relationship, such as a policy's effect on typical outcomes. Use a prediction interval when forecasting an individual case, such as planning for the next student, patient or shipment. The confidence interval for a mean and the multivariate regression calculator help build the picture, and our article on standard deviation versus standard error covers a related distinction.