8F

Quartiles, box plots and outliers

Quartiles and the interquartile range, five-number summaries and box plots, comparing data sets with parallel box plots, and identifying outliers with the 1.5 × IQR rule.

The median splits data in half. Quartiles split it into quarters, and those five cut points (smallest value, three quartiles, largest value) are enough to sketch the whole shape of a data set in one small diagram.

Quartiles and the IQR

  • Put the data in order and find the median, $Q_2$.
  • The lower quartile $Q_1$ is the median of the lower half. The upper quartile $Q_3$ is the median of the upper half. If there's an odd number of values, leave the middle value out of both halves.
  • The interquartile range is $\text{IQR} = Q_3 - Q_1$. It's the spread of the middle $50\%$ of the data, so unlike the range, it ignores extreme values.
  • The five-number summary is: minimum, $Q_1$, median, $Q_3$, maximum.

Outliers

An outlier is a value that is unusually far from the rest. To decide formally, build two fences:

Outlier fences
$$\text{lower fence} = Q_1 - 1.5 \times \text{IQR} \qquad \text{upper fence} = Q_3 + 1.5 \times \text{IQR}$$

Any value below the lower fence or above the upper fence is an outlier. Before deleting an outlier, find out why it's there. It might be a typing error (a height of $1680$ cm), or it might be real and important (a student with a full-time job).

Example 1●●

Fifteen Year 12 students recorded their weekly hours of part-time work: $0, 0, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 10, 12, 25$. Find the five-number summary, test for outliers, and draw a box plot.

Median $= 6$
15 values: the median is the 8th.
$Q_1 = 4$, $Q_3 = 9$
Lower half = the 7 values before the median: 0, 0, 3, 4, 5, 5, 6. Its middle (4th) value is 4. Upper half = 7, 8, 8, 9, 10, 12, 25. Its middle value is 9.
$0, 4, 6, 9, 25$, and $\text{IQR} = 9 - 4 = 5$
Five-number summary and IQR.
Lower: $4 - 1.5 \times 5 = -3.5$. Upper: $9 + 1.5 \times 5 = 16.5$
Fences.
$25$ is an outlier
25 is above 16.5. Nothing is below −3.5.
See the box plot below
Draw the box from Q1 to Q3 with a line at the median. Whiskers reach the most extreme values that are not outliers (0 and 12). Mark the outlier separately.
Dot plot and box plot for Example 1. The whisker stops at 12, and the outlier 25 is marked with a cross.
Example 2●

For the data $12, 15, 17, 18, 20, 22, 25, 27, 30, 41$, is $41$ an outlier?

$\text{IQR} = 27 - 17 = 10$
From the mistake box: Q1 = 17 and Q3 = 27.
$27 + 1.5 \times 10 = 42$
Upper fence.
$41$ is not an outlier, even though it looks far from the rest
41 is less than 42, so it's inside the fence.

Reading and comparing box plots

Each of the four sections of a box plot (whisker, half-box, half-box, whisker) holds about $25\%$ of the data. A long section doesn't mean more data. It means the same amount of data spread over a wider range.

  • Symmetric: median in the middle of the box, whiskers about equal.
  • Positively skewed: median closer to $Q_1$, longer right whisker.
  • Negatively skewed: median closer to $Q_3$, longer left whisker.

You can also find a five-number summary from a dot plot, stem-and-leaf plot or cumulative frequency table: list the values in order and count.

Parallel box plots of weekly hours of part-time work for 15 Year 11 and 15 Year 12 students.
Example 3●●

Compare the part-time work hours of the two year groups using the parallel box plots above.

Year 11: $0, 5, 8, 12, 16$. Year 12: $0, 4, 6, 9, 25$ (with $25$ an outlier)
Read each five-number summary.
Year 11's median ($8$ h) is $2$ hours higher than Year 12's ($6$ h)
Centre.
Year 11's IQR is $7$ h compared with Year 12's $5$ h, so the middle half of Year 11 is more spread out
Spread: use the IQR, because Year 12's range is inflated by one outlier.
Neither box plot is strongly skewed, but one Year 12 student works $25$ hours, far more than anyone else. Overall, Year 11 students tend to work more hours, perhaps because Year 12 students cut back to study for the HSC.
Shape and unusual values, in context.
InteractiveDrag the data, watch the box plots
Try this

Drag Year 12's outlier ($25$) to the left until it's no longer an outlier. At what value does that happen? Use the fence to explain.

Drag the same point back out to $30$. How much do the mean and the median of Year 12 change? Which is affected more by an outlier?

Make the two groups have the same median but very different IQRs.

Your turn

Remove the outlier $25$ from Example 1. Find the new mean and median, and compare them with the originals.

Show the working

Original: total $= 108$, mean $= 108 \div 15 = 7.2$, median $= 6$. Without $25$: total $= 83$, mean $= 83 \div 14 \approx 5.93$. The median of the $14$ values is halfway between the 7th and 8th, both $6$, so it's still $6$. The outlier moved the mean by more than an hour but didn't move the median at all.

Flashcards
Five-number summary
Minimum, $Q_1$, median, $Q_3$, maximum
IQR
$Q_3 - Q_1$: the spread of the middle $50\%$
Outlier fences
$Q_1 - 1.5 \times \text{IQR}$ and $Q_3 + 1.5 \times \text{IQR}$
Practice
  1. For $3, 5, 7, 8, 10, 12, 15$, find $Q_1$.

  2. For the same data, find the IQR.

  3. For the same data, find the upper fence for outliers.

  4. $Q_1 = 20$ and $Q_3 = 30$. Is $47$ an outlier?

  5. What percentage of the data in a box plot lies above $Q_1$?

  6. A box plot has its median close to $Q_3$ and a long left whisker. The data is:

  7. Why is the IQR often better than the range for comparing spread?

  8. Exam style: In Example 3, by how many hours is Year 11's IQR greater than Year 12's?

  9. Exam style: In Example 1, the value $25$ is replaced by a different whole number. What is the smallest whole number it could be replaced by and still be an outlier?

Formula sheet