← Glossaryinterquartile range (IQR)
Q3 minus Q1: the spread of the middle 50% of the data; robust to outliers.
Learn it in the course
- Measures of spread: range, SD and quartiles · Two couriers with the same average delivery time, and why only one keeps the promise: measures of spread from range and variance to standard deviation (calculated step by step), quartiles, IQR and the coefficient of variation.
The interquartile range (IQR) is the width of the middle half of the data: the third quartile minus the first.
IQR=Q3−Q1
Q1 is the value with a quarter of the data below it (the 25th percentile) and Q3 the value with three quarters below it (the 75th). A simple way to find them by hand: sort the data and split it at the median; Q1 is then the median of the lower half and Q3 the median of the upper half. Spreadsheet functions such as QUARTILE.INC interpolate between neighbouring values instead, so on small datasets they can give slightly different numbers. Either is fine, as long as you use the same method whenever you compare groups.
Because it ignores the top and bottom quarters entirely, the IQR is robust: one lost parcel or one bulk order doesn't change it at all. That makes it the natural partner of the median for skewed product data, just as the standard deviation is the partner of the mean. "Median 7.5 minutes, middle half between 5.5 and 11" tells a stakeholder more than a mean and SD that one extreme value has inflated.
The IQR is also the backbone of the box plot. The box runs from Q1 to Q3, the line inside it marks the median, and the whiskers reach to the most extreme values still within 1.5⋅IQR of the box. Anything beyond these fences is drawn as a separate dot, a potential outlier:
Q1−1.5⋅IQRandQ3+1.5⋅IQR
This rule, proposed by the statistician John Tukey, is the most common everyday way to flag unusual values.
First-response times in CatChow's support chat for 12 tickets, in minutes, sorted: 3, 4, 5, 6, 6, 7, 8, 9, 10, 12, 15, 42.
- Median: n=12 is even, so it is (7+8)/2=7.5 minutes.
- Lower half: 3, 4, 5, 6, 6, 7, so Q1=(5+6)/2=5.5.
- Upper half: 8, 9, 10, 12, 15, 42, so Q3=(10+12)/2=11.
- IQR=11−5.5=5.5 minutes: the middle half of customers waited between 5.5 and 11 minutes.
Fences: 5.5−1.5×5.5=−2.75 (no ticket can be below) and 11+1.5×5.5=19.25. The 42-minute ticket is outside, so on a box plot it shows up as a separate dot, worth opening to see what happened: a message sent at night, a missed notification?
For comparison, the mean is 127/12≈10.58 minutes and the SD about 10.47, both pulled up by that single ticket. The median and IQR describe the typical experience; the 42 deserves its own look. QUARTILE.INC in a spreadsheet gives Q1=5.75 and Q3=10.5, so an IQR of 4.75 and an upper fence of 17.625: slightly different numbers, same conclusion.