How to Calculate a Confidence Interval for a Mean

Estimates the range that likely contains the population mean as sample mean ± z × population standard deviation ÷ √n, for a known population standard deviation. At a 95% confidence level z is about 1.96.

A confidence interval turns a sample mean into a range that plausibly contains the population mean.

xˉ±z×σn\bar{x} \pm z \times \dfrac{\sigma}{\sqrt{n}}

The quantity σn\dfrac{\sigma}{\sqrt{n}} is the standard error, the spread of the sample mean itself. Multiplying it by zz gives the margin of error.

Example

Take a sample mean of 50, a population standard deviation of 10, a sample of 100 and a confidence level of 95%.

50±1.96×10100=50±1.96×1=50±1.9650 \pm 1.96 \times \dfrac{10}{\sqrt{100}} = 50 \pm 1.96 \times 1 = 50 \pm 1.96

The 95% confidence interval runs from 48.04 to 51.96.

How to read it correctly

Saying "there is a 95% probability that the population mean lies between 48.04 and 51.96" is not strictly right. The population mean is a fixed number; it does not have a probability.

The correct reading is that if you repeated the whole study many times, 95% of the intervals built this way would contain the population mean.

Narrowing the interval

The standard error shrinks with n\sqrt{n}, so halving the width of the interval means quadrupling the sample. Precision is expensive.

This formula assumes the population standard deviation is known. When it is not, use the sample standard deviation together with the t distribution.