MerQuR+Statistics Glossary

Statistics Glossary → Interquartile range (IQR) and Tukey fences

Interquartile range (IQR) and Tukey fencesconcept

The width of the middle half of the data (IQR = Q3 − Q1) and the Tukey fences that use this width to draw an outlier boundary.

The interquartile range is the difference between the first quartile (Q1, 25%) and the third quartile (Q3, 75%) and shows the range covered by the middle 50% of the observations. Because extreme values do not affect it, it is a more robust measure of spread than the standard deviation for skewed distributions. There are several definitions of quartiles (the Hyndman-Fan types), which explains small differences between programs in small samples.

The Tukey fences are Q1 − k·IQR and Q3 + k·IQR; observations outside them are flagged as possible outliers. Box plots usually use k = 1.5, while k = 3 marks 'far out' values. The fences do not prove that a value is an outlier; they only point to observations worth checking, and in very skewed distributions some perfectly genuine values can fall outside them.

An everyday example

In the monthly electricity bills of 20 houses on a street, Q1 = 400 and Q3 = 600, so the IQR is 200. With k = 1.5 the fences are 400 − 300 = 100 and 600 + 300 = 900. A bill of 1500 lies well outside the fence and deserves a look: perhaps the house runs an electric heater, or perhaps the meter was misread.

In MerQur

In Descriptive Statistics as a measure of spread; in Anomaly Detection the 'IQR multiplier (k)' sets the fences Q1 − k·IQR and Q3 + k·IQR, and in the time-series method they are applied to the STL residuals.

Analyses where this concept appears

Descriptive StatisticsAnomaly Detection

Related concepts

Box plotOutlierPercentiles (quantiles) and percentile definitions