How to construct a confidence interval for a mean

A confidence interval for a population mean provides a range of values that is likely to contain the true population mean. It applies when you have a simple random sample and either the population is normally distributed or the sample size is large enough (n30n \ge 30) for the Central Limit Theorem to apply.

The setup

Identify the sample mean xˉ\bar{x}, the sample size nn, and the desired confidence level CC. Determine whether the population standard deviation σ\sigma is known. If σ\sigma is known, you will use the standard normal distribution (zz). If σ\sigma is unknown, use the sample standard deviation ss and the Student's t-distribution (tt) with degrees of freedom df=n1df = n - 1.

The steps

  1. Find the critical value. For a known σ\sigma, find zz^* corresponding to the middle CC area of the standard normal distribution. For an unknown σ\sigma, find tt^* for the middle CC area with df=n1df = n - 1.
  2. Calculate the Standard Error (SE). SE=σnSE = \frac{\sigma}{\sqrt{n}} or SE=snSE = \frac{s}{\sqrt{n}}.
  3. Calculate the Margin of Error (ME). ME=extcriticalvalueimesSEME = ext{critical value} imes SE.
  4. Construct the interval. Subtract and add the ME to the sample mean: (xˉME,xˉ+ME)(\bar{x} - ME, \bar{x} + ME).

Checking the result

Verify that the sample mean xˉ\bar{x} is exactly in the center of the calculated interval. The distance from the lower bound to xˉ\bar{x} must equal the distance from xˉ\bar{x} to the upper bound. Increasing the confidence level or decreasing the sample size should result in a wider interval.

Common errors

A frequent error is using a zz-score instead of a tt-score when the population standard deviation σ\sigma is unknown. Always use the tt-distribution if you computed the standard deviation from the sample data. Another error is dividing by nn instead of n\sqrt{n} when calculating the Standard Error.

Worked example

A random sample of 36 apples yields a sample mean weight of 150 grams and a sample standard deviation of 12 grams. Construct a 95% confidence interval for the true mean weight of the apples.

  1. Identify parameters: xˉ=150\bar{x} = 150, s=12s = 12, n=36n = 36, C=0.95C = 0.95.
  2. Since σ\sigma is unknown, use the t-distribution. df=n1=35df = n - 1 = 35.
  3. Find the critical value tt^* for 95% confidence and df=35df = 35. Using a t-table, t2.030t^* \approx 2.030.
  4. Calculate the Standard Error: SE=sn=1236=126=2SE = \frac{s}{\sqrt{n}} = \frac{12}{\sqrt{36}} = \frac{12}{6} = 2.
  5. Calculate the Margin of Error: ME=timesSE=2.030imes2=4.06ME = t^* imes SE = 2.030 imes 2 = 4.06.
  6. Construct the interval: (xˉME,xˉ+ME)=(1504.06,150+4.06)=(145.94,154.06)(\bar{x} - ME, \bar{x} + ME) = (150 - 4.06, 150 + 4.06) = (145.94, 154.06).

The 95% confidence interval is (145.94,154.06)(145.94, 154.06) grams.

FAQ

Run your own problem

References: OpenStax Introductory Statistics, Chapter 8: Confidence Intervals · Mathematical Statistics with Applications by Wackerly, Mendenhall, and Scheaffer

See also