[Math] Median value resulting in negative number

data analysismedianprobability theorystatistics

I know the that the formula for finding the median of grouped data that is:

$$\mathrm{Median} = L_m + \left [ \frac { \frac{n}{2} – F_{m-1} }{f_m} \right ] \times c$$

And I also know what the letters stand for. So I decided to create some mock data:

 x             f.             cf.

 1-5           100            100
 6-10          340            440
 11-15         10             450
 16-20         34             484
 21-25         12             496

And tried to find the median value :

$$\mathrm{Median} = 11 + \left [ \frac { \frac{25}{2} – 440 }{10} \right ] \times 5$$

According to this formula, my median value is coming to -202.75, which looks pretty wrong. What am I missing here?

Best Answer

$$ \mathrm{Median} = L_m + \frac{n/2 -cf_b}{f_m}*w $$

here $L_m$ = median group where the median lies in

$n$ = total number of data

$cf_b$ = culm. freq before the median group

$f_m$ = frequency of median group

$w$ = width of groups

So for your problem:

$L_m$ = (6)-10,$n$ = 496, $cf_b$ = 100, $f_m$ = 340 and $w$ = 5

This leads to:

$$ \mathrm{Median} = 6 + \frac{496/2-100}{340}5 = 6 + \frac{148*5}{340} = 6 + 2.176 \approx 8.18 $$

So the error was choosing the right numbers for the formula, especially where the median lies.