Finding mean when class sizes are unequal

A class teacher has the following absentee record of students:

No. of days         0-6    6-10  10-14   14-20   20-28   28-30  38- 40
No. of students      11     10      7      4        4      3      1


What will be the mean no. of days a student was absent? I am unable to understand since the class sizes are different.

Update

In both the first 2 answers, the authors have assumed symmetry in the class, and thus they are taking the means and are finding the final "weighted mean" (if the term is wrong kindly correct me). However, suppose this assumption is not valid, then what is the best approach to solve this problem?

• You could assume that the distribution of the number of days absent within each class is symmetric about the midpoint of the class. Then the mean number of days a student was absent would just be a weighted average of the midpoints of the classes. – Max Nov 3 '12 at 9:19
• It looks as if you are supposed to assume this is a continuous variable, but in practice absentee records tend to be discrete: which group would someone absent for 6 days be in? – Henry Nov 3 '12 at 10:13
• Second last class interval is 28-30 & last is 38-40. It is not continuous. – Abhi Feb 15 '18 at 12:23

Number of students:

11+10+7+4+4+3+1 = 21+11+8 = 40


Total number of absent days across all students:

 (0+6)/2*11+(6+10)/2*10+(10+14)/2*7+(14+20)/2*4+
(20+28)/2*4+(28+30)/2*3+(38+40)/2*1 = 487


Mean number of absent days per student:

(Total number of absent days) / ( Number of students) = 487 / 40 = 12.175


Hence the mean number of absent days per student is approximately 12.

But as Henry pointed out: Your groups are overlapping, that is: It is not clear to which group a student belongs, who has 6 absent day or 10 absent days. As Max said, we are assuming that that the distribution of the number of days absent within each class is symmetric about the midpoint of the class. This means for example, that in the class

6-10


where there are 10 students, it is expected, that each one of those students has

(6+10)/2 = 8


absent days

• Thanks for you contribution here. In the future, please make sure to review our FAQ and pay a particular attention to how homework questions should be handled. – chl Nov 3 '12 at 21:45

The point of this question is to show that not all means need to be evenly weighted to be summed. It may lose some granularity in the final answer, but the estimate still holds true. In some ways, you can think of it as a mean of means.

So the theory is:

class mean = sum(mean(range_of_days_absent) * number_of_students_for_that_day_range) ) /
total_number_of_students


To start the example:

mean of group 1 = mean(0-6) = 3
mean of group 2 = mean(6-10) = 8
etc...

number of students in group 1 = 11
number of students in group 2 = 10
etc...


so to solve you do:

answer = (3) * (11) + (8) * (10) ...  / the_total_number_of_students


which becomes:

(3*11 + 8*10 + 12*7 + 17*4 + 24*4 + 29*3 + 39*1) / 40 = 487 / 40 = 12.175 days


Update

While technically a mean is just a 'weighted' median - here's an alternative approach - Each student falls in a category, and you are finding the best category.

e.g. day range 0-6 is Labeled Group A, day range 6-10 is Labeled Group B...

Using this approach, you essentially find the median student
11*A + 10*B + 7*C + 4*D + 4*E + 3*F + 1*G

The median group is group B, which is 6-10 days and the mean/median number of days in group B, is 8 days.


Notice how in this approach, the long tail of including group F and G, is disregarded, and the expected mean goes from ~12 to 8 days.

• How is your approach different from Orges' answer? Also the what if the assumption is not valid; plz see my update. – gpuguy Nov 3 '12 at 15:21
• The method is virtually the same actually. With respect 'weighting', you are right, the term is confusing. I've added an update to address your updated question. – Fridiculous Nov 3 '12 at 19:54
• How did you find that the median group is group B? Should it not be the group D (14-20)? – gpuguy Nov 5 '12 at 6:56
• Think of it like this: The median of A, B, C, D, E, F, G is D. The median of A, A, A, A, A, A, A, A, A, A, A, B, B, B, B, B, B, B, B, B, B, C, C, C, C, C, C, C, D, D, D, D, E, E, E, E, F, F, F, G is B. – Fridiculous Nov 6 '12 at 0:38

The method used will be the same as used for continuous grouped data with equal intervals. First of all we will find the class marks of each interval with equal to lower limit + upper limit divided by 2. Then we will multiply the frequencies with their respective class marks. Will will add all these products and divide them by the total frequency. We get the mean.

The overlap of classes in your example is a bit confusing, so I'll use some slightly modified values

No. of days         0-5    6-9  10-13   14-19   20-27   28-30  38- 40
No. of students      11     10      7       4       4       3       1


An approximation to the problem, not assuming symmetry within the classes as you put it, would be that the days absent follows a geometric distribution:

$$P(X=k) = (1-p)^{k}p$$

As a first approximation we'll assume that each value in a class occur with the same probability. E.g. 0 absent days is observed $\tfrac{11}{6}$ times.

The maximum likelihood estimate of $p$ is

$$\hat p = \frac{n}{n+\sum_{i=1}^n k_i} \\ = \frac{40}{40+0\cdot \tfrac{11}{6}+1\cdot\tfrac{11}{6}+\ldots+39\cdot\tfrac{1}{3}+40\cdot\tfrac{1}{3}} \\ = 0.0786$$ Using this value of $p$ we can now go back and correct for our assumption that each value in a class occurs with the same probability. For the $0-5$ class we have that $$P(X=0)=(1-p)^0p=0.0786 \\ P(X=1)=(1-p)^1p = 0.0724 \\ P(X=2)=0.0667 \\ P(X=3)=0.0615 \\ P(X=4)=0.0566 \\ P(X)=5)=0.0522 \\$$ Since the total number of observations in that class is 11, we get the expected number of observations for $k=0$ is:

$$11\cdot \frac{0.0786}{0.0786+0.0724+0.0667+0.0615+0.0566+0.0522} = 2.228$$

and for $k=\{1,2,3,4,5\}$ the expected mean is found to be $\{2.053, 1.891, 1.743, 1.606, 1.48\}$. And similar for the rest of the classes. If we then update our maximum likelihood estimate of $p$, we get that $\hat p = 0.0797$. This can be repeated until convergence. Once the converged value of $p$ has been obtained we can get the mean of the geometric distribution as

$$\frac{1}{p}-1$$