What is Median?
The median is the middle value in a sorted dataset. It divides the data into two equal halves and is less affected by extreme values (outliers) than the mean.
For odd count: Median = middle value
For even count: Median = average of two middle values
For even count: Median = average of two middle values
Example
Dataset: 3, 7, 1, 9, 4 โ Sorted: 1, 3, 4, 7, 9 โ Median = 4 (middle value)
Dataset: 2, 4, 6, 8 โ Median = (4 + 6) / 2 = 5 (average of two middles)
Median for Odd vs Even Count
Odd count (n=5): Median = value at position (n+1)/2 = 3rd value
Even count (n=6): Median = average of values at positions n/2 and n/2+1
Example odd: {3, 7, 12, 18, 25} โ Median = 12 (3rd value)
Example even: {4, 8, 11, 15, 20, 30} โ Median = (11+15)/2 = 13
Even count (n=6): Median = average of values at positions n/2 and n/2+1
Example odd: {3, 7, 12, 18, 25} โ Median = 12 (3rd value)
Example even: {4, 8, 11, 15, 20, 30} โ Median = (11+15)/2 = 13
Median vs Mean โ When They Differ
When mean and median are far apart, it signals a skewed distribution:
| Scenario | Mean | Median | Better Measure |
|---|---|---|---|
| Salaries: $30k,35k,32k,40k,$500k (CEO) | $127.4k | $35k | Median |
| Home prices with luxury mansion | Inflated | Typical | Median |
| Test scores (no outliers) | Fair | Fair | Either |
| Symmetric bell curve | = Median | = Mean | Either |
Quartiles and Percentiles
The median is the 50th percentile (Qโ). Quartiles divide sorted data into 4 equal parts:
Q1 (25th percentile) = median of lower half
Q2 (50th percentile) = median of whole dataset
Q3 (75th percentile) = median of upper half
IQR (Interquartile Range) = Q3 โ Q1
Q2 (50th percentile) = median of whole dataset
Q3 (75th percentile) = median of upper half
IQR (Interquartile Range) = Q3 โ Q1
Real-World Uses of Median
- Housing market: Median home price is the standard measure (not mean, which is skewed by mansions)
- Household income: Government statistics use median income to represent a "typical" household
- Medical research: Median survival time in clinical trials
- Education: Standardized test score percentiles (SAT, GRE)