Box plots that show outliers
One house on the street sold for far more than the others. How can a box plot show that house without stretching the picture of all the rest?
Where you are 3 in Box plots
When you reach for it
A box plot runs its whiskers out to the smallest and largest values. When one value sits far from the rest, its whisker stretches all the way out to it, and the picture suggests a quarter of the data spread thinly along that whole stretch, when in fact one value sits out there alone. A modified box plot, a box plot that shows outliers, ends each whisker before such values and draws each of them as a dot of its own. Reach for it whenever a data set might hold values far from the rest: house prices, where one large house can sell for far more than its neighbors, or museum visitors, where one school trip can fill a quiet day.
It draws with the 1.5 IQR rule. That rule sets two fences, Q_1 - 1.5\,\text{IQR} below the box and Q_3 + 1.5\,\text{IQR} above it, where \text{IQR} = Q_3 - Q_1 is the interquartile range; a value below the lower fence or above the upper fence is an outlier. Quartiles here, as in comparing box plots, are the medians of the lower and upper halves of the ordered data, with the median left out of both halves when the count is odd. All the data in this lesson are made up.
The procedure
The box is unchanged. Order the data and find its five-number summary as for any box plot. The box still runs from Q_1 to Q_3 with a line at the median; only the whiskers change.
The fences come from the box. Find \text{IQR} = Q_3 - Q_1, multiply it by 1.5, subtract the result from Q_1 and add it to Q_3. The fences are measured from the quartiles, not the median, because the box already holds the middle half of the data: the question is how far beyond the box a value has strayed, measured in box widths. The fences are worked out but not drawn on the finished plot.
Values beyond a fence become dots. A value strictly below the lower fence or strictly above the upper fence is an outlier, drawn as its own dot at its value. A value exactly on a fence is not an outlier. Each dot stands for one value.
Each whisker stops at a data value. The lower whisker runs from the box to the smallest value that is not an outlier, and the upper whisker to the largest value that is not an outlier. It stops there, not at the fence, because a whisker says “the data reach this far”; drawn to the fence it would claim values that do not exist. When no value lies beyond a fence, the whiskers reach the minimum and maximum and the plot is exactly the standard one.
Reading one back. From a modified box plot you can read Q_1, the median and Q_3, and so the IQR and the fences; the value of every outlier; and the two whisker ends, which are real data values, the most extreme ones that are not outliers. Between a whisker’s end and the first dot beyond it lies none of the data: a data value there would be either inside the fence, so the whisker would reach it, or beyond it, so it would be a dot. The plot cannot give how many values there are in all, or any single value other than the dots and the whisker ends.
Worked examples
Drawing one from the data
Eleven houses on Linden Street sold last year. Their prices, in thousands of dollars: 182, 195, 204, 210, 215, 221, 228, 236, 240, 252, 410. Draw the modified box plot.
SolutionThe list is in order. With 11 values the median is the 6th, 221, left out of both halves. The lower half 182, 195, 204, 210, 215 gives Q_1 = 204, and the upper half 228, 236, 240, 252, 410 gives Q_3 = 240. So \text{IQR} = 240 - 204 = 36 and 1.5 \times 36 = 54, and the fences are
No price is below 150, so there are no low outliers and the lower whisker runs to the minimum, 182. The price 410 is above 294, so it is an outlier and gets a dot. The largest price that is not an outlier is 252, so the upper whisker stops at 252. It does not reach to 294: no house sold between 252 and 294, and a whisker drawn to 294 would say one did.
The dashed fences are drawn here only to show where they fall; the finished plot leaves them out.
Outliers on both sides
A small museum counted its visitors on 12 days: 3, 41, 46, 48, 52, 55, 57, 60, 63, 66, 85, 128. The day with 3 visitors had heavy snow, and the day with 128 brought a school trip. Draw the modified box plot.
SolutionWith 12 values the median is the mean of the 6th and 7th, \displaystyle \frac{55 + 57}{2} = 56. The lower half is the first six values, and Q_1 is the mean of its 3rd and 4th, \displaystyle \frac{46 + 48}{2} = 47; likewise \displaystyle Q_3 = \frac{63 + 66}{2} = 64.5. Then \text{IQR} = 64.5 - 47 = 17.5 and 1.5 \times 17.5 = 26.25, so
The fences are not whole numbers, though visitor counts are; they are boundaries, not data values. Below 20.75 lies 3, and above 90.75 lies 128: one outlier on each side. The value 85 is inside, so the upper whisker ends at 85, and the lower one at 41.
The standard plot against the modified one
Draw the standard box plot of the Linden Street prices from Example 1 and compare it with the modified one.
SolutionThe standard plot has the same box, but its whiskers run to the minimum, 182, and the maximum, 410.
In the standard plot the right whisker is 410 - 240 = 170 long, nearly five times the box’s width of 36. It reads as the top quarter of the street spread thinly over 170 thousand dollars. The dots show what is really there: above Q_3 lie only 252 and 410, one close to the box and one far out. The standard plot also looks strongly skewed right, its halves covering 221 - 182 = 39 and 410 - 221 = 189. The modified plot shows the bulk of the street fairly balanced, 39 below the median and 252 - 221 = 31 above, with one house far above the rest.
One value made a long whisker that looks like many. The modified plot hides less: its box is the same, the minimum and maximum are still there as a whisker end or a dot, and it also shows which values sit far from the rest.
Reading one back
The plot shows the daily visitors to the museum on the days it opened in March.
(a) Find the fences and confirm that both dots are outliers. (b) What were the busiest and quietest days’ counts? (c) Could a day have had 75 visitors? 80? (d) On how many days were there more than 72 visitors? (e) What cannot be read from the plot?
Solution(a) Q_1 = 42 and Q_3 = 56, so \text{IQR} = 14 and 1.5 \times 14 = 21. The fences are 42 - 21 = 21 and 56 + 21 = 77. Both dots, 84 and 95, are above 77.
(b) The busiest day had 95 visitors, the highest dot. There is no low dot, so the lower whisker’s end is the minimum: the quietest day had 30.
(c) Neither. 75 is below the upper fence, so such a day would not be an outlier and the whisker would reach it, but the whisker stops at 72. 80 is above the fence, so it would be an outlier with a dot of its own, and there is no dot at 80. No day had between 72 and 84 visitors.
(d) Exactly 2. Every value above 72 is an outlier, and each dot is one day.
(e) How many days the museum opened, and the count of any day other than the dots and the whisker ends. The median and quartiles need not be the count of any one day: with an even number of values each is a mean of two.
A typo or a real extreme
A list of the sale prices of 9 houses in a village, in thousands of dollars, reads 152, 166, 171, 178, 184, 190, 197, 205, 1950. Find the outliers. The sale record then shows that the last house sold for 195. Find the outliers again.
SolutionThe median is the 5th value, 184. The lower half 152, 166, 171, 178 gives \displaystyle Q_1 = \frac{166 + 171}{2} = 168.5, and the upper half 190, 197, 205, 1950 gives \displaystyle Q_3 = \frac{197 + 205}{2} = 201. The IQR is 32.5, 1.5 \times 32.5 = 48.75, and the fences are 119.75 and 249.75. The value 1950 is an outlier.
An outlier is a flag to look at, not a value to delete. A village house at ten times its neighbors’ prices is worth checking against the sale record, which shows 195: a slipped zero. The fix is to correct the value, not drop it, since the house did sell. The corrected list, in order, is 152, 166, 171, 178, 184, 190, 195, 197, 205. The median and Q_1 are unchanged, \displaystyle Q_3 = \frac{195 + 197}{2} = 196, the IQR is 27.5, 1.5 \times 27.5 = 41.25, and the fences are 127.25 and 237.25. Every price lies between them, so there are no outliers, the whiskers reach 152 and 205, and the modified plot is the same as the standard one.
Had the record confirmed 1950, the value would stay. Linden Street’s 410 in Example 1 was a real sale of a much larger house; it stays in the data and stays a dot.
How much rests on the 1.5
Find the outliers in the museum data of Example 2 with 1 and with 3 in place of 1.5.
SolutionThe IQR is 17.5. With 1 \times \text{IQR} the fences are 47 - 17.5 = 29.5 and 64.5 + 17.5 = 82, so 3, 85 and 128 are outliers. With 3 \times \text{IQR} = 52.5 they are 47 - 52.5 = -5.5 and 64.5 + 52.5 = 117, so only 128 is.
| Multiplier | Fences | Outliers |
|---|---|---|
| 1 | 29.5 and 82 | 3, 85, 128 |
| 1.5 | 20.75 and 90.75 | 3, 128 |
| 3 | -5.5 and 117 | 128 |
The 1.5 is a convention, not a law. Nothing in the data singles it out; it is a widely shared choice that flags values well beyond the box. Some books add a second fence at 3 IQR and call values beyond it far out. A value just past a fence is hardly different from one just inside, so a dot means “look here”, not “this value is wrong”.
Boundaries
Beyond means strictly beyond. A value exactly on a fence is not an outlier.
The quartile rule matters. Some calculators keep the median in both halves when the count is odd, and others interpolate, which moves the quartiles and so the fences. A value near a fence can be an outlier under one rule and not another, so say which rule was used.
An outlier belongs to its data set. Adding or correcting a value moves the quartiles and the fences, as in Example 5, so a value that is ordinary in one set can be an outlier in another.
The rule flags; it does not explain. It cannot tell a typo from a real extreme. Only the record or the context can, and only a mistake is corrected.
Few values, shaky fences. With a handful of values the quartiles rest on one or two numbers, and so do the fences.
Numbers only. As with any box plot, the data must be numbers with an order.
Where this goes next
Comparing box plots sets two plots on one scale; modified plots compare the same way, with the dots kept apart from the bulk. An outlier pulls the mean far more than the median (Mean, median and skew: choosing the center). Later, z-scores and the empirical rule give a second yardstick, measuring how far a value lies from the mean in standard deviations.
Exercises
Fences and outliers
- A data set has Q_1 = 30 and Q_3 = 42. Find its fences. Is 12 an outlier? Is 61?
- House prices on one street, in thousands of dollars, have Q_1 = 245 and Q_3 = 285. Which of 160, 190, 340 and 360 are outliers?
Drawing from the data
For each data set find the five-number summary, the fences, the outliers and where the whiskers end.
- Museum visitors on 9 days: 64, 70, 71, 75, 78, 80, 84, 88, 131.
- Ten house prices on Mill Road, in thousands of dollars: 312, 288, 335, 301, 95, 296, 320, 342, 309, 327.
- Museum visitors on 14 days: 0, 38, 40, 42, 44, 45, 47, 48, 50, 51, 53, 55, 58, 97. The museum was shut for repairs on one of the days. Which outliers belong in a study of the days it opened?
- Museum visitors on 8 weekdays: 22, 25, 27, 30, 31, 33, 36, 40. Describe the plot.
Reading a modified box plot
The plot shows the sale prices of houses on Birch Lane, in thousands of dollars.
- Read Q_1, the median and Q_3, find the fences, and confirm that every dot is an outlier.
- What were the lowest and highest prices? How many houses sold for more than 300?
- Could a house on Birch Lane have sold for 310? For 200? For 230?
- Describe the standard box plot of the same prices, and say what it would suggest that the modified plot shows is not so.
Flags and comparisons
- The visitors on 10 days were entered as 38, 41, 45, 47, 49, 52, 55, 58, 61, 452. The ticket log shows that the day entered as 452 had 45 visitors. Find the outliers before and after the correction.
- Elm Street’s modified box plot of prices, in thousands of dollars, has whiskers ending at 180 and 260, a box from 200 to 240 with median 220, and one dot at 420. Oak Street’s has whiskers ending at 170 and 300, a box from 210 to 270 with median 240, and no dots. Which street had higher prices typically? Which had the most expensive house? Which has the more spread-out middle half?
Reasoning
- Explain why a whisker stops at the last data value inside the fence and not at the fence.
- Explain why a value flagged as an outlier is looked at rather than deleted.
- Explain why a data set with no outliers gives the same plot either way.
- Can the median ever be an outlier? Explain.
- A book uses 2 IQR in place of 1.5 IQR. Explain why it finds the same outliers or fewer, never more.
Answers
- \text{IQR} = 12 and 1.5 \times 12 = 18, so the fences are 30 - 18 = 12 and 42 + 18 = 60. 12 is not an outlier, since it lies on the fence; 61 is.
- \text{IQR} = 40 and 1.5 \times 40 = 60, so the fences are 185 and 345. Outliers: 160 and 360. Not outliers: 190 and 340.
- Median 78, \displaystyle Q_1 = \frac{70 + 71}{2} = 70.5, \displaystyle Q_3 = \frac{84 + 88}{2} = 86: summary 64, 70.5, 78, 86, 131. IQR 15.5, 1.5 \times 15.5 = 23.25, fences 47.25 and 109.25. Outlier: 131. Whiskers end at 64 and 88.
- In order: 95, 288, 296, 301, 309, 312, 320, 327, 335, 342. Summary 95, 296, 310.5, 327, 342. IQR 31, 1.5 \times 31 = 46.5, fences 249.5 and 373.5. Outlier: 95. Whiskers end at 288 and 342.
- Summary 0, 42, 47.5, 53, 97. IQR 11, 1.5 \times 11 = 16.5, fences 25.5 and 69.5. Outliers: 0 and 97; whiskers end at 38 and 58. Only 97 belongs. The 0 is the day it was shut, not a count of an open day, so it leaves the study for that reason, which the record gives, not because the rule flagged it. The 97 stays: nothing shows it is a mistake.
- Summary 22, 26, 30.5, 34.5, 40. IQR 8.5, 1.5 \times 8.5 = 12.75, fences 13.25 and 47.25. No outliers, so the whiskers reach 22 and 40 and the plot is the same as the standard box plot.
- Q_1 = 240, median 255, Q_3 = 270. IQR 30, 1.5 \times 30 = 45, fences 195 and 315. The dot at 150 is below 195; those at 345 and 390 are above 315.
- Lowest 150, highest 390. Two houses, at 345 and 390: every price above the whisker’s end, 300, is a dot.
- 310: no. It is inside the upper fence, so the whisker would reach it, but the whisker stops at 300. 200: no. It is inside the lower fence, so the lower whisker would reach down to it, but it stops at 210. 230: possibly; it lies along the lower whisker, where the plot shows no single values.
- The same box, with whiskers to 150 and 390, of lengths 240 - 150 = 90 and 390 - 270 = 120, three and four times the box’s width of 30. It suggests the cheapest and dearest quarters are spread widely; in fact all but three prices lie between 210 and 300.
- Before: median 50.5, Q_1 = 45, Q_3 = 58, IQR 13, fences 45 - 19.5 = 25.5 and 58 + 19.5 = 77.5, so 452 is an outlier. After, in order 38, 41, 45, 45, 47, 49, 52, 55, 58, 61: median 48, Q_1 = 45, Q_3 = 55, IQR 10, fences 30 and 70, so there are no outliers.
- Oak Street typically: median 240 against 220. Elm Street had the most expensive house, 420, above every Oak price. Oak’s middle half is more spread out, IQR 60 against 40. (Elm’s fences, 140 and 300, confirm the dot at 420 is an outlier.)
- A whisker says the data reach that far. The last value inside the fence is the farthest value that is not an outlier; between it and the fence there are no values, so a whisker to the fence would draw data that do not exist.
- The rule only flags a value as far from the rest; it cannot say why. A flagged value may be a typo, which is corrected from the record, or a real extreme, such as a large house or a school trip, which is part of the data and stays. Deleting real extremes hides exactly what the dot is there to show.
- With no values beyond the fences, the largest value that is not an outlier is the maximum, and the smallest is the minimum. Both whiskers reach the extremes and there are no dots, which is the standard plot.
- No. The median lies between Q_1 and Q_3, and the fences lie 1.5\,\text{IQR} beyond those, so the median is always inside both fences.
- The quartiles stay the same, and the fences move out to 2\,\text{IQR} from the box. A value beyond a wider fence is also beyond the narrower one, so every outlier under 2 is an outlier under 1.5; some under 1.5 may not be under 2.