24 Median
Misasaka ny lalana!
Linguists estimate that there are over 7,000 languages in the world. At one end of the spectrum, approximately 1.18 billion people speak1 Mandarin Chinese and 609 million speak Hindi. At the other end, some languages have as few as one known speaker, such as Taushiro in Peru and Kaixana in Brazil.
On average, a language is spoken by roughly 1 million people, but this metric can be misleading. The standard deviation is approximately 17.5 million, reflecting extreme variability across the dataset2. By contrast, the median is approximately 8,000 speakers per language.
Which metric is more useful depends on the perspective being highlighted. An argument for language preservation might emphasize the median, noting that approximately 3,500 languages are spoken by fewer than 8,000 people. Conversely, an argument minimizing the urgency of language endangerment might cite the mean, pointing out that, on average, a language has many speakers.
A central conundrum is whether to use the mean or the median when comparing distributions (see also Chapter 23). There is no single correct choice; rather, understanding the existence and behavior of a metric should lead to a more informed decision.
Formal
In descriptive statistics, the median is determined by ordering the data values in non-decreasing order:
\[x_{(1)} \le x_{(2)} \le \dots \le x_{(n)}\]
If the sample size \(n\) is odd, the median is the value located exactly in the middle of the ordered observations. If \(n\) is even, the median is the arithmetic mean of the two central observations.
Formally, the sample median \(\tilde{x}\) is defined as:
\[ \tilde{x} = \begin{cases} x_{\left(\frac{n+1}{2}\right)} & \text{if } n \text{ is odd} \\[8pt] \frac{1}{2}\left(x_{\left(\frac{n}{2}\right)} + x_{\left(\frac{n}{2}+1\right)}\right) & \text{if } n \text{ is even} \end{cases} \]
Examples
The median, shown in bold, is identical for each of the following datasets:
- \(\{1, 1, \mathbf{3}, 3, 3\}\)
- \(\{1, 2, \mathbf{3}, 4, 5\}\)
- \(\{1, 3, \mathbf{3}, 10, 1000\}\)
- \(\{-100, 1, \mathbf{3}, 3, 5\}\)
- \(\{-1, -1, -1, -1, \mathbf{3}, 4, 5, 6, 101\}\)
For an even number of observations, the median is calculated as the average of the two middle values:
- \(\{1, 1, 3, 3\} \rightarrow \text{median} = \frac{1 + 3}{2} = 2\)
- \(\{1, 2, 3, 4\} \rightarrow \text{median} = \frac{2 + 3}{2} = 2.5\)
- \(\{1, 3, 3, 10\} \rightarrow \text{median} = \frac{3 + 3}{2} = 3\)
- \(\{-100, 1, 3, 3\} \rightarrow \text{median} = \frac{1 + 3}{2} = 2.0\)
The diffifult aspect of determining the median by hand is the tedious part of ordering the values.
Tips and warnings
The median is the primary measure of central tendency used in boxplots.
A major advantage of the median compared to the mean is its resistance to extreme values and outliers. Whether this property is desirable depends on the context.
If unsure, calculating both the mean and the median allows for an assessment of how much they diverge and how that difference might influence conclusions.
Part of learning statistics is understanding the behavior of various metrics. At this stage, three common measures of central tendency have been covered: the mean, the median, and the mode. More metrics to come!
The median is the 50th percentile, or 0.50 quantile (Chapter 25).
There is no convential notation for the median.