How to find a confidence interval for a population mean

A sample mean gives us one estimate of a population mean. A confidence interval gives that estimate some room for sampling variation. Let’s build intervals with a known and an unknown population standard deviation so we can see what changes.

Start with the sample mean and a margin of error

The sample mean x¯ is our point estimate of the population mean μ. A confidence interval goes the same distance on either side of that estimate. That distance is the margin of error, which is a critical value times the standard error.

ME=critical value·SE

A 95% confidence procedure would produce intervals that contain the fixed population mean in about 95% of repeated samples, when the conditions for the procedure hold. The sample and the interval can change each time. The population mean stays fixed.

Use a z interval when the population standard deviation is known

For independent observations from a normal population with known standard deviation σ, use the standard normal critical value z*. The same method gives an approximation if the sample mean is approximately normal. With n observations, the standard error is σ/n.

x¯±z*·σn

For a two-sided interval, choose z* so the central area is the confidence level. The remaining area, α, is split equally between the two tails. For 95% confidence, each tail has area 0.025. The cutoffs are -1.96 and 1.96.

Normal critical values for a 95 percent confidence intervalThe area between z equals negative 1.96 and positive 1.96 is 95 percent. Each outer tail has area 2.5 percent.−1.961.96Standard normal distribution95%2.5%2.5%z
The cutoffs are z-scores on a reference distribution. The confidence interval itself is in the units of the sample mean.

Find a 90% z interval for mean bottle fill

Suppose bottle fills are normally distributed, with known standard deviation 1 ounce. A random sample of 100 bottles has a mean fill of 16 ounces. We’ll treat the fills as independent. For 90% confidence, each tail has area 0.05, so z*≈1.645.

SE=1100=0.1ME=1.645(0.1)=0.164516±0.1645=(15.8355,16.1645)

So we’re 90% confident that the population mean fill is between about 15.84 and 16.16 ounces. The interval estimates the mean fill across the population of bottles.

Plan the sample size for a fixed margin of error

When planning a z interval with known σ, start with a target margin of error E. Since z*σ/n must be at most E, solve for the smallest sample size that meets that requirement.

n≥(z*σE)2

For 95% confidence, z*≈1.96. If σ=5.14 and E=2, the calculation gives

(1.96(5.14)2)2≈25.37

Round up to 26 so the margin of error is at most 2 under the assumed z model.

Use a t interval when the population standard deviation is unknown

If we estimate σ with the sample standard deviation s, the estimated standard error is s/n. Use a t critical value with n-1 degrees of freedom. The one-sample t interval is exact for independent observations from a normal population. For a small sample we need a reasonable normal model, while larger samples can give a good approximation for a wider range of population shapes.

x¯±t*·sn

As the degrees of freedom increase, the t critical value gets closer to the z critical value. We can still use the t interval for a large sample when σ is unknown.

Find a 99% t interval for a mean exam score

Suppose 10 students are selected at random, their scores can be treated as independent, and a normal model for scores is reasonable. The sample has mean 86.7 and standard deviation 5.72. We have 9 degrees of freedom. For 99% confidence, the upper tail area is 0.005, which gives t*≈3.250.

SE=5.7210ME=3.250·5.7210≈5.8886.7±5.88≈(80.82,92.58)

We’re 99% confident that the population mean score is between about 80.82 and 92.58 points. The confidence level describes how often this method captures the true mean over repeated samples.