Box and Whisker Plot

 

Menu location: Graphics_Box and Whisker.

 

Box and Whisker plots, described by Tukey (1977), give a pictorial representation of nonparametric descriptive statistics.

 

In nonparametric terms, the central "box" represents the distance between the first and third quartiles (or the Tukey hinges when selected) with the median between them marked with a diamond, with the minimum as the origin of the leading "whisker" and with the maximum as the limit of the trailing "whisker".

 

The default Median, quartiles and range uses the conventional definition in descriptive statistics (StatsDirect centile type 2): with the data sorted into ascending order, the lower quartile is the (n+1)/4th value and the upper quartile the 3(n+1)/4th value, interpolating between neighbouring values. In R these are quantile(x, c(0.25, 0.5, 0.75), type = 6). This default is unchanged.

 

Choose Tukey hinges (median of each half) for the definition used by R's standard boxplot() and fivenum(). Split the ordered values into lower and upper halves, including the overall median in both halves when the sample size is odd; the medians of those halves are the hinges. Hinges can differ from the interpolated quartiles, especially in small samples. For example, values 1 to 5 give interpolated quartiles 1.5 and 4.5, but Tukey hinges 2 and 4. This choice is StatsDirect's seventh box-plot method; it is not R's quantile(type = 7).

 

The inner and outer fences use 1.5 and 3 times the distance between the selected quartiles or hinges. With only the outer fence selected, whiskers extend to the last observations within 3 times that distance; with neither fence selected, they extend to the minimum and maximum. The optional mean marker is available with either nonparametric definition.

 

This convention can also be extended to parametric representation of data using the arithmetic mean bounded by one standard deviation or by its confidence interval. StatsDirect enables you to choose one of these two parametric schemes or the nonparametric scheme for each plot. See descriptive statistics for the formulae used.

 

This is a useful way to present data to an audience; it is often easier to convey the central location and spread of values pictorially than by quoting a list of descriptive statistics.

 

If you tick the fence options (both are ticked by default) then each whisker stops at the last data point inside the fence and any data points beyond it are plotted as circles: hollow for points beyond the inner fence and filled for points beyond the outer fence. This form of box and whisker plot is often used to represent outliers. For the nonparametric plots, the inner fences are the lower and upper quartiles or hinges minus and plus 1.5 times their difference, and the outer fences 3 times that difference. For the parametric plots, the inner fences are the mean minus and plus 1.96 standard deviations, and the outer fences 2.58 standard deviations.

 

 

Example

Test workbook (Nonparametric worksheet: CMT 64, CMT 167, CMT 170, CMT 175, CMT 181).

 

The plot above shows the numbers of lung metastases found in mice inoculated with five cell lines of increasing metastatic potential (Cuzick, 1985), the data of the Cuzick trend test example.

 

To draw it in StatsDirect open the test workbook using the file open function of the file menu. Then select Box and Whisker from the Graphics menu and select the five columns marked "CMT 64" to "CMT 181" when prompted for data. The chart options are then shown: the type of plot is "Median, quartiles and range" and both fence options are ticked by default. The plot above was drawn with the two fence options unticked and with the chart title changed.

 

For this example, with the data of each column sorted into ascending order:

 

CMT 64: n = 8, min = 0, LQ = 0.25, median = 1.5, UQ = 3.5, max = 9

CMT 167: n = 10, min = 0, LQ = 3.75, median = 9.5, UQ = 23.5, max = 97

CMT 170: n = 9, min = 2, LQ = 4.5, median = 10, UQ = 11.5, max = 21

CMT 175: n = 9, min = 0, LQ = 4, median = 10, UQ = 78, max = 132

CMT 181: n = 9, min = 2, LQ = 5, median = 6, UQ = 28.5, max = 60

 

Each box runs from LQ to UQ with the median marked by a diamond, and with the fences unticked, as above, the whiskers run from the minimum to the maximum. With the default fences, the inner fences of CMT 64 are -4.625 to 8.375 (the quartiles minus and plus 1.5 times the interquartile range of 3.25), so the value 9 lies beyond the inner fence and is plotted as a hollow circle with the whisker stopping at 4; for CMT 167 the upper outer fence is 82.75 (23.5 plus 3 times 19.75), so 97 is plotted as a filled circle and the whisker stops at 25. The plot shows the medians of the last four cell lines close together while the spread of the counts, and the upper whiskers in particular, widens greatly: the counts are skewed with a long upper tail, which is why the trend across the lines is tested by ranks (Cuzick's test) rather than by means.

 

See also the Box and whisker plot (text).