9.8 The median
Definition 9.32. The median is the middle value when the observations are arranged in order. If there is an even number of them, it is the mean of the two middle values.
Example 9.33. Find the median of (a) \(7,\ 2,\ 9,\ 4,\ 11,\ 3,\ 8,\ 5,\ 6\) and (b) \(14,\ 8,\ 3,\ 21,\ 9,\ 17,\ 5,\ 12,\ 8,\ 20\).
Solution. (a) Arrange in increasing order: \[2,\ 3,\ 4,\ 5,\ \mathbf {6},\ 7,\ 8,\ 9,\ 11.\] There are \(9\) values, so the middle one is the \(5\)th: \[\text {median}=6.\]
(b) In order: \[3,\ 5,\ 8,\ 8,\ \mathbf {9},\ \mathbf {12},\ 14,\ 17,\ 20,\ 21.\] There are \(10\) values, so the middle two are the \(5\)th and \(6\)th: \[\text {median}=\frac {9+12}{2}=10.5.\]
Note 9.34. Sorting first is not optional. Taking the middle item of the unsorted list in (a) gives \(11\), which is the largest value in the set.
9.8.1 Median for grouped data
Definition 9.35. For grouped data, \[\text {median}=L_1+\left (\frac {\frac {1}{2}N-\left (\sum f\right )_1}{f_{\text {median}}}\right )c,\] where \(L_1\) is the lower boundary of the class containing the median, \(N\) is the total frequency, \(\left (\sum f\right )_1\) is the sum of the frequencies of all classes below the median class, \(f_{\text {median}}\) is the frequency of the median class, and \(c\) is its width.
Note 9.36. The formula assumes the observations are spread evenly across the median class, and steps the required fraction of the way into it. The classes need not all be the same width; only the width \(c\) of the median class enters.
Solution. Step 1 — build the cumulative frequency column and locate the median class.
| Earnings (K) | \(f\) | Cumulative frequency |
| 1 – 20 | 6 | 6 |
| 21 – 40 | 11 | 17 |
| 41 – 60 | 20 | 37 |
| 61 – 80 | 15 | 52 |
| 81 – 100 | 8 | 60 |
Half the total is \(\frac {1}{2}(60)=30\). The cumulative frequency reaches \(17\) at the end of the class \(21\)–\(40\) and \(37\) at the end of \(41\)–\(60\), so the \(30\)th value lies in \(41\)–\(60\). That is the median class.
Step 2 — identify the quantities. The earnings are recorded to the nearest kwacha, so the class \(41\)–\(60\) has boundaries \(40.5\) and \(60.5\): \[L_1=40.5,\qquad N=60,\qquad \left (\sum f\right )_1=17,\qquad f_{\text {median}}=20, \qquad c=60.5-40.5=20.\]
Step 3 — substitute. \[\text {median}=40.5+\left (\frac {30-17}{20}\right )20=40.5+\frac {13}{20}\times 20 =40.5+13=53.5.\]
\[\therefore \quad \text {median daily earning}=\text {K}53.50.\]
This says that half the traders earn less than about K53.50 a day and half earn more.
Note 9.38. Use the class boundary \(40.5\) for \(L_1\), not the limit \(41\). Using \(41\) shifts the answer by half a unit, and the same care applies to \(c\).
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.