# Should I use 'sample standard deviation' for 'prediction intervals' and 'standard error of the mean' for 'confidence intervals'?

I just want to make sure I am getting this right. When I am concerned about the "result" of any particular new datapoint I should use prediction intervals not confidence intervals. When I am concerned about estimating the true population mean then I should use confidence intervals and not prediction intervals. If you have a lot of data the confidence intervall can get very narrow, but the prediction interval will stay wide and will represent the uncertainty about any given unlabeled datapoint of the population.

Say we have a population of $M$ datapoints. The extreme would be that you have a sample of all but one datapoint, i.e., the sample size is $N = M-1$ and there is just 1 unknown datapoint. The confidence about the population mean is almost certain and the confidence intervall will be very narrow. However, we have no clue about the remaining unknown datapoint: The prediction intervall will be as wide as for any datapoint. Us having very high confidence about the mean of the population doesn't make us any more certain about a particular datapoint.

For prediction intervals this means I should use the (corrected) sample standard deviation:

$s = \sqrt{\frac{1}{N-1}\sum_{i=1}^{N}(x_i-\bar{x})^2}$

Let's say we're talking about a Gaussian distribution with some confidence level $\alpha$ and a cumulative distribution function (CDF) of the standard normal distribution $\Phi(\cdot)$, such that we can get a z score:

$z = \Phi^{-1}(\alpha)$

... and a prediction interval:

$[\bar{x} - zs, \bar{x} + zs]$

Contrast this with a confidence interval where we use the standard error of the mean instead:

$s_{\bar{x}} = \frac{s}{\sqrt{N}}$

Making the confidence interval:

$[\bar{x} - zs_{\bar{x}}, \bar{x} + zs_{\bar{x}}]$

... or for easier comparison to the prediction interval:

$[\bar{x} - z\frac{s}{\sqrt{N}}, \bar{x} + z\frac{s}{\sqrt{N}}]$

Am I getting it?

Similar posts, but not quite identical: