# Calculating mean age from grouped census data

I hope you can help me with a question regarding calculating mean age from grouped census data. If the age categories used were [0–4], [5–9], [10–14], and [15–19] years, how would you calculate the midpoints? I initially assumed the midpoints would be 2, 7, and so on.

However, I read in a worked example that the midpoint should be 2.5 when age range is 0 to 4. I am assuming this has something to do with the babies not actually being zero years, but I am not exactly sure why the midpoint would be 2.5.

Can anyone assist? Many thanks

As @Bernd has pointed out, 2.5 really is the midpoint of the 0 to 4 year age group, etc. However, using midpoints at either end of the population distribution introduces bias. For instance, the midpoint of the 80 - 90 year group is approximately 83, because most people in this group are nearer 80 than 90. If this nicety matters (and it perhaps it does, if you are agonizing over a half-year difference), read on.

Demographers make their estimates using various methods of monotonic interpolation. A classic method is Sprague's Formula. This is well described in their literature; for an overview see Hubert Vaughan, Symmetry in Central Polynomial Interpolation, JIA 80, 1954. This method as published requires equally-spaced age groups but it can be adapted to variable spacings. @Rob Hyndman was the co-author of a nice paper on monotonic splines (Smith, Hyndman, & Wood, Spline Interpolation for Demographic Variables: The Monotonicity Problem, J. Pop. Res. 21 #1, 2004). The paper mentions R code for the "Hyman filter." It is still available on Rob's Web site.

Once you have an interpolated age distribution you can compute moments (and any other properties) according to the standard definitions. For instance, the mean is estimated by numerically integrating the age with respect to the distribution.

• Okay thanks. In your opinion then, if someone identified 2 as the midpoint of the age range 0-4, is this answer completely wrong? Or is it the case that 2.5 is more accurate but 2 is a valid answer?
– Anne
May 6, 2011 at 20:18
• @Anne Using 2, 7, etc., is likely to be biased within most age groups, depending on the pattern of the age distribution in your population. This would result in a net bias of around -1/2 year in many calculations. In lots of applications that's an unimportant error; in other applications it might matter. It wouldn't change the estimated standard deviation at all. The biggest problem with using 2, 7, etc., is it indicates a lack of understanding of what the data mean, which would raise red flags in the mind of a critical reviewer of the work.
– whuber
May 6, 2011 at 20:25

The 0-4 years group refers to the following age interval: $0 \leq x < 5$, i.e. a child which is 4 years and 364 days old still belongs to this group. So, let's compute the midpoint for that range:

> ((365+365+365+365+364)/2)/365
 2.49863