Median: Definition, Calculation, and When to Use It
What is the median?
The median is the middle value in a list of numbers sorted from smallest to largest (or largest to smallest). It marks the point where 50% of observations lie below and 50% lie above. Because it depends only on the order of values, the median is less sensitive to outliers than the mean (average).
Why the median matters
- It provides a robust measure of central tendency when data include extreme values or are skewed.
- Commonly used in economics (e.g., median household income) and other fields where a typical value is needed without distortion from extremes.
- Serves as the center line for quartiles and many summary statistics.
How to calculate the median
- Sort the data in ascending (or descending) order.
- If the number of observations (n) is odd: median = the value at position (n + 1) / 2.
- If n is even: median = average of the two middle values at positions n/2 and (n/2) + 1.
Examples:
- Odd count: For 3, 13, 2, 34, 11, 26, 47 → sorted = 2, 3, 11, 13, 26, 34, 47. n = 7, median position = (7 + 1)/2 = 4 → median = 13.
- Even count: For 3, 13, 2, 34, 11, 17, 27, 47 → sorted = 2, 3, 11, 13, 17, 27, 34, 47. n = 8 → middle values = 13 and 17 → median = (13 + 17) / 2 = 15.
Quick step-by-step:
- Sort values.
- Find middle position(s).
- Take the middle value (odd n) or average the two middle values (even n).
Median vs. mean
- Mean (arithmetic average): sum of values divided by number of values.
- Median: middle value in ordered list.
Example showing difference:
Dataset: 3, 5, 7, 19
- Mean = (3 + 5 + 7 + 19) / 4 = 34 / 4 = 8.5
- Median = average of middle two values (5 and 7) = (5 + 7) / 2 = 6
When data are skewed or include outliers, the mean can be pulled toward the extremes while the median remains near the center of the bulk of observations.
Example with skew/outliers:
0, 0, 0, 1, 1, 2, 10, 10
- Mean = 24 / 8 = 3
- Median = average of 4th and 5th values = (1 + 1) / 2 = 1
Here the median better reflects the typical value.
Median in distributions
- In a perfectly symmetric (normal) distribution, mean = median = mode and they coincide at the center of the bell curve.
- In skewed distributions, the median and mean differ; the median indicates the central position of the population while the mean indicates the arithmetic center.
Relation to quartiles and other partitions
- The median is the second quartile (Q2), dividing data into lower and upper halves.
- Other partitions include quartiles (4 parts), quintiles (5 parts), and deciles (10 parts).
Key takeaways
- The median is the middle value of an ordered dataset and is robust to outliers.
- Use the median when you need a typical value unaffected by extreme observations.
- For odd n, pick the center value; for even n, average the two center values.
- In symmetric distributions mean = median; in skewed distributions they differ.
References
- Purdue Online Writing Lab — Descriptive Statistics
- University of Illinois — Quartiles and Box Plots
- National Cancer Institute — Normal Distribution