Median

Statistics & Probability

The median is the middle value of a dataset when arranged in order, splitting the data into two equal halves.

Visualization

Definition

The median is the middle value when all the data is lined up in order from least to greatest: half the values are below it and half are above it. For an odd number of values $n$, it is the $((n+1)/2)$th ordered value; for an even number, it is the mean of the $(n/2)$th and $(n/2+1)$th ordered values, and it is resistant to outliers. Formally, the median is the $50$th percentile ($Q_2$) of the empirical distribution; as an estimator of population location, the sample median is consistent and approximately normally distributed with mean $\mu$ and variance $1/(4nf(\mu)^2)$ by the asymptotic theory of order statistics, where $f(\mu)$ is the pdf at the true median.

Example

Heights $58$, $60$, $62$, $65$, $70$ inches have median $62$ because it is in the middle; for an even number of values (e.g., $58$, $60$, $62$, $65$), the median is the average of the two middle values: $(60+62)/2 = 61$. Salaries (in thousands) of $40$, $45$, $48$, $52$, $55$, $60$, $500$ have mean $= 114.3$ but median $= 52$, which better represents the typical salary since the outlier ($500$) does not affect it. For normal data, the asymptotic relative efficiency (ARE) of the median relative to the mean is $2/\pi$, approximately $0.637$, meaning the median requires about $57\%$ more data to achieve the same precision as the mean when normality holds.

Key Insight

The median is not fooled by extremely large or small values, which is why it is often reported for housing prices and incomes, where a few very high values would skew the mean; it also minimizes the sum of absolute deviations, $\sum |x_i - c|$ is minimized when $c = \text{median}$, connecting it to L1 optimization and robust statistics. In heavy-tailed distributions (e.g., Cauchy, where the mean does not exist), the median is the preferred measure of location, and robust statistics builds on this: estimators like the Huber M-estimator interpolate between mean and median behavior.