Lesson 5 of 8 · 15 min

Confidence intervals for a mean

Turn one sample's mean and standard deviation into an approximate confidence interval xˉ±zsn\bar{x} \pm z\frac{s}{\sqrt{n}} for the population mean, choosing the right zz for the confidence level.

What you will be able to do

  • Explain the difference between a point estimate and an interval estimate of μ\mu.
  • Find the zz quantile for a confidence level, and recall 1.6451.645, 1.9601.960 and 2.5762.576.
  • Calculate the approximate confidence interval (xˉ−zsn,xˉ+zsn)\left(\bar{x} - z\frac{s}{\sqrt{n}}, \bar{x} + z\frac{s}{\sqrt{n}}\right), using σ\sigma when it is known.

So far you have started from μ\mu and asked where xˉ\bar{x} is likely to fall. In practice it runs the other way: you have one sample and want to know μ\mu. A survey of 50 Brisbane workers finds a mean commute of xˉ=34.2\bar{x} = 34.2 minutes. The single number 34.234.2 is a point estimate of μ\mu. It is almost certainly not exactly right, so a range of plausible values is more honest and more useful.

Definition

Interval estimate

An interval estimate for a parameter is a range of plausible values for it, calculated from sample data. A confidence interval is an interval estimate made by a method that captures the parameter for a known proportion of samples, the confidence level (such as 95%). You built these for a proportion pp in Methods; now the parameter is a mean μ\mu.

The idea comes straight from the distribution of Xˉ\bar{X}. For large nn, Xˉ\bar{X} is approximately N(μ,σ2n)N\left(\mu, \frac{\sigma^2}{n}\right), so about 95% of sample means land within 1.961.96 standard errors of μ\mu. Turn that round: for about 95% of samples, μ\mu is within 1.961.96 standard errors of xˉ\bar{x}.

Interactive

The z for a confidence level

The central 95% of N(0,1)N(0, 1) lies between −1.96-1.96 and 1.961.96, leaving 0.0250.025 in each tail. Change the shading to find the zz for 90% and 99%.

Quantiles zz with P(−z<Z<z)=CP(-z < Z < z) = C, from z=invNorm(1+C2)z = \text{invNorm}\left(\frac{1 + C}{2}\right).
Confidence level CC80%90%95%98%99%
zz1.2821.6451.9602.3262.576

Key idea

Approximate confidence interval for μ

From a random sample of size nn with mean xˉ\bar{x} and standard deviation ss, an approximate confidence interval for the population mean μ\mu is

(xˉ−zsn, xˉ+zsn)\left(\bar{x} - z\frac{s}{\sqrt{n}},\ \bar{x} + z\frac{s}{\sqrt{n}}\right)

where zz is the standard normal quantile for the confidence level. It is approximate because it uses the normal approximation for Xˉ\bar{X} and estimates σ\sigma by ss, so it needs a large sample (n≥30n \geq 30).

Where the interval comes from

If Xˉ∼N(μ,σ2n)\bar{X} \sim N\left(\mu, \frac{\sigma^2}{n}\right), then

P(−1.96<Xˉ−μσ/n<1.96)=0.95P\left(-1.96 < \frac{\bar{X} - \mu}{\sigma/\sqrt{n}} < 1.96\right) = 0.95

Multiply through by σn\frac{\sigma}{\sqrt{n}} and rearrange the inequalities to isolate μ\mu:

P(Xˉ−1.96σn<μ<Xˉ+1.96σn)=0.95P\left(\bar{X} - 1.96\frac{\sigma}{\sqrt{n}} < \mu < \bar{X} + 1.96\frac{\sigma}{\sqrt{n}}\right) = 0.95

The random quantity here is Xˉ\bar{X}, so the interval is random and μ\mu is fixed. Replacing σ\sigma with ss (fine for n≥30n \geq 30) and Xˉ\bar{X} with the observed xˉ\bar{x} gives the formula.

Worked example

A 95% confidence interval for a mean commute time

  • Simple familiar
  • Technology active

A random sample of 5050 Brisbane workers had a mean one-way commute time of xˉ=34.2\bar{x} = 34.2 minutes, with standard deviation s=9.6s = 9.6 minutes. Calculate an approximate 95% confidence interval for the mean commute time μ\mu of all Brisbane workers, and interpret it. Give the endpoints correct to 2 decimal places.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Check the sample is random and n≥30n \geq 30.

  2. Choose zz for the confidence level.

  3. Calculate E=zsnE = z\frac{s}{\sqrt{n}} and write xˉ±E\bar{x} \pm E.

  4. Interpret in context with "confident".

Watch out for

  • Using E=1.96×9.6E = 1.96 \times 9.6, which forgets the n\sqrt{n}.

  • Saying "there is a 95% probability that μ\mu is in the interval".

A random sample of 6464 Year 12 students studied for a mean of xˉ=24.6\bar{x} = 24.6 hours in a week, with s=4.0s = 4.0 hours. Calculate an approximate 95% confidence interval for the population mean μ\mu. Give the endpoints correct to 2 decimal places.

Note

σ known or estimated by s?

If the population standard deviation σ\sigma is known (say from years of records for a machine), use it in place of ss: xˉ±zσn\bar{x} \pm z\frac{\sigma}{\sqrt{n}}. Usually σ\sigma is unknown and you estimate it with the sample standard deviation ss (the calculator's sxs_x, not σx\sigma_x). Both give approximate intervals when the population isn't normal, because they rely on the central limit theorem.

Which value of zz is used for an approximate 90% confidence interval for μ\mu?

Choose one answer

Common mistake

s is not the margin of error

The interval is xˉ±zsn\bar{x} \pm z\frac{s}{\sqrt{n}}, not xˉ±zs\bar{x} \pm zs. Forgetting the n\sqrt{n} gives an interval roughly n\sqrt{n} times too wide, and it describes individual values, not the mean (see the last lesson of this topic).

Exam tip

Show the substitution and interpret

Write the formula with numbers substituted, 34.2±1.96×9.65034.2 \pm 1.96 \times \frac{9.6}{\sqrt{50}}, then the interval, then a sentence in context: "We are 95% confident that the mean commute time of all Brisbane workers is between 31.54 and 36.86 minutes."

Summary

  • xˉ\bar{x} is a point estimate of μ\mu; a confidence interval is an interval estimate.

  • The approximate confidence interval for μ\mu is xˉ±zsn\bar{x} \pm z\frac{s}{\sqrt{n}}, for large nn.

  • z=1.645z = 1.645, 1.9601.960, 2.5762.576 for 90%, 95%, 99%; in general z=invNorm(1+C2)z = \text{invNorm}\left(\frac{1 + C}{2}\right).

  • Use σ\sigma in place of ss when it is known.

  • Interpret in context: "We are 95% confident that the mean … is between … and …".

Finished the lesson?

Try the 2 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 5 of 80% read

Save your progress with a free account