The median is a value that splits the sorted series in two halves: at least half the values are the median, and at least half are it. In practice, sort the values;
- if is odd, the median is the middle value, in position ;
- if is even, take the midpoint of the two middle values, in positions and .
Examples
Example 8.6
Sorted series of house prices (in thousands): , , , , , , . The median is the th value, . The mean is — larger than of the prices! One extreme value () pulls the mean far more than the median: the median is robust, the mean is not.
Example 8.9
Take the sorted values
Median: position , so the median is . : , round up to ; the rd value is . : , round up to ; the th value is . Range: ; interquartile range: .
Example 8.10 (Comparing two groups)
Two classes take the same test (scores out of ):
| median | |||
|---|---|---|---|
| class A | |||
| class B |
Same median, very different spreads: class A is homogeneous (half its scores in ), class B is heterogeneous (its central half spans ). Indicators of center alone never tell the whole story.