Percentiles and Box Plots

Study Sheet

Percentiles and Box Plots

The five-number summary and outliers

Quartiles and the Five-Number Summary

Concept
Five numbers

The five-number summary is minimum, Q1Q_1, median, Q3Q_3, maximum. Q1Q_1 is the median of the lower half and Q3Q_3 the median of the upper half. A box plot draws a box from Q1Q_1 to Q3Q_3 with a line at the median and whiskers out to the extremes (or to the last non-outlier).

A box plot throws away most of the data on purpose. What survives is exactly what you need to compare groups side by side: where the middle is, how wide the middle half is, and whether the tails are lopsided. Each of the four pieces — left whisker, left box, right box, right whisker — holds about a quarter of the data, so a long piece means the values there are spread thin, not that there are more of them.

Example
Build one
048121620242832min 3, Q₁ 6, median 10, Q₃ 16, max 30
Box from Q₁ = 6 to Q₃ = 16, median at 10; the right whisker reaches 30.

Data (sorted): 3,5,7,8,10,12,14,18,303, 5, 7, 8, 10, 12, 14, 18, 30. With n=9n = 9 the median is the 55th value, 1010, and it belongs to neither half. Lower half 3,5,7,83, 5, 7, 8: Q1=(5+7)/2=6Q_1 = (5 + 7)/2 = 6. Upper half 12,14,18,3012, 14, 18, 30: Q3=(14+18)/2=16Q_3 = (14 + 18)/2 = 16. Summary: 3,6,10,16,303, 6, 10, 16, 30, and IQR=10\text{IQR} = 10. The long right whisker shows the upper quarter is spread out.

Example
An even number of values

Twelve values: 21,23,24,26,27,29,31,32,34,36,38,4521, 23, 24, 26, 27, 29, 31, 32, 34, 36, 38, 45. The median is the average of the 66th and 77th, (29+31)/2=30(29 + 31)/2 = 30. Now the halves are the first six and the last six values: Q1=(24+26)/2=25Q_1 = (24 + 26)/2 = 25 and Q3=(34+36)/2=35Q_3 = (34 + 36)/2 = 35. Summary 21,25,30,35,4521, 25, 30, 35, 45; IQR=10\text{IQR} = 10.

Example
Comparing two groups
5060708090100AB
Same scale, side by side: A sits higher, B is much narrower.

Two classes take the same test. Class A: 55,68,75,82,9555, 68, 75, 82, 95 (five-number summary). Class B: 60,70,72,74,8860, 70, 72, 74, 88. A has the higher median (7575 against 7272), but B is far more consistent: its middle half spans IQR=4\text{IQR} = 4 points against A's 1414. Side-by-side boxes make both facts visible at once.

Tip
The 1.5 IQR1.5\,\text{IQR} rule

A value is an outlier if it lies below Q1−1.5 IQRQ_1 - 1.5\,\text{IQR} or above Q3+1.5 IQRQ_3 + 1.5\,\text{IQR}. Outliers are plotted as separate dots beyond the whiskers.

Side note
Where it goes wrong

Including the median in both halves when nn is odd, or reading a longer section of the box as "more data". For 3,5,7,8,10,12,14,18,303, 5, 7, 8, 10, 12, 14, 18, 30, putting 1010 in both halves would give Q1=7Q_1 = 7 and Q3=14Q_3 = 14 — a different (and nonstandard) summary. And the long right whisker holds the same quarter of the data as the short left one.

Try it
Try it: outlier?

For the data 3,5,7,8,10,12,14,18,303, 5, 7, 8, 10, 12, 14, 18, 30 (Q1=6Q_1 = 6, Q3=16Q_3 = 16), is 3030 an outlier?

Show the answer

IQR=10\text{IQR} = 10, so the upper fence is 16+1.5⋅10=3116 + 1.5\cdot10 = 31. Since 30<3130 < 31, it is not an outlier (barely), and the whisker correctly runs all the way to 3030.

Outliers and the Fences

Concept
Fences at 1.5 IQR1.5\,\text{IQR}

The fences are Q1−1.5 IQRQ_1 - 1.5\,\text{IQR} and Q3+1.5 IQRQ_3 + 1.5\,\text{IQR}. Values outside them are flagged as outliers and drawn as separate dots; the whiskers stop at the most extreme values still inside the fences. The mean and standard deviation are sensitive to outliers; the median and IQR are resistant.

The fences are measured in units of the IQR so that they adapt to each data set's own spread: a value is unusual relative to how spread out the middle half is. The factor 1.51.5 is a convention chosen so that, for bell-shaped data, fewer than 1%1\% of values are flagged (see "Why It Works"). An outlier is a flag, not a verdict — it may be a typo, or the most interesting point in the data.

Example
Two outliers
048121620242832364044fence 4fence 24
Whiskers stop at 11 and 17; the outliers 2 and 40 lie beyond the fences at 4 and 24.

