9D

Quartiles, IQR and box plots

Range, quartiles and interquartile range, the five-number summary, outliers, drawing and reading box plots, and comparing data sets.

Two classes can have the same average mark but be very different: one where everyone scored about the same, and one with some top marks and some very low ones. Measures of spread capture that difference.

Range and quartiles

The range is highest minus lowest. It is quick, but one extreme value can make it misleading. Quartiles fix that by looking at the middle half of the data.

Interquartile range
$$\text{IQR} = Q_3 - Q_1$$

The IQR is the spread of the middle $50\%$ of the data, so a single extreme value can't distort it.

Example 1●●

Find the quartiles and IQR of $3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18, 20, 25$.

$Q_2 = 12$
13 values, already in order. The median is the 7th value.
$Q_1 = 7$
Odd number of values, so leave out the 12. The lower half is 3, 5, 6, 8, 9, 11; its middle is between 6 and 8.
$Q_3 = 17.5$
The upper half is 14, 15, 17, 18, 20, 25; its middle is between 17 and 18.
$\text{IQR} = 17.5 - 7 = 10.5$
Example 2●●

Find the quartiles of $2, 4, 5, 7, 8, 10, 12, 15$.

$Q_2 = 7.5$
8 values: the median is between the 4th and 5th.
$Q_1 = \dfrac{4 + 5}{2} = 4.5$ and $Q_3 = \dfrac{10 + 12}{2} = 11$
Even number of values, so the halves are the first four and the last four.
$\text{IQR} = 6.5$

Box plots

The five-number summary is: minimum, $Q_1$, median, $Q_3$, maximum. A box plot draws it on a scale. The box runs from $Q_1$ to $Q_3$ with a line at the median, and the "whiskers" reach out to the minimum and maximum. Each of the four sections holds about a quarter of the data.

For Example 1, the five-number summary is $3, 7, 12, 17.5, 25$.

Outliers

A common rule: a value is an outlier if it is more than $1.5 \times \text{IQR}$ below $Q_1$ or above $Q_3$.

Example 3●●

Is $25$ an outlier in Example 1?

Upper fence $= 17.5 + 15.75 = 33.25$
1.5 × 10.5 = 15.75. Add it to Q₃ to get the upper fence.
$25$ is not an outlier.
25 is below the fence.

On a box plot, an outlier is shown as a separate dot, and the whisker stops at the largest value that is not an outlier.

Build a box plot

Drag any dot to change the data. The box plot, summary statistics and outlier fences update as you go.

Try this

Find $Q_1$, the median and $Q_3$ by hand first, then check. Next, drag the largest value to the right until it becomes an outlier. At what value does that happen, and why?

Comparing data sets

Put two box plots on the same scale. Compare the medians to see which set is generally higher, and the IQRs to see which is more consistent.

Your turn

Bus route X takes a median of $22$ minutes with an IQR of $4$ minutes. Route Y takes a median of $18$ minutes with an IQR of $12$ minutes. You must not be late for an exam. Which route would you take, and why?

Show the working

Route Y is usually faster (lower median), but its times vary a lot (large IQR), so some trips take much longer. Route X is slower on average but very consistent. For an exam, the reliable choice is X; just leave a little earlier.

Flashcards
Interquartile range
$Q_3 - Q_1$: the spread of the middle $50\%$
Five-number summary
Min, $Q_1$, median, $Q_3$, max
Outlier rule
More than $1.5 \times \text{IQR}$ below $Q_1$ or above $Q_3$
Practice
  1. Find the range of $4, 9, 2, 15, 7$.

  2. Find $Q_1$ for $1, 3, 4, 6, 7, 9, 10, 12$.

  3. Find $Q_3$ for the same data.

  4. Find the IQR for the same data.

  5. Find the IQR of $2, 5, 6, 8, 11, 13, 14, 17, 20$.

  6. On a box plot, the box itself runs from:

  7. About what percentage of the data lies between $Q_1$ and the median?

  8. A data set has $Q_1 = 20$ and $Q_3 = 30$. Above what value is a score an outlier?

  9. Challenge: Team A's scores have median $60$ and IQR $10$. Team B's have median $65$ and IQR $25$. Which statement is best supported?

  10. Challenge: A five-number summary is $12, 18, 25, 31, 50$. Find the upper fence for outliers. Is $50$ an outlier?

Formula sheet