Interquartile Range

Statistics & Probability

The interquartile range (IQR) is the difference between the third and first quartiles, measuring the spread of the middle 50% of a dataset.

Formula

\text{IQR} = Q_3 - Q_1
Visualization

Definition

The interquartile range (IQR) measures the spread of the middle half of a dataset: it is the distance between the 25th percentile and the 75th percentile, $\text{IQR} = Q_3 - Q_1$. It is a robust measure of variability, unaffected by outliers, used in box plots and the standard outlier detection rule: values below $Q_1 - 1.5 \cdot \text{IQR}$ or above $Q_3 + 1.5 \cdot \text{IQR}$ are flagged as outliers. Formally, $\text{IQR} = F^{-1}(0.75) - F^{-1}(0.25)$, where $F^{-1}$ is the quantile function; for a normal distribution, $\text{IQR} = 2(0.6745)\sigma$, approximately $1.35\sigma$, allowing estimation of $\sigma$ from the IQR: $\hat{\sigma} = \text{IQR}/1.35$, the basis of a robust scale estimator.

Example

Test scores ordered $60$, $65$, $70$, $75$, $80$, $85$, $90$, $95$ give $Q_1 = 67.5$, $Q_3 = 87.5$, so $\text{IQR} = 87.5 - 67.5 = 20$: the middle $50\%$ of scores span $20$ points. Housing prices with $Q_1 = \$180K$ and $Q_3 = \$340K$ give $\text{IQR} = \$160K$, with outlier fences at lower $= 180-240 = -\$60K$ (no lower outlier possible) and upper $= 340+240 = \$580K$, so any home above $\$580K$ is an outlier. The normalized IQR ($NIQR = \text{IQR}/1.35$) is a robust estimator of $\sigma$ with $15\%$ asymptotic efficiency relative to $s$ for normal data but outperforms $s$ for heavy-tailed distributions; the MAD (median absolute deviation) is an even more robust alternative.

Key Insight

The IQR is like the range but ignores the extremes, measuring only the spread of the middle half so outliers do not affect it; it is to the range what the median is to the mean, both robust alternatives that resist distortion by extreme values. Rousseeuw and Croux (1993) proposed $S_n = 1.1926 \cdot \text{median}_i(\text{median}_j(|x_i-x_j|))$ as a highly robust scale estimator with $58\%$ efficiency for normal data, extending the IQR's robustness properties while improving efficiency.