# Thread: how to calculate median of grouped data if group size is variable

1. ## how to calculate median of grouped data if group size is variable

I learned in school that Median = L + (n/2-cf)*h/f
where L = lower limit of median class
n = no. of observations
cf = cumulative frequency of class preceding the median class,
f = frequency of median class,
h = class size (assuming class size to be equal).

I used to use this formula for grouped data of fix width like
marks ........ no. of student
0 - 10 .......... 5
10 - 20 ........... 3
20 - 30 ......... 4 and so on.
here grouped data is of fixed width 10=10-0=20-10=30-10 ans so on

BUT how will I calculate median if width is not fixed like

population ........ no. of town
5 - 10 ................. 500
10 - 20 ................. 100
20 - 50 .............. 50
50 - 100 ............. 30
100 - 200 ............. 20
200 - 500 ............... 10
500 - 1000 .................. 3
1000 and above ................. 2

how will I calculate median in this case

2. ## Re: how to calculate median of grouped data if group size is variable

Your formula remains valid for non-fixed-width classes. h just needs to be the size of the class containing the median.

3. ## Re: how to calculate median of grouped data if group size is variable

Originally Posted by jemidiah
Your formula remains valid for non-fixed-width classes. h just needs to be the size of the class containing the median.
Can i solve this way ????
We will start counting from both ends and find the place where both sums are as close to equal as possible. For example, in our second illustration, there are 500 in the first batch, which is more than all the others together, therefore the median is in the first batch.

I think it may work ..............

4. ## Re: how to calculate median of grouped data if group size is variable

There's some ambiguity in your description. Perhaps the best way to figure out which group the median lies in is probably to first add the frequencies to compute n (which you'll need to do anyway). Starting from the first group, successively add the group frequencies until you exceed n/2. The group which made you exceed n/2 contains the median.

Ex: given frequencies (in order) 5, 12, 3, 6, 9, 15, 25, we have n=75, so n/2 = 37.5. Successively adding frequencies from the left, we get 5, 5+12=17, 17+3=20, 20+6=26, 26+9=35, 35+15=50 > 37.5. Thus the median occurs in the second to last group, that of size 15.

5. ## Re: how to calculate median of grouped data if group size is variable

Originally Posted by jemidiah
There's some ambiguity in your description. Perhaps the best way to figure out which group the median lies in is probably to first add the frequencies to compute n (which you'll need to do anyway). Starting from the first group, successively add the group frequencies until you exceed n/2. The group which made you exceed n/2 contains the median.

Ex: given frequencies (in order) 5, 12, 3, 6, 9, 15, 25, we have n=75, so n/2 = 37.5. Successively adding frequencies from the left, we get 5, 5+12=17, 17+3=20, 20+6=26, 26+9=35, 35+15=50 > 37.5. Thus the median occurs in the second to last group, that of size 15.
Hello ,
I am using all the techniques requires to solve this and also what you have guided nut still i am not able to solve it till final solution.

6. ## Re: how to calculate median of grouped data if group size is variable

Ok.... Well, it should be quite obvious that the median occurs in the first group (which also follows from my median finding algorithm above). Then simply apply the formula L + (n/2-cf)*h/f where...
L = 5, n = 715, cf = 0, h = 5, f = 500
which gives 8.575. As a sanity check, since there are 715 people in the sample and 500 in this group, the median should be to the right of halfway through this group, which would be 7.5. And it is.

7. ## Re: how to calculate median of grouped data if group size is variable

Originally Posted by jemidiah
Ok.... Well, it should be quite obvious that the median occurs in the first group (which also follows from my median finding algorithm above). Then simply apply the formula L + (n/2-cf)*h/f where...
L = 5, n = 715, cf = 0, h = 5, f = 500
which gives 8.575. As a sanity check, since there are 715 people in the sample and 500 in this group, the median should be to the right of halfway through this group, which would be 7.5. And it is.
By the way which among the two methods is coreect .Does median fall in first intreval. Secondly how to find the mode.

8. ## Re: how to calculate median of grouped data if group size is variable

Originally Posted by jemidiah
Your formula remains valid for non-fixed-width classes. h just needs to be the size of the class containing the median.
Totally agree

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

Featured

Click Here to Expand Forum to Full Width

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.