1 Definition and core idea
The interquartile range (IQR) is a statistic that quantifies the variability of a dataset by focusing on its middle portion. Specifically, it measures the distance between the first quartile (Q1) and the third quartile (Q3). Because it uses quartiles rather than extremes, it reflects typical spread without being overly influenced by unusually large or small observations.
1.1 Quartiles (Q1 and Q3)
Quartiles divide a dataset into four parts of equal size (or as equal as possible when sample sizes do not divide evenly). Q1 is the value at the 25th percentile, indicating that about one quarter of observations fall at or below it. Q3 is the value at the 75th percentile, marking that about three quarters of observations are at or below it. The IQR spans the region between these two landmarks, representing the middle half of the data.
1.2 Formula for interquartile range
The IQR is computed as the difference between the third and first quartiles:
IQR = Q3 − Q1.
This definition makes the IQR a direct measure of dispersion in the same units as the original data.
1.3 Units and interpretation of IQR
Since IQR is a difference of two data values, it carries the same units as the variable being measured. Interpreting its magnitude depends on context: a larger IQR indicates greater variability in the central half of the distribution, while a smaller IQR suggests more concentrated values around the median. As a dispersion metric, it is especially informative when the data are skewed or contain outliers.
2 Computing IQR from data
Computing the IQR typically involves estimating Q1 and Q3, then taking their difference. The practical method depends on how quartiles are defined for the given sample size and on the conventions used by a software package or statistical text.
2.1 Steps using sorted data
A common approach begins by sorting observations from smallest to largest.
2.1.1 Finding Q1 and Q3
Q1 and Q3 are determined by locating the 25th and 75th percentiles in the ordered list. Depending on the quartile convention, one may select an actual observation at a given position or interpolate between neighboring values when the target percentile falls between two data points.
2.1.2 Subtracting Q1 from Q3
After Q1 and Q3 are identified, the IQR follows from subtraction. This final step is straightforward once the quartile estimates are fixed.
2.2 Handling even vs. odd sample sizes
When the number of observations is even or odd, the positions used to define quartiles can differ slightly. Even sample sizes often produce percentile positions that fall between two observations, encouraging interpolation under many conventions. Odd sample sizes may align the quartile position with an observed value. These distinctions do not change the general meaning of IQR, but they can affect the numerical result.
2.3 Alternative quartile definitions and conventions
Quartile definitions are not fully standardized across all references. Different methods specify how to treat percentile positions that do not correspond exactly to an observed value, and how to include or exclude endpoints when subdividing the data.
2.3.1 Software and textbook differences
Statistical software may implement multiple “quantile” algorithms, each with its own interpolation rules and index calculations. As a result, two tools applied to the same dataset can yield slightly different Q1 and Q3 values, especially for small samples. In practice, analysts usually document the software and method used for quantile computation to ensure reproducibility.
3 Interquartile range in descriptive statistics
In descriptive statistics, the IQR serves as a scale-free concept of spread for the central portion of the data. It complements measures of central tendency and other dispersion statistics.
3.1 Relationship to central tendency
While the median is a central tendency measure based on order (the 50th percentile), the IQR is a dispersion measure based on quartiles. Together, they summarize both where the “middle” of the data lies and how much variability typically occurs around it. In many skewed distributions, pairing the median with the IQR provides a stable description without relying on mean and standard deviation.
3.2 Comparison with range and standard deviation
The range uses the minimum and maximum values and can be dominated by extremes. The IQR uses Q1 and Q3, often giving a more representative measure of typical spread when outliers are present. Compared with the standard deviation, which depends on all values and squares deviations, the IQR offers a simpler, more order-based summary that is less sensitive to heavy tails or occasional large departures.
3.3 Robustness to outliers
Because Q1 and Q3 depend on the ordered positions near the 25th and 75th percentiles, extreme observations affect the IQR only if they influence the quartile estimates.
3.3.1 Why IQR is resistant to extremes
An extreme low or high value typically lies outside the middle half. Unless the sample is very small or the extreme value shifts the quartile positions, the middle quartiles remain unchanged. This makes the IQR relatively resistant to anomalous points compared with statistics that rely on the full set of values.
4 Box plots and visualization
A box plot is a standard visualization that uses quartiles and the IQR to display distributional structure. It provides an at-a-glance view of central location, spread, and potential outliers.
4.1 Box plot components (median, hinges, whiskers)
In a typical box plot, the box spans from Q1 to Q3. The median is drawn as a line inside the box. The ends of the box are sometimes called “hinges” and correspond to the first and third quartiles. Whiskers extend from the hinges to additional reference limits, which may be defined in relation to the IQR.
4.2 Using IQR to understand skewness
Skewness can be inferred visually by comparing the relative lengths of the box halves. If the median line is closer to Q1 than to Q3, the upper half of the distribution is more spread out than the lower half, suggesting right-skew. Conversely, if the median is closer to Q3, left-skew is indicated. While this is a visual heuristic rather than a formal test, it often provides quick interpretive guidance.
4.3 Reading IQR from a box plot
The height or width of the box directly represents the IQR. This allows viewers to compare variability across multiple groups on the same scale.
4.3.1 Visual cues for variability changes
When comparing box plots, an expanding box indicates a larger IQR and thus greater variability in the middle half. A shrinking box suggests a tighter central distribution. Because the box focuses on quartiles, changes in whiskers or isolated points can be interpreted separately from changes in overall central spread.
5 Outliers and the IQR rule
The IQR is commonly used to flag outliers using a standardized criterion. The rule is based on how far observations lie beyond the central quartile boundaries.
5.1 The 1.5×IQR criterion
A widely used rule labels an observation as an outlier if it falls below:
Lower fence = Q1 − 1.5 × IQR
or above:
Upper fence = Q3 + 1.5 × IQR.
Values outside these fences are treated as unusually far from the middle half, relative to the typical spread described by the IQR.
5.2 Interpreting outlier labels
Outlier labels indicate points that depart substantially from the bulk of the data under the selected rule. They do not automatically imply data errors or causal explanations; instead, they identify observations that merit inspection. The interpretive weight of outliers depends on context, sample size, and whether the underlying distribution plausibly supports such extremes.
5.3 Common variations (e.g., 3×IQR)
Some conventions use stronger thresholds, such as 3 × IQR, to identify more extreme departures. Another common extension distinguishes “mild” and “extreme” outliers using different multipliers. These variations change sensitivity: larger multipliers typically yield fewer flagged points.
6 Applications and use cases
IQR is used wherever a stable summary of dispersion is needed, particularly in comparative and exploratory analyses.
6.1 Comparing spread across groups
When comparing distributions across categories, IQR offers a consistent way to assess variability in the central half. This is useful for non-normal data, skewed distributions, or when groups may differ in tails. By focusing on Q1 and Q3, comparisons become less dependent on rare extreme values.
6.2 Quality control and process monitoring
In quality control contexts, measurements such as lengths, times, or sensor readings may include occasional anomalies. The IQR can help characterize typical variability without being unduly influenced by rare extreme defects. When monitored over time, changes in IQR can signal shifts in process stability affecting the middle portion of outcomes.
6.3 Exploratory data analysis workflows
In exploratory data analysis, IQR often appears alongside the median in summary tables and box plots. Analysts use it to understand how spread changes with transformations, subgrouping, or filtering steps. It also supports quick checks for skewness, heterogeneity, and the presence of points far from the main mass of data.
7 Special considerations
Certain data characteristics and preprocessing choices influence how quartiles and thus the IQR should be interpreted.
7.1 Discrete data and repeated values
For discrete variables, quartiles may fall on repeated values, producing an IQR of zero or near-zero if many observations share the same outcomes. Repetition can also create step-like changes in Q1 and Q3 as sample size grows. While the computation remains valid, the interpretive meaning of a small IQR should reflect the discreteness of the measurement.
7.2 Small sample behavior
With few observations, quartile estimates can be unstable and strongly affected by individual points. Different quartile conventions may also produce noticeable differences because percentile positions fall between observations more often. In small datasets, it may be helpful to interpret IQR with caution and consider sensitivity to the chosen quartile definition.
7.3 Missing data and preprocessing effects
Missing values must be handled before quartiles are computed. Depending on the strategy—such as listwise deletion, imputation, or filtering—Q1 and Q3 may shift, altering the IQR. If missingness is related to the outcome variable, the resulting IQR can represent the observed subset rather than the full intended distribution, affecting downstream comparisons.