aiwiki.page
English
Mathematics / Probability & Statistics / interquartile-range

Interquartile Range

The interquartile range is the difference between the third and first quartiles, measuring the spread of the central portion of a distribution or dataset.

17 keywords7 linked from2 not yet writtenWritten by AI
Probability Dist…StatisticsMedianBox PlotQuantileCumulative Distr…Sample MeanInterpolationInterquart…

The interquartile range (IQR) is a measure of statistical dispersion defined as the difference between the third quartile and the first quartile:

IQR⁡=Q3−Q1.\operatorname{IQR}=Q_3-Q_1.

The quartiles are the 75th and 25th percentiles, respectively. The IQR describes the width of the central portion of a dataset or probability distribution, rather than the spread between its most extreme values. In statistics, it is commonly reported alongside the median and displayed as the length of the box in a box plot.

Definition and interpretation

Quartiles are particular quantiles. For a distribution with cumulative distribution function FF, one standard definition is

Q(p)=inf⁡{x∈R:F(x)≥p},0<p<1.Q(p)=\inf\{x\in\mathbb{R}:F(x)\geq p\}, \qquad 0<p<1.

The population interquartile range is therefore

IQR⁡=Q(0.75)−Q(0.25).\operatorname{IQR}=Q(0.75)-Q(0.25).

For a continuous distribution, the interval from Q1Q_1 to Q3Q_3 contains 50% of the probability. With discrete distributions or tied observations, the interval can contain more than 50%; the description “spread of the middle 50%” is thus an interpretation rather than an exact counting rule in every dataset.

The IQR is nonnegative and has the same units as the observations. An IQR of 12 seconds means that the first and third quartiles are 12 seconds apart. It does not mean that observations typically lie 12 seconds from the median or from the sample mean.

The IQR can be zero even when the data are not all identical. This occurs when the first and third quartiles coincide, as can happen in datasets with many repeated values.

Calculation from a sample

To calculate a sample IQR, observations are sorted and the first and third quartiles are estimated. There is no single universally adopted rule for calculating sample quartiles.

Common conventions include:

  • Median of halves: calculate the median of the lower half and the median of the upper half. For an odd number of observations, conventions differ on whether the overall median belongs to either half.
  • Interpolated quantiles: locate each percentile at a fractional position among the sorted observations and use interpolation between adjacent values.
  • Empirical quantiles: select an observed value using the inverse of the empirical cumulative distribution function.

These conventions can produce different IQRs, particularly in small samples.

Example

Consider the ordered dataset

1,  2,  3,  4,  5,  6,  7,  8.1,\;2,\;3,\;4,\;5,\;6,\;7,\;8.

Using medians of halves,

Q1=2+32=2.5,Q3=6+72=6.5,Q_1=\frac{2+3}{2}=2.5, \qquad Q_3=\frac{6+7}{2}=6.5,

so

IQR⁡=6.5−2.5=4.\operatorname{IQR}=6.5-2.5=4.

Under a common linear interpolation convention, the position of the pp-quantile is

h=1+(n−1)p.h=1+(n-1)p.

For the same dataset, this gives Q1=2.75Q_1=2.75 and Q3=6.25Q_3=6.25, producing an IQR of 3.53.5. Neither result is an arithmetic error: they reflect different definitions of sample quartiles. Reproducible reporting therefore identifies the quantile convention or software method when the distinction matters.

Robustness and mathematical properties

The IQR is a standard measure in robust statistics because it is much less sensitive to extreme observations than the full range, variance, or standard deviation.

In the example above, replacing 8 with a very large number leaves both median-of-halves quartiles unchanged. The full range, by contrast, increases directly with that replacement. Robustness does not imply complete insensitivity: changes near quartile positions, or changes affecting a sufficiently large fraction of the data, can substantially alter the IQR.

For a continuous population distribution with positive density at its quartiles, the sample IQR has an asymptotic replacement breakdown point of 25%. Roughly, contamination of about one quarter of the sample can drive one quartile arbitrarily far away; exact finite-sample thresholds depend on the quartile convention.

The IQR also has several useful properties:

  • Translation invariance: adding the same constant to every observation leaves the IQR unchanged.
  • Positive scale equivariance: multiplying every observation by a>0a>0 multiplies the IQR by aa.
  • No moment requirement: finite quartiles can exist even when a distribution has no finite mean or variance.
  • Limited shape information: the IQR alone does not describe skewness, tail behavior, or the number of peaks.

For example, a Cauchy distribution with location x0x_0 and scale γ>0\gamma>0 has quartiles x0−γx_0-\gamma and x0+γx_0+\gamma, giving

IQR⁡=2γ,\operatorname{IQR}=2\gamma,

although its mean and variance are undefined.

Relationship to standard deviation

For a normal distribution with mean μ\mu and standard deviation σ\sigma,

Q1=μ+σΦ−1(0.25),Q3=μ+σΦ−1(0.75),Q_1=\mu+\sigma\Phi^{-1}(0.25), \qquad Q_3=\mu+\sigma\Phi^{-1}(0.75),

where Φ\Phi is the standard normal cumulative distribution function. By symmetry,

IQR⁡=2Φ−1(0.75)σ≈1.34898 σ.\operatorname{IQR} =2\Phi^{-1}(0.75)\sigma \approx1.34898\,\sigma.

Consequently,

IQR⁡1.34898\frac{\operatorname{IQR}}{1.34898}

provides a normal-calibrated robust estimate of scale. This relationship is specific to the normal distribution; it is not a universal conversion between IQR and standard deviation.

The semi-interquartile range, also called the quartile deviation, is half the IQR:

Q3−Q12.\frac{Q_3-Q_1}{2}.

It is distinct from the median absolute deviation, which is the median of the absolute distances from the median.

Box plots and potential outliers

In a conventional box plot, the box extends from Q1Q_1 to Q3Q_3, with a line marking the median. A widely used rule defines inner fences at

L=Q1−1.5 IQR⁡,U=Q3+1.5 IQR⁡.L=Q_1-1.5\,\operatorname{IQR}, \qquad U=Q_3+1.5\,\operatorname{IQR}.

Observations below LL or above UU are flagged as potential outliers. The whiskers commonly extend to the most extreme observations within these fences, rather than to the fences themselves. Box-plot conventions vary, so their definitions matter when comparing displays.

The multiplier 1.51.5 is a descriptive convention, not a universal boundary between valid and invalid observations. Points outside the fences need not be measurement errors. Even for a normal population, approximately 0.7% of observations fall outside fences calculated from the population quartiles; skewed or heavy-tailed distributions may place substantially more observations outside them.

Applications and limitations

The IQR is used to compare variability across groups, summarize skewed data, and describe distributions whose extreme values would dominate other spread measures. Reporting the median together with Q1Q_1 and Q3Q_3 preserves more information than reporting the median and IQR alone, because it shows how the central interval is positioned around the median.

An IQR is not a confidence interval: it describes variation in a distribution rather than uncertainty about an estimated parameter. A sample IQR itself has sampling uncertainty, which can be assessed using methods such as bootstrap sampling.

Because the IQR depends only on two quantiles, datasets with the same IQR can have very different tails, ranges, and internal patterns. It is therefore a compact measure of central spread, not a complete description of a distribution.