Data: 2,11,12,13,14,15,16,17,402, 11, 12, 13, 14, 15, 16, 17, 40. Median 1414; lower half 2,11,12,132, 11, 12, 13 gives Q1=11.5Q_1 = 11.5; upper half 15,16,17,4015, 16, 17, 40 gives Q3=16.5Q_3 = 16.5; IQR=5\text{IQR} = 5. Fences: 11.5−7.5=411.5 - 7.5 = 4 and 16.5+7.5=2416.5 + 7.5 = 24. So 22 and 4040 are outliers, and the whiskers run only to 1111 and 1717.

Example
Resistant and sensitive

For the same data the mean is 140/9≈15.6140/9 \approx 15.6 and the median 1414. Delete the outlier 4040: the mean drops to 100/8=12.5100/8 = 12.5, while the median only moves to (13+14)/2=13.5(13 + 14)/2 = 13.5. One value shifted the mean by more than 33, the median by 0.50.5 — which is why skewed data are summarized by median and IQR.

Side note
Where it goes wrong

Drawing the whiskers to the minimum and maximum when those are outliers. For the data above, whiskers from 22 to 4040 would hide exactly the information the plot is meant to show; the whiskers end at 1111 and 1717 and the outliers get their own dots.

Try it
Try it: flag the outliers

A data set has Q1=20Q_1 = 20 and Q3=30Q_3 = 30. Which of the values 4,12,44,464, 12, 44, 46 are outliers?

Show the answer

IQR=10\text{IQR} = 10, fences 20−15=520 - 15 = 5 and 30+15=4530 + 15 = 45. Outliers: 4\mathbf{4} (below 55) and 46\mathbf{46} (above 4545); 1212 and 4444 are inside.

Percentiles

Concept
The ppth percentile

The ppth percentile is the value below which p%p\% of the data falls. The median is the 5050th percentile; Q1Q_1 and Q3Q_3 are the 2525th and 7575th. A score at the 9090th percentile beat 90%90\% of the scores — it says nothing about the score itself. A cumulative frequency graph (ogive) plots, for each value, how many data lie below it, so percentiles can be read straight off it.

Percentiles convert a position in the data into a fraction of the data, so they compare fairly across groups of different sizes: the 8080th percentile of a class of 2525 and of a state of 250,000250{,}000 mean the same thing. On an ogive, the height at xx is the number of values below xx; reading across from p%p\% of the total and down to the axis gives the ppth percentile.

Example
Percentile of a value

In a class of 4040, a student has the 3434th highest score, so 66 scored higher. She is above 40−6−1=3340 - 6 - 1 = 33 of her classmates: 33/40=82.5%33/40 = 82.5\%, about the 8383rd percentile.

Example
Reading an ogive
scorecum.5060708090102030half: 2090%: 36
Read across from 20 (half) and 36 (90%) to the curve, then down to the score axis.

Scores of 4040 students: 4040–4949: 22, 5050–5959: 66, 6060–6969: 1212, 7070–7979: 1212, 8080–8989: 66, 9090–9999: 22. Running totals at 50,60,70,80,90,10050, 60, 70, 80, 90, 100: 2,8,20,32,38,402, 8, 20, 32, 38, 40. The median (the 2020th student) is where the graph reaches 2020: at 7070. The 9090th percentile is where it reaches 3636, between 3232 (at 8080) and 3838 (at 9090): 80+46⋅10≈86.780 + \tfrac46\cdot10 \approx 86.7, assuming the scores spread evenly within the bin.

Side note
Where it goes wrong

Reading "90th percentile" as "scored 90%". Percentiles rank; percents measure. A score of 62%62\% on a brutal exam can be at the 9090th percentile.

Try it
Try it: from the summary

A box plot shows Q1=52Q_1 = 52, median 6060, Q3=71Q_3 = 71. What percent of the data lies between 5252 and 7171? Above 7171?

Show the answer

Between Q1Q_1 and Q3Q_3 lies the middle half: 50%\mathbf{50\%}. Above Q3Q_3, the 7575th percentile: 25%\mathbf{25\%}.

Why It Works

For a normal distribution, Q1Q_1 and Q3Q_3 sit 0.6740.674 standard deviations either side of the mean, so IQR≈1.349σ\text{IQR} \approx 1.349\sigma. The upper fence is then 0.674σ+1.5(1.349σ)≈2.698σ0.674\sigma + 1.5(1.349\sigma) \approx 2.698\sigma above the mean, and the area beyond ±2.698σ\pm2.698\sigma is about 0.70%0.70\%. So in well-behaved bell-shaped data the rule flags roughly 77 values in 10001000 — rare enough to deserve a look, common enough that a flag alone proves nothing. In skewed data it flags many more on the long side, which is informative in its own right.