Euler Hall — free maths guides

Compute the interquartile range

A plain-language explanation of the interquartile range and outliers. The idea in plain words, a worked example, and a check with the answers shown — part of the free Statistics guides.

The width of the middle half

The interquartile range is

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

It is the width of the interval that holds the middle half of the data: a quarter of the values lie belowQ1Q_1, a quarter aboveQ3Q_3, and half in between.

BecauseQ1Q_1 andQ3Q_3 are positions rather than sums, the IQR is resistant: an extreme value changes which value sits at a position far less than it changes a total. That is why the IQR, not the range, is the spread reported beside a median.

Resistant is not immune. A wild value can still shift a half's median by one position; what it cannot do is set the IQR single-handedly the way it sets the range.

Why the middle half is the right half

Because the tails are where the surprises are, and a spread measure that includes them reports the surprises rather than the data. Half the values are inside the IQR, and that half is what a typical observation looks like.

It also matches the box plot, which draws exactly this interval as its box. A reader who sees a box plot is reading an IQR, so reporting the IQR is reporting the picture.

Worked example: an IQR with and without a wild value

Data:4,6,7,8,9,11,134, 6, 7, 8, 9, 11, 13. Sorted,Q2=8Q_2 = 8; the halves are4,6,74, 6, 7 and9,11,139, 11, 13, soQ1=6Q_1 = 6,Q3=11Q_3 = 11 and IQR=5= 5.

Add 1,000. The quartiles becomeQ1=6Q_1 = 6 andQ3=11Q_3 = 11 still — the eight values now split as four and four, and the third and sixth are 7 and 9, soQ1=6.5Q_1 = 6.5 andQ3=11Q_3 = 11; the IQR is 4.5. The RANGE, meanwhile, went from 9 to 996.

Check. One wild value moved the IQR by half a unit and the range by a factor of a hundred. That ratio is what "resistant" means.

By the end you can
  • Compute the IQR as
  • Say what the IQR measures and why it is resistant
  • Contrast the IQR with the range on data with an outlier
Check yourself
  1. 1. For1,3,4,6,8,10,121, 3, 4, 6, 8, 10, 12 findQ1Q_1,Q3Q_3 and the IQR.
  2. 2. What fraction of the values lies inside the IQR?
Answers
  1. 1.Q1=3Q_1 = 3,Q3=10Q_3 = 10, IQR=7= 7.
  2. 2. About half.
Work out where to start — free, no accountAnswer six real questions — free, no account