The median is the middle value in a sorted data set, and it's often a better summary than the average (mean) when a data set has outliers that would otherwise skew the mean up or down.
How the median is found
For 3, 4, 7, 9, 12, 15, 21 (7 values, odd count): the middle value is 9. For an even count like 3, 4, 7, 9, 12, 15: the median is the average of 7 and 9, which is 8.
Median vs. mean: when to use which
| Situation | Better summary statistic |
|---|---|
| Household income data (often has extreme high outliers) | Median |
| Evenly distributed exam scores | Mean |
| Home prices in a neighborhood with a few mansions | Median |
Income and home price statistics are commonly reported as medians precisely because a small number of very high values can pull the mean up substantially, making it a less representative "typical" figure than the median.
Common mistakes
- Forgetting to sort first. The median only makes sense after the data is ordered — picking the middle value from an unsorted list gives a meaningless result.
- Miscounting for even-sized data sets. With an even number of values, the median is the average of the two middle numbers, not either one alone.
Frequently asked questions
How do I find the median of a data set?
Sort the values from smallest to largest. If there's an odd number of values, the median is the middle one; if even, it's the average of the two middle values.
Why is median sometimes preferred over the average?
The median is less affected by extreme outliers than the mean, making it a more representative 'typical' value for data sets like income or home prices that can include a few very high values.
What if my data set has repeated values?
Repeated values are included in the sort as normal; the median calculation works the same way regardless of duplicates.