IQR() — Interquartile range

How wide the middle half of the numbers is.

IQR(x)

Key idea

What are quartiles?

  1. Sort the data from smallest to largest. Quartiles are three cut points — Q1, Q2, Q3 — that split the sorted data into four equal quarters, 25% of the values in each.
  2. Q1, the lower (first) quartile, has 25% of the values below it. It is roughly the median of the lower half — e.g. the 25th percentile. (Software often interpolates, so the exact value can differ slightly.)
  3. Q2 is just the median itself: 50% of the values fall below it. It splits the data into two halves.
  4. Q3, the upper (third) quartile, has 75% of the values below it. It is roughly the median of the upper half — e.g. the 75th percentile.
  5. The IQR is the gap between Q1 and Q3 (IQR = Q3 − Q1) — the width of the middle 50%, and exactly the length of the box in a boxplot.

Definition

the 25th percentile (lower quartile)
the 75th percentile (upper quartile)

Where you'd use it

Frequently asked questions

What is the IQR?
Q3 − Q1, the spread of the middle 50% of the data — robust to outliers.