Box Plot
Study guide: Exam MAS-I
A Box Plot (box-and-whisker plot) is a plot that summarizes a sample's distribution by its median, its first quartile Q_1 and third quartile Q_3, and its outliers. The box runs from Q_1 to Q_3 and holds the middle half of the data, with a line at the median. The interquartile range is
\text{IQR} = Q_3 - Q_1
The lower and upper fences are
Q_1 - 1.5\,\text{IQR} \quad \text{and} \quad Q_3 + 1.5\,\text{IQR}
An observation outside a fence, more than 1.5\,\text{IQR} beyond the box, is an outlier. Each whisker extends to the most extreme observation that is not an outlier, so it ends at a data value, not at the fence. Each outlier is plotted individually beyond the whiskers.
The quartiles are found here by the median of halves. Order the n observations and find the median. Q_1 is the median of the values below the median, and Q_3 is the median of the values above it. When n is odd, the median itself is left out of both halves. Software uses several other quartile definitions, which can give slightly different quartiles and fences.
Eleven claim amounts, in thousands, are 2, 3, 4, 5, 6, 7, 8, 9, 11, 14 and 40. What are the quartiles, the fences and the outliers of their box plot?
- With
n = 11, the median is the 6th value, 7.- The lower half is 2, 3, 4, 5, 6, so
Q_1 = 4. The upper half is 8, 9, 11, 14, 40, soQ_3 = 11.\text{IQR} = 11 - 4 = 7, so the fences are4 - 10.5 = -6.5and11 + 10.5 = 21.5.- 40 is above 21.5, so it is the one outlier, and the upper whisker ends at 14.
Comparing groups with side-by-side box plots
Side-by-side box plots, one for each level of a categorical predictor, compare the response's median, spread and outliers across the levels. They show whether the response differs by level:
- The location of a box, its median and its position, is the evidence for a difference in the mean. Levels with nearly identical boxes and medians can be grouped into one level, while a clearly shifted box suggests a separate level.
- Skewness shows as asymmetry within a box plot, such as an upper whisker and upper half of the box longer than the lower ones. Shorter whiskers indicate a smaller scale, not skewness.
- A few outliers are individual extreme observations, so they are weak evidence that a level's typical response differs.
- For a Gamma severity response, the standard deviation grows with the mean, so levels with larger medians also show larger spreads.
Box plots of severity for three vehicle classes have medians of 3.1, 3.3 and 6.8 thousand. The first two boxes overlap almost completely, and the third is higher and wider, with a few high outliers. What do they show?
- The first two classes have nearly the same box and median, so they can be grouped into one level.
- The third class's box is clearly shifted upward, so it needs its own level.
- Its wider box is consistent with a Gamma response, whose spread grows with its mean.
What a box plot does not show
A box plot reduces a sample to a few numbers, so it hides some features of the data:
- It cannot show two humps, because a unimodal and a bimodal sample can have the same quartiles.
- It does not show how many observations share a value, because repeated identical values are drawn as one point. A pile-up at one value is revealed by a histogram.
- It discards time order, so it cannot show a change at a point in time.
Ending the whisker at the fence The fence is a cut-off, not a data value. The whisker stops at the most extreme observation inside the fence, which in the example is 14, not 21.5.