# How to calculate confidence interval of the mean age of a sample?

How do I establish the +/- in terms of a set of mean ages. My mean age is 27.2. The ages are 20 23 24 43 22 26 18 32 18 41 22 20 26 46 21 27 19 19 39 40 19 39 18 38 24 24 23 30.

Thank you.

-
Does your data constitute a sample, or is it the entire population? How big is the population, if so? –  Andrew Mar 9 '11 at 20:42

• Obtain the five-number summary for your sample.
• Calculate the standard error for your sample.
• Select a level of confidence, based on the z-score.
• Calculate the lower and upper bound of the interval.

If you are doing this by hand, use the formulae provided by any statistics handbook, such as Agresti and Finlay's Statistics for the Social Sciences, to move through each stage. If you are using a computer solution such as R or Stata:

• Obs = 28, Mean = 27.17, Std. Dev. = 8.82 (su age in Stata)
• Std. Err. = 1.66 (ci age in Stata)
• z = 1.96 at 95% confidence, z = 2.58 at 99% confidence (level(95) or level(99) in Stata)
• 95% CI = [23.75, 30.60] and 99% CI = [22.55, 31.80] (truncated to two digits)

To me, the key element of learning that you should get from this exercise is that the standard error will decrease with the square root of the sample size. The only way to avoid having to trade off precision against efficiency is to maximise sample size.

Agresti and Finlay cover this in detail in Chapter 5 of their handbook, starting at page 126. Previous chapters provide the formulae for calculating the mean, variance, square root of variance (standard deviation) and standard error of the mean (SEM).

If you were dealing with proportions, you would be calculating the standard error slightly differently, but the underlying logic would remain: √N, the square root of the sample size, would stay critical in minimising the standard error.

-