Quartiles, IQR, and the box plot
◈ 6 cardsMedian-of-halves quartiles, the five-number summary, the 1.5·IQR fences, and what to do with a value beyond them.
Position, not distance
The standard deviation measures spread as a distance from the mean. The quartiles measure it by position: has a quarter of the sorted data below it, the median half, three-quarters. The interquartile range is the width of the middle half, and it is untouched by whatever is happening in the tails — which is why it is the spread to report beside a median.
The course rule for quartiles is median-of-halves. Sort. Find the median. is the median of the lower half and the median of the upper half; when is odd, the median itself belongs to neither half. Software uses other rules (L3.7); on the paper, this one.
Worked example — eleven overdue invoices
Maple Ledger now has eleven overdue invoices. Sorted days overdue: 1, 2, 4, 5, 7, 8, 10, 12, 15, 19, 41.
- , median position : median = 8.
- Lower half, excluding the 8: 1, 2, 4, 5, 7 → .
- Upper half: 10, 12, 15, 19, 41 → .
- .
Five-number summary: min 1 · 4 · median 8 · 15 · max 41. A box plot draws the box from to with a line at the median, and whiskers out to the most extreme values that are not flagged by the fences.
Fences. Lower fence ; upper fence . The 41 is beyond the upper fence: a potential outlier, drawn as a separate point, with the whisker stopping at 19.
What to do with the 41
Investigate it. Is it a data-entry error (411 days? 4.1?), a disputed account, a genuine long-overdue invoice? If it is an error, correct it. If it is genuine, it stays in the data — and the report says so, giving the summary with and without it when the two differ materially. Deleting a true value because it is inconvenient is the one thing never to do.
The even case
With there is no middle value to exclude: the lower half is simply the five smallest values and the upper half the five largest. For 6, 9, 11, 14, 16, 18, 19, 20, 24, 27: lower half 6, 9, 11, 14, 16 → ; upper half 18, 19, 20, 24, 27 → ; median .
The box plot is the paper's tool for comparing groups: two boxes side by side show at a glance which branch has the higher median, the wider middle half, and the longer tail. It cannot show modality — a bimodal histogram and a unimodal one can produce the same box.