Why the Median Requires an Order
A list of measurements can be summarized in several ways, but the median is defined by the observations’ order, not by their sum. To find it, first arrange the observations from least to greatest. If the number of observations is odd, exactly one observation occupies the middle position. Its value is the median.
For example, the ordered values \(3, 5, 8, 11, 14\) have a single middle value, \(8\). Two observations are below it and two are above it. The original order of the data does not matter; the ordered positions do.
To distinguish a position from a value, write the ordered observations as \(x_{(1)}, x_{(2)}, \ldots, x_{(n)}\). The parentheses in the subscript indicate an observation’s rank after sorting: \(x_{(1)}\) is the smallest value, and \(x_{(n)}\) is the largest. For odd \(n\), the median is \(x_{((n+1)/2)}\). The rank tells us where to look; the value at that rank is the answer.
Finding the Middle Position
An odd sample size can be written as \(n=2m+1\), where \(m\) is a whole number. There are \(m\) observations before the middle position and \(m\) after it. Therefore the middle position is \(m+1\). Since \(m=(n-1)/2\), this position can also be written as \((n+1)/2\).
This is a rank calculation, not an instruction to average values. For instance, if \(n=7\), then the median is at position \((7+1)/2=4\). The fourth ordered observation—not an average of two observations—is the median. The following steps apply the definition.
Let \(n\) be the number of recorded observations, counting each repeated value once for each occurrence.
Write them from least to greatest. Do not remove repeated values.
Find \((n+1)/2\). For an odd \(n\), this is a whole-number position.
That value, reported with its measurement units and context, is the median.
Worked Example: Finding the Median of Seven Measurements
A hypothetical group of seven parcels has recorded masses, in kilograms, of \(11, 7, 9, 13, 7, 10,\) and \(8\). Find the median mass.
First, count the observations: \(n=7\), which is odd. Sorting the values gives
The middle position is
The fourth ordered value is \(9\). Thus the median mass of these seven parcels is 9 kilograms. There are three recorded masses below 9 kilograms and three above it. The repeated value 7 is listed twice because two parcels had that mass.
Repeated Values and the Middle Rank
Repeated values do not create a special rule for finding an odd-sized median. Each occurrence remains a separate observation and occupies a position in the ordered list. A repeated value may appear on both sides of the middle rank, or the median itself may be part of a run of repeated values.
For example, the ordered list \(2, 4, 4, 4, 6\) has five observations. Its third observation is 4, so its median is 4. The fact that the value 4 appears three times does not change which position is the middle one. It simply means that several consecutive positions have the same value.
Worked Example: When the Median Is a Repeated Value
In a hypothetical set of five daily step counts, recorded in thousands of steps, the observations are \(6.2, 5.8, 6.2, 7.1,\) and \(6.0\). Find the median.
There are \(n=5\) observations. In order, with each daily count retained, they are
The middle rank is \((5+1)/2=3\). The value at position 3 is \(6.2\), so the median is 6.2 thousand steps per day. Here the same value also appears at position 4. That does not make the median ambiguous: position 3 is the middle rank, and its value is 6.2.
A value’s rank and its numerical size are different ideas. The middle observation need not be halfway between the smallest and largest values. In the ordered parcel data above, for instance, the endpoints are 7 and 13 kilograms, but the median is determined by the fourth position, not by calculating a midpoint between the endpoints.
Finding the Median from a Frequency Table
A frequency table reports how often each value occurs rather than listing every observation separately. The total number of observations is the sum of the frequencies. To find the median, identify the middle rank and determine which value occupies that rank in the implied ordered data. A cumulative frequency—the total frequency up to and including a value—helps locate that position.
Worked Example: Locating the Middle Observation in a Frequency Table
A hypothetical survey records the number of books read by each person in a group. The counts are summarized below. Find the median number of books.
| Books read | Frequency |
|---|---|
| 2 | 1 |
| 3 | 3 |
| 4 | 2 |
| 5 | 3 |
The total number of observations is
Since \(n=9\) is odd, the median rank is
In ordered form, the one observation with value 2 occupies position 1. The three observations with value 3 occupy positions 2 through 4. The two observations with value 4 occupy positions 5 and 6. Therefore the fifth observation is 4, and the median is 4 books.
The frequencies let us locate the value without writing out all nine observations. In cumulative terms, the total frequency through 3 is \(1+3=4\), and the total through 4 is \(1+3+2=6\). Since rank 5 is greater than 4 and no greater than 6, it falls among the observations with value 4.
Why the Definition Works
The median’s rank gives equal numbers of observations before and after it. To see why, write the odd sample size as \(n=2m+1\). The middle position is \(m+1\). Exactly \(m\) positions precede it, since the positions are \(1\) through \(m\), and exactly \(m\) positions follow it, since they run from \(m+2\) through \(2m+1\). Thus the observation at position \(m+1\) has the same number of observations on each side in the ordered list.
This argument concerns positions, so it remains true when values are tied. If several observations have the same value as the median, some observations on either side of the middle rank may have an equal value rather than a smaller or larger value. The median is still the value at the designated rank.
Common Mistakes
- Using the middle-looking value in the unsorted list. The original order has no statistical meaning for locating the median. Sort the observations first.
- Dropping repeated values. Repeats count as separate observations. Removing duplicates changes the sample size and can change the middle rank.
- Counting from zero. Positions in an ordered data list start at 1. For \(n=7\), the middle is position 4, not position 3.
- Averaging values for an odd sample size. The odd-sized median is the value at the single middle position. Do not average the values around it.
- Confusing a rank with a data value. The expression \((n+1)/2\) gives a position, such as position 4; it is not itself the median’s measurement.
A useful check is to count how many observations appear before and after the chosen position. For an odd number of observations, these counts should match. This check can reveal a sorting or counting error, though it does not replace reading the value at the correct rank.
Check Your Understanding
For each question, show the ordered values or explain how the middle rank is located.
- Find the median of \(12, 8, 10, 15, 9\). What is the middle position?
- A set has 11 observations. Which position contains its median, and how many observations are before and after that position?
- Find the median of \(3, 5, 5, 5, 8, 9, 10\). Explain why the repeated values must all be retained.
- A frequency table lists values 1, 2, and 3 with frequencies 2, 4, and 3, respectively. What is the total sample size, and what value is at the middle rank?
- Someone sorts seven measurements, removes one repeated value, and then selects the middle value of the shortened list. Identify the error and describe the correct method.