AI Glossary / Statistics and probability / Advanced

Inter-quartile range

Definition

The inter-quartile range, usually written interquartile range or IQR, is the difference between the upper and lower quartiles: IQR = Q3 minus Q1. It measures the width of the central part of a numerical distribution. Q1 and Q3 correspond to the 25th and 75th percentiles. The IQR is a distance, not the interval's two endpoints.

What it means

An IQR of six seconds describes central spread on the seconds scale. It does not mean that the median is six seconds or that every observation falls within six seconds of the median. Reporting the median together with Q1 and Q3 makes the center and the interval visible.
The IQR emphasizes the central portion rather than the most extreme observations. That is useful when unusual values would dominate a full range, but it also means that substantial changes in the tails can remain hidden. A stable IQR does not establish that the whole distribution is stable.

How it works

Sort the observations, calculate the two quartiles using a stated convention, and subtract the lower quartile from the upper one. Different sample-quantile conventions can produce different answers, especially for small datasets. State the method when reproducibility matters.
A simple teaching convention splits an even-sized ordered sample into equal halves and takes each half's median. Another common convention, called type 7 in R, interpolates at one-based position 1 plus (n minus 1) times p for probability p. These procedures need not agree.
Retain the measurement unit and describe missing-data handling. If comparing groups, use the same quantile method, time window, and inclusion rules. A narrower central spread is meaningful only in relation to the quantity and decision being assessed.

Three practical examples

  • An AI service team reports median response time and quartiles. The IQR summarizes ordinary variability, while separate high-percentile measures describe unusually slow responses.
  • A training team compares the central spread of task-completion times across cohorts. It also checks task difficulty and participation rules before interpreting differences.
  • A data analyst uses median-centered scaling divided by the IQR for a numerical feature. A zero IQR requires an explicit alternative rather than division by zero.

Think of it this way

Imagine marking two points around the middle of an ordered line of measurements. The IQR is the distance between those markers. It tells you how wide that central span is, while leaving the outer stretches largely undescribed.

Worked example

Consider eight invented response times, already ordered: 2, 4, 5, 7, 9, 10, 12, and 40 seconds. Use the median-of-halves convention first.
The lower half is 2, 4, 5, 7. Its median is (4 plus 5)/2 = 4.5 seconds, so Q1 is 4.5. The upper half is 9, 10, 12, 40. Its median is (10 plus 12)/2 = 11 seconds, so Q3 is 11.
The IQR is 11 minus 4.5 = 6.5 seconds. The overall median is (7 plus 9)/2 = 8 seconds. The interval from 4.5 to 11 and its width of 6.5 describe different things; neither should be substituted for the median.
The full range is 40 minus 2 = 38 seconds. Now replace the final value, 40, with 400. The quartiles and IQR remain unchanged under this convention, but the full range becomes 398 seconds. The central summary has deliberately not captured the much worse maximum response time.
Next return to the original values and apply type 7 interpolation. For Q1, the position is 1 plus 7 times 0.25 = 2.75. Interpolate three-quarters of the way between the second value, 4, and the third value, 5: Q1 = 4.75 seconds.
For Q3, the position is 1 plus 7 times 0.75 = 6.25. Interpolate one-quarter of the way between the sixth value, 10, and the seventh value, 12: Q3 = 10.5 seconds. The IQR is therefore 5.75 seconds. This differs from 6.5 because the quartile convention changed, not because the observations changed.
To check units and scaling, transform every original value using y = 3x plus 10. Under the median-of-halves convention, the new quartiles are 23.5 and 43, giving IQR 19.5. The additive shift disappears in subtraction, while the factor of three multiplies the IQR by three.
Finally, take a separate dataset containing eight zeros and two ones. Under the median-of-halves convention, both quartiles are zero, so the IQR is zero despite the presence of two distinct values. This example shows why a zero IQR is not proof that every observation is identical.
These calculations summarize the observed samples. They do not provide a confidence interval for a population quartile or a guarantee about future observations.

Illustrative case study

Fictional company Cedar Response monitors an assistant used by support staff. Its dashboard shows the median and quartiles alongside a slow-response percentile and failure counts.
After an update, the IQR changes little, but occasional delays become much longer. The team investigates those delays instead of declaring performance unchanged from the central summary alone. It also records the quartile convention so another analyst can reproduce the report. This scenario is fictional.

Common misconceptions and mistakes

The IQR is not the full range and does not describe every part of the distribution.
The interval between sample quartiles does not necessarily contain exactly half the observations, particularly with ties and interpolation.
The IQR is not a confidence interval. Data spread and uncertainty about an estimated parameter are separate concepts.
Resistance to a few extreme values does not make the IQR immune to every change in the data.
An IQR of zero can occur in nonconstant data. Automated scaling must handle this case.

Business use

Use the IQR to communicate central variability alongside a measure of location. Pair it with tail summaries when unusually large or small outcomes matter. Compare like-for-like populations and document the calculation convention before treating a change as operational evidence.

People also ask

Does the IQR have the original units?

Yes.

Can software packages return different values?

Yes, if their quartile conventions differ.

Does adding ten to every value change the IQR?

No.

Check your understanding

What is the first example's IQR using median-of-halves?

Answer: 6.5 seconds.

What happens when 40 becomes 400?

Answer: The IQR stays 6.5, but the full range increases.

Does zero IQR imply identical values?

Answer: No.

Related terms

  • Quartile
  • Percentile
  • Median
  • Range
  • Dispersion
  • Box plot
  • robust scaling
  • quantile interpolation

Learn next

Compare the IQR with standard deviation and median absolute deviation. Study sample-quantile conventions and separate tail monitoring from central-spread summaries.

  • Standard deviation
  • Median

More in Statistics and probability

  • Instrumental variables - Instrumental variables are variables used to isolate variation in an explanatory variable that can support causal estimation despite endogeneity.
  • Intensive sampling - Intensive sampling concentrates observation effort within a limited area or a narrow subject range.
  • Intention-to-treat - Intention-to-treat is the principle of analyzing participants according to their original randomized assignment, including those who did not follow the...
  • Interpolator - An interpolator is a predictive rule that reproduces the observations used to construct it.
  • Interrupted time series - Interrupted time series is a study design that examines repeated measurements before and after a defined intervention or event.
  • Interval estimate - An interval estimate is a range used to express uncertainty about an unknown parameter, such as a population mean or a difference between groups.

Sources

Harrell, Glossary of Statistical Terms: https://hbiostat.org/glossary/ . NIST, Measures of Scale: https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm . R documentation, Sample Quantiles: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/quantile.html . Numerical examples and company scenario are original illustrations.

Previous: Intentional stance Next: Inter-rater agreement

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer