Box and Whisker Plot (Text-based)

 

Menu location: Graphics_Box and Whisker (Text).

 

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 (an asterisk in the text-based plot), 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. In the text-based plot, a whisker stops at the active fence when observations extend beyond it; those observations are marked separately. The inner fence takes precedence when both fences are selected. With neither fence selected, whiskers 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.

 

Example

Test workbook (Nonparametric worksheet: Town Boys, Farm Boys).

 

These are the fitness scores of 36 boys from homes in the town and 12 boys from farm homes that are used in the Mann-Whitney U test example (Conover, 1999).

 

To draw this plot in StatsDirect open the test workbook using the file open function of the file menu. Then select Box and Whisker (Text) from the Graphics menu. Select the columns marked "Town Boys" and "Farm Boys" when prompted for data, and accept the default options (median, quartiles and range, with fences). The plot is written to the report window in a fixed-width font; the columns are listed from the top of the plot downwards, in the order they were selected.

 

For this example:

 

                            Box & whisker plot from test

 

              +

    Town Boys |   >-------------[.......*..............]-------------------<

              +

    Farm Boys |         >---------[............*........]----------<

              /+-------+-------+-------+-------+-------+-------+-------+---

               0.0     2.5     5.0     7.5     10.0    12.5    15.0    17.5

                   min < LQ < median > UQ > max, fences (1.5 & 3.0 IQR)

 

Each row is one column of data: the box runs from the lower quartile ([) to the upper quartile (]) with the median marked by an asterisk, and the whiskers run from the minimum (>) to the maximum (<). For Town Boys (n = 36) the minimum is 1, the lower quartile 5.15, the median 7.75, the upper quartile 12.4 and the maximum 18.6; for Farm Boys (n = 12) they are 2.7, 5.775, 9.8, 12.8 and 16.1. A value more than 1.5 interquartile ranges beyond a quartile, that is outside the inner fences (-5.725 to 23.275 for Town Boys and -4.7625 to 23.3375 for Farm Boys), would be plotted as a point (o) beyond a whisker that ends in a bar (|) at the fence, and a value more than three interquartile ranges beyond a quartile, outside the outer fences (-16.6 to 34.15 for Town Boys and -15.3 to 33.875 for Farm Boys), as a dot (.); there is none here, so the whiskers run to the extremes. The two groups of scores spread over similar ranges, with the farm boys' median the higher.

 

See also the graphical box and whisker plot.