The formula
IQR = Q3 − Q1 · an outlier falls outside Q1 − 1.5·IQR and Q3 + 1.5·IQR
What it means
The interquartile range is the distance between the third quartile and the first, that is, the width of the middle half of the data. It is a measure of spread that, unlike standard deviation, is unmoved by one absurd value: whether the maximum is a hundred or a million, the quartiles do not shift. That insensitivity is exactly what makes it useful for spotting those absurd values in the first place.
How to work it out by hand
- Sort the values and work out the first and third quartiles
- Subtract: IQR = Q3 − Q1
- Work out the fences: Q1 − 1.5 × IQR and Q3 + 1.5 × IQR
- Anything outside those two fences is an outlier
What is worth knowing
The 1.5 in the rule follows from nothing: John Tukey picked it because in a normal distribution it leaves out roughly 0.7 % of the data, which struck him as a reasonable threshold. It is a useful convention, not a test: an outlier may be a measurement error, a rare but real case, or a sign that the data are not normal. Flagging one means you have to look at it, not delete it, and deleting data on this rule alone is one of the commonest ways to fake an analysis.