Working out the average age of different sub-groups

59 Views Asked by At

I'm trying to create a program to find (an estimated) average age of users. Using data from groups. The problem is how to perform the maths, not the creation of a program to perform the maths. Here's what I know

I don't know the user's exact ages, just how many of them are in the group as a percentage of other groups.

My data:

[13-17] => 8.6%
[18-24] => 34.9%
[25-34] => 34.3%
[35-44] => 14.2%
[45-54] => 4.4%

I imagine we would base it off a mean such as:

[13-17] = 15

and transform the percentage of users to out of 1000

[13-17] = 86 users @ 15 years old

But then I don't know where to go from here to convert this data into an average. Any help and guidance to how this is performed rather than the answer is really appreciated

The data I have is:

86 users @ 15 years old
349 users @ 21 years old
343 users @ 30 years old
142 users @ 40 years old
44 users @ 50 years old

From this data how would I work out the average age for all the users?

1

There are 1 best solutions below

2
On BEST ANSWER

Here's how to find the average age of all users, using only your data in your last box.

  1. Convert the number of users in each age group to a percentage. You seem to be able to do this, so I won't show how it is done.
  2. Now "weigh" each age with the percentage, as such:

$$0.086\cdot15+0.349\cdot21+0.343\cdot30+0.142\cdot40+0.044\cdot50=26.789$$

This calculation is called the arithmetic mean (or just mean), and tells you the average (in the sense of the mean) age of your users.