Title: Continuous variable: box plots
Course: UGQuants (SSPS) > Section: Data Visualisation

Continuous variable: box plots

Similar to histograms, box plots are intended to give an overview of a distribution, its shape, spread and typical values.  In contrast to histograms, box plots have several values marked directly on the graph (notably the median, 25th and 75th percentiles), which can make them more useful for identifying specific values which can be used to illustrate a discussion around the nature of a distribution.

The figure below shows a vertical box plot and the main pieces of information which can be read from it.

The median can be taken as an indication of the central tendency of the distribution, while the distance between the 25th and 75th percentiles is known as the Interquartile Range.  This tell us the range between which the middle 50% of cases lie.  This provides an indication of how values in the middle distribution are spread relative to the median: are they tightly bunched around the median, are they equally balanced, or are cases skewed to one side of the median?

The vertical lines at the top and bottom of the above figure are slightly more complex to interpret, as their meaning varies depending on whether or not the variable being considered has any extreme values.  In many cases, where there are no extreme values at either end of the distribution, these “whiskers” represent the lowest and highest values recorded in the variable.  As with the 25th and 75th percentiles, considering how these values appear relative to the median can help identify and skewness in the distribution.  The stylised example above represent a normally distributed variable, the median is in the middle, the 25th and 75th percentiles are symmetrically apart from the median, as are the whiskers for the highest and lowest value (there are no outliers).

In contrast, consider the graph below.  This shows a box plot for the % of female representatives in the national parliaments of 124 countries, taken from the 2010 United Nations Human Development Index.  Looking at this boxplot, we see:

1. The median value is approximately 16%.
2. The 25th Percentile is around 10.3%, while the 75th percentile is around 25%, giving an Interquartile Range of approximately 14.5%

However, in contrast to our stylized boxplot above, this figure shows two cases (Andorra and Rwanda) which appear outside the whiskers of the graph.  If these whiskers are meant to represent the highest and lowest values of the variable, how can this be?

Where a distribution includes some extremely low or high values, the whiskers of the box plot no-longer represent the highest and lowest values recorded in the variable. Instead, they are placed at 1.5 times the length of the Interquartile range from the end of the Interquartile range.  With any values falling outside these values being considered outliers.

Hence, in the above example, the upper whisker is placed at a point 1.5 times the length of the interquartile range above the 75th percentile, approximately 45%-46%.  The cases of Andorra and Rwanda have higher levels of female representation in Parliament than this value, and so are identified as outliers.  In contrast, there are no outliers at the bottom end of the distribution, so that whisker still represents the lowest value recorded in the variable.

Finally, in interpreting a boxplot, it is worth considering the relative position of the median, 25th and 75th percentiles, along with the two whiskers, and the presence of any  outliers simultaneously.  As mentioned above, a normally distributed variable will provide a boxplot with no outliers, the median in the centre and the 25th/75th percentiles, maximum and minimum values all equally spaced.  Compare this to the example of female representation in Parliament shown above.  In this case, the median value is towards the bottom end of the graph, the distance between the 25th percentile and the median is smaller than that between the median and 75th percentile, and there are outlying cases at the upper end of the distribution.  This represents a variable where most cases appear towards the lower end of the distribution, with a smaller number of cases exhibiting the higher values (see density plot below).

SPSS does not offer this graph in its graphs menu, but you can ask it to produce a Kernel density plot by using syntax. You can find the code here .