2.3: Box-and-Whisker Plots
Learning Objectives
- Calculate the values of the \begin{align*}5-\end{align*}number summary.
- Draw and translate data sets to and from a box-and-whisker plot.
- Interpret the shape of a box-and-whisker plot.
- Compare distributions of univariate data (shape, center, spread, and outliers).
- Describe the effects of changing units on summary measures.
Introduction
In this section we will round out our investigation of different types of visual displays by introducing the box-and-whisker plots. The basic ideas of shape, center, spread, and outliers will be investigated in this context and students will be asked to become proficient in translating and interpreting graphs of univariate data of the various types.
The Five-Number Summary
The five-number summary is a numerical description of a data set comprised of the following measures (in order):
Minimum value, lower quartile, median, upper quartile, maximum value.
In order to review finding these values from Chapter One, let’s turn to another recycling/conservation related issue. The huge population growth in the western United States in recent years, along with a trend toward less annual rainfall in many areas and even drought conditions in others, has put tremendous strain on the water resources available now and the need to protect them in the years to come. Here is a listing of the reservoir capacities of the major water sources for Arizona:
Lake/Reservoir | \begin{align*}\%\end{align*} of Capacity |
---|---|
Salt River System | \begin{align*}59\end{align*} |
Lake Pleasant | \begin{align*}49\end{align*} |
Verde River System | \begin{align*}33\end{align*} |
San Carlos | \begin{align*}9\end{align*} |
Lyman Reservoir | \begin{align*}3\end{align*} |
Show Low Lake | \begin{align*}51\end{align*} |
Lake Havasu | \begin{align*}98\end{align*} |
Lake Mohave | \begin{align*}85\end{align*} |
Lake Mead | \begin{align*}95\end{align*} |
Lake Powell | \begin{align*}89\end{align*} |
Figure: Arizona Reservoir Capacity, 12 / 31 / 98. Source: http://www.seattlecentral.edu/qelp/sets/008/008.html
This data was collected in 1998 and the water levels in many states have taken a dramatic turn for the worse. For example, Lake Powell is currently at less than \begin{align*}50 \%\end{align*} of capacity\begin{align*}^1\end{align*}.
Placing the data in order from smallest to largest gives:
\begin{align*}3, 9, 33, 49, 51, 59, 85, 89, 95, 98\end{align*}
With \begin{align*}10\end{align*} numbers, the median would be between \begin{align*}51\end{align*} and \begin{align*}59\end{align*}, or \begin{align*}55\end{align*}. Recall that the lower quartile is the \begin{align*}25^{th}\end{align*} percentile, or where \begin{align*}25 \%\end{align*} of the data is below that value. In this data set, that number is \begin{align*}33\end{align*}. Similarly, the upper quartile is \begin{align*}89\end{align*}. Therefore the five-number summary is:
\begin{align*}\left \{3, 33, 55, 89, 98 \right \}\end{align*}
Box-and-Whisker Plots
A box-and-whisker plot is a very convenient and informative way to represent single-variable data. To create the “box” part of the plot, draw a rectangle that extends from the lower quartile to the upper quartile. Draw a line through the interior of the rectangle at the median. Then we connect the ends of the box to the minimum and maximum values using a line segment to form the “whisker”. Here is the box plot for this data:
The plot divides the data into quarters. If the number of data points is divisible by \begin{align*}4\end{align*}, then there will be exactly the same number of values in each of the two whiskers, as well as the two sections in the box. In this example, because there are \begin{align*}10\end{align*} data points, it will only be approximately the same, but approximately \begin{align*}25 \%\end{align*} of the data appears in each section. You can also usually learn something about the shape of the distribution from the sections of the plot. If each of the four sections of the plot is about the same length, then the data will be symmetric. Of course, it could be uniform or bimodal also, so you would have to also look at a dot plot or histogram to get a more complete picture of the shape.
In this example, the different sections are not exactly the same length. The left whisker is slightly longer than the right, and the right half of the box is slightly longer than the left. We would most likely say that this distribution is moderately symmetric. Many students initially incorrectly interpret this to mean that longer sections contain more data and shorter ones contain less. This is not true and it is important to remember that roughly the same amount of data is in each section. What this does tell us is how the data is spread in each of those sections. The numbers in the left whisker (lowest \begin{align*}25 \%\end{align*} of the data) are spread more widely than those in the right whisker.
Here is the box plot (as the name is sometimes shortened) for reservoirs and lakes in Colorado:
In this case, the third quarter of data (between the median and upper quartile), appears to be a bit more densely concentrated in a smaller area. The data in the lower whisker also appears to be much more widely spread than it is in the other sections. Looking at the dot plot for the same data shows that this spread in the lower whisker gives the data a slightly skewed left appearance (though it is still roughly symmetric).
Comparing Multiple Box Plots: Resistance Revisited
Box and Whisker plots are often used to get a quick and efficient comparison of the general features of multiple data sets. In the previous example, we looked at data for both Arizona and Colorado. How do their reservoir capacities compare? You will often see multiple box plots either stacked on top of each other, or drawn side-by-side for easy comparison. Here are the two box plots:
The plots seem to be spread the same if we just look at the range, but with the box plots, we have an additional indicator of spread if we examine the length of the box (or Interquartile Range). This tells us how the middle \begin{align*}50 \%\end{align*} of the data is spread, and Arizona’s appears to have a wider spread. The center of the Colorado data (as evidenced by the location of the median) is higher, which would tend to indicate that, in general, Arizona’s capacities are lower. In the first chapter we talked about the concept of resistance. Recall that the median is a resistant measure of center because it is not affected by outliers, but the mean is not resistant because it will be pulled toward outlying points. This is also true of skewed data. When a data set is skewed strongly in a particular direction, the mean will be pulled in the direction of the skewing, but the median will not be affected. For this reason, the median is a more appropriate measure of center to use for strongly skewed data.
Even though we wouldn’t characterize either of these data sets as strongly skewed, this affect is still visible. Here are both distributions with the means plotted for each.
Notice that the long left whisker in the Colorado data causes the mean to be pulled toward the left, making it lower than the median. In the Arizona plot, you can see that the mean is slightly higher than the median due to the slightly elongated right side of the box. If these data sets were perfectly symmetric, the mean would be equal to the median in each case.
Outliers in Box-and-Whisker Plots
Here is the reservoir data for California (the names of the lakes and reservoirs have been omitted):
\begin{align*}80, 83, 77, 95, 85, 74, 34, 68, 90, 82, 75\end{align*}
At first glance, the 34 should stand out. It appears as if this point is significantly isolated from the rest of the data, which is the textbook definition of an outlier. Let’s use a graphing calculator to investigate this plot. Enter your data into a list as we have done before, and then choose a plot. Under Type, you will notice what looks like two different box and whisker plots. For now choose the second one (even though it appears on the second line, you must press the right arrow to select these plots).
Setting a window is not as important for a box plot, so we will use the calculator’s ability to automatically scale a window to our data by pressing [ZOOM] and select number \begin{align*}9\end{align*} (ZoomStat).
While box plots give us a nice summary of the important features of a distribution, we lose the ability to identify individual points. The left whisker is elongated, but if we did not have the data, we would not know if all the points in that section of the data were spread out, or if it were just the result of the one outlier. It is more typical to use a modified box plot. This box plot will show an outlier as a single, disconnected point and will stop the whisker at the previous point. Go back and change your plot to the first box plot option, which is the modified box plot, and press then graph it.
Notice that without the outlier, the distribution is really roughly symmetric.
This data set had one obvious outlier, but when is a point far enough away to be called an outlier? We need a standard accepted practice for defining an outlier in a box plot. This rather arbitrary definition is that any point that is more than \begin{align*}1.5 \;\mathrm{times}\end{align*} the Interquartile Range will be considered an outlier. Because the IQR is the same as the length of the box, any point that is more than 1 and a half box lengths from either quartile is plotted as an outlier.
A common misconception of students is that you stop the whisker at this boundary line. In fact, the last point on the whisker that is not an outlier is where the whisker stops.
The calculations for determining the outlier in this case are as follows:
Lower Quartile: \begin{align*}74\end{align*}
Upper Quartile: \begin{align*}85\end{align*}
Interquartile range(IQR): \begin{align*}85 - 74 = 11\end{align*}
\begin{align*}1.5 * \mathrm{IQR} = 16.5\end{align*}
Cut-off for outliers in left whisker: \begin{align*}74 - 16.5 = 57.5\end{align*}
Notice that we did not even bother to test the calculation on the right whisker because it should be obvious from a quick visual inspection that there are no points that are farther than even one box length away from the upper quartile.
If you press [ZOOM], and use the left or right arrows, the calculator will trace the values of the five-number summary, as well as the last point on the left whisker.
The Effects of Changing Units on Shape, Center, and Spread
In the previous lesson, we looked at data for the materials in a typical desktop computer.
Material | Kilograms |
---|---|
Plastics | \begin{align*}6.21\end{align*} |
Lead | \begin{align*}1.71\end{align*} |
Aluminum | \begin{align*}3.83\end{align*} |
Iron | \begin{align*}5.54\end{align*} |
Copper | \begin{align*}2.12\end{align*} |
Tin | \begin{align*}0.27\end{align*} |
Zinc | \begin{align*}0.60\end{align*} |
Nickel | \begin{align*}0.23\end{align*} |
Barium | \begin{align*}0.05\end{align*} |
Other elements and chemicals | \begin{align*}6.44\end{align*} |
Here is a similar set of data given in pounds.
Material | Pounds |
---|---|
Plastics | \begin{align*}13.7\end{align*} |
Lead | \begin{align*}3.8\end{align*} |
Aluminum | \begin{align*}8.4\end{align*} |
Iron | \begin{align*}12.2\end{align*} |
Copper | \begin{align*}4.7\end{align*} |
Tin | \begin{align*}0.6\end{align*} |
Zinc | \begin{align*}1.3\end{align*} |
Nickel | \begin{align*}0.5\end{align*} |
Barium | \begin{align*}0.1\end{align*} |
Other elements and chemicals | \begin{align*}14.2\end{align*} |
The source of this data set was in India, so like much of the rest of the world, the data was given in metric units, or kilograms. If we want to convert these weights to pounds, what would be different about this distribution? To convert from kilograms to pounds, we multiply the number of kilograms times \begin{align*}2.2\end{align*}. Think about how, if at all, the shape, center, and spread would change. If you multiple all values by a factor of \begin{align*} 2.2\end{align*}, then the calculation of the mean would also be multiplied by \begin{align*}2.2\end{align*}, so the center of the distribution should be increased by the same factor. Similarly, calculations of the range, interquartile range, and standard deviation will also be increased by the same factor. So the center and the measures of spread will increase proportionally. This should result in the graph maintaining the same shape, but being stretched out or elongated. Here are the side-by-side box plots for both distributions showing the effects of changing units.
Lesson Summary
The five-number summary is useful collection of statistical measures consisting of the following in ascending order:
Minimum, lower quartile, median, upper quartile, maximum
A Box-and-Whisker Plot is a graphical representation of the five-number summary showing a box bounded by the lower and upper quartiles and the median as a line in the box. The whiskers are line segments extended from the quartiles to the minimum and maximum values. Each whisker and section of the box contains approximately \begin{align*}25 \%\end{align*} of the data. The width of the box is the interquartile range (IQR), and shows the spread of the middle \begin{align*}50 \%\end{align*} of the data. Box-and-whisker plots are effective at giving an overall impression of the shape, center, and spread. While an outlier is simply a point that is not typical of the rest of the data, there is an accepted definition of an outlier in the context of a box-and-whisker plot. Any point that is more than \begin{align*}1.5 \;\mathrm{times}\end{align*} the length of the box (IQR) from either end of the box, is considered to be an outlier. When changing units of a distribution, the center and spread will be affected, but the shape will stay the same.
Points to Consider
- What characteristics of a data set make it easier or harder to represent it using dot plots, stem and leaf plots, histograms, and box and whisker plots?
- Which plots are most useful to interpret the ideas of shape, center, and spread?
- What effects do other transformations of the data have on the shape, center, and spread?
Review Questions
- Here is the 1998 data on the percentage of capacity of reservoirs in Idaho. \begin{align*}70, 84, 62, 80, 75, 95, 69, 48, 76, 70, 45, 83, 58, 75, 85, 70, \\
62, 64, 39, 68, 67, 35, 55, 93, 51, 67, 86, 58, 49, 47, 42, 75\end{align*}
- Find the five-number summary for this data set.
- Show all work to determine if there are true outliers according to the \begin{align*}1.5 * \mathrm{IQR}\end{align*} rule.
- Create a box-and-whisker plot showing any outliers.
- Describe the shape, center, and spread of the distribution of reservoir capacities in Idaho in 1998.
- Based on your answer in part d., how would you expect the mean to compare to the median? Calculate the mean to verify your expectation.
- Here is the 1998 data on the percentage of capacity of reservoirs in Utah. \begin{align*}80, 46, 83, 75, 83, 90, 90, 72, 77, 4, 83, 105, 63, 87, 73, 84, 0, 70, 65, 96, 89, 78, 99, 104, 83, 81\end{align*}
- Find the five-number summary for this data set.
- Show all work to determine if there are true outliers according to the \begin{align*}1.5 * \mathrm{IQR}\end{align*} rule.
- Create a box-and-whisker plot showing any outliers.
- Describe the shape, center, and spread of the distribution of reservoir capacities in Utah in 1998.
- Based on your answer in part d., how would you expect the mean to compare to the median? Calculate the mean to verify your expectation.
- Graph the box plots for Idaho and Utah on the same axes. Write a few statements comparing the water levels in Idaho and Utah by discussing the shape, center, and spread of the distributions.
- If the median of a distribution is less than the mean, which of the following statements is the most correct?
- The distribution is skewed left.
- The distribution is skewed right.
- There are outliers on the left side.
- There are outliers on the right side.
- b or d could be true.
- The following table contains recent data on the average price of a gallon of gasoline for states that share a border crossing into Canada.
- Find the five-number summary for this data.
- Show all work to test for outliers.
- Graph the box-and-whisker plot for this data.
- Canadian gasoline is sold in liters. Suppose a Canadian crossed the border into one of these states and wanted to compare the cost of gasoline. There are approximately \begin{align*}4 \;\mathrm{liters}\end{align*} in a gallon. If we were to convert the distribution to liters, describe the resulting shape, center, and spread of the new distribution.
- Complete the following table. Convert to cost per liter by dividing by \begin{align*}3.7854\end{align*} and then graph the resulting box plot.
As an interesting extension to this problem, you could look up the current data and compare that distribution with the data presented here. You could also find the exchange rate for Canadian dollars and convert the prices into the other currency.
State | Average Price of a Gallon of Gasoline \begin{align*}(\mathrm{US} \$)\end{align*} | Average Price of a Liter of Gasoline \begin{align*}(\mathrm{US} \$)\end{align*} |
---|---|---|
Alaska | \begin{align*}3.458\end{align*} | |
Washington | \begin{align*}3.528\end{align*} | |
Idaho | \begin{align*}3.26\end{align*} | |
Montana | \begin{align*}3.22\end{align*} | |
North Dakota | \begin{align*}3.282\end{align*} | |
Minnesota | \begin{align*}3.12\end{align*} | |
Michigan | \begin{align*}3.352\end{align*} | |
New York | \begin{align*}3.393\end{align*} | |
Vermont | \begin{align*}3.252\end{align*} | |
New Hampshire | \begin{align*}3.152\end{align*} | |
Maine | \begin{align*}3.309\end{align*} |
Average Prices of a Gallon of Gasoline on March 16, 2008
Figure: Average prices of a gallon of gasoline on March 16, 2008. Source: AAA, http://www.fuelgaugereport.com/sbsavg.asp
Review Answers
- (a) \begin{align*}{35, 53, 67.5, 75.5, 95}\end{align*} (b) \begin{align*}\mathrm{IQR} &= 22.5.\\ 1.5 * \mathrm{IQR}& = 33.75\end{align*} Upper bound for outliers \begin{align*}> 33.75 + 75.5 = 109.25\end{align*}. There is no data above \begin{align*}95\end{align*} Lower bound for outliers \begin{align*}< 53 - 33.75 = 19.25\end{align*}. There is no data below \begin{align*}35\end{align*}, so there are no outliers. (c) (d) The distribution of Idaho reservoir capacities is roughly symmetric and is centered somewhere in the middle 60 percents. The capacities range from \begin{align*}35\end{align*} up to \begin{align*}95\end{align*} and the middle \begin{align*}50 \%\end{align*} of the data is between \begin{align*}53\end{align*} and \begin{align*}75.5 \%\end{align*}. (e) The data between the median and the upper quartile is slightly more compressed which causes the median to be slightly larger than the median. The mean is approximately \begin{align*}65.7\end{align*}.
- (a) \begin{align*}\left \{0, 72, 82, 89, 105 \right \}\end{align*} (b) \begin{align*}\mathrm{IQR} &= 17.\\ 1.5 * \mathrm{IQR} &= 25.5\end{align*} Upper bound for outliers \begin{align*}> 25.5 + 89 = 114.5\end{align*}. There is no data above \begin{align*}105\end{align*} Lower bound for outliers \begin{align*}< 72 - 25.5 = 49.5. 63\end{align*} is the last value that is above this point, so \begin{align*}0, 4\end{align*}, and 46 are all outliers \begin{align*}35\end{align*}. (c) (d) The distribution of Utah reservoir capacities has three outliers. If those points were removed, the distribution is roughly symmetric and is centered somewhere in the low \begin{align*}80\end{align*} percents. The capacities range from \begin{align*}0\end{align*} up to \begin{align*}105\end{align*} including the outliers and the middle \begin{align*}50 \%\end{align*} of the data is between \begin{align*}72\end{align*} and \begin{align*}89 \%\end{align*}. (e) There are three extreme outliers, the mean is not resistant to the pull of outliers and there will be significantly lower than the median. The mean is approximately \begin{align*}75.4\end{align*}.
- If we disregard the three outliers, the distribution of water capacities in Utah is higher than that of Idaho at every point in the five number summary. From this we might conclude it is centered higher and that the reservoir system is overall at safer levels in Utah, than in Idaho. Again eliminating the outliers, both distributions are roughly symmetric and their spreads are also fairly similar. The middle \begin{align*}50 \%\end{align*} of the data for Utah is just slightly more closely grouped.
- (e) If the mean is greater than the median, then it has been pulled to the right either by an outlier, or by a skewed right shape. The median will not be affected by either of those things.
- (a) \begin{align*}{3.12, 3.22, 3.282, 3.393, 3.528}\end{align*} (b) \begin{align*}\mathrm{IQR} &= .173\!\\ 1.5 * \mathrm{IQR} &= .2595\end{align*} Upper bound for outliers \begin{align*}> .2595 + 3.393 = 3.6525\end{align*}. There is no data above \begin{align*}3.528\end{align*} Lower bound for outliers \begin{align*}< 3.22 - .2595 = 2.9605\end{align*}. There is no data below \begin{align*}3.12\end{align*}, so there are no outliers. (c) (d) By dividing the data by \begin{align*}3.7854\end{align*}, we will obtain the average cost per liter. The mean, median will be decreased, being divided by \begin{align*}3.7854\end{align*}. The same is true for the measures of spread (range, IQR, and standard deviation), which will result in the data being compressed into a smaller area if we were to graph both distributions on the same scale. The shape of the distributions will remain the same. (e)
State | Average Price of a Gallon of Gasoline \begin{align*}(\mathrm{US} \$)\end{align*} | Average Price of a Liter of Gasoline |
---|---|---|
Alaska | \begin{align*}3.458\end{align*} | \begin{align*}0.914\end{align*} |
Washington | \begin{align*}3.528\end{align*} | \begin{align*}0.932\end{align*} |
Idaho | \begin{align*}3.26\end{align*} | \begin{align*}0.861\end{align*} |
Montana | \begin{align*}3.22\end{align*} | \begin{align*}0.851\end{align*} |
North Dakota | \begin{align*}3.282\end{align*} | \begin{align*}0.867\end{align*} |
Minnesota | \begin{align*}3.12\end{align*} | \begin{align*}0.824\end{align*} |
Michigan | \begin{align*}3.352\end{align*} | \begin{align*}0.886\end{align*} |
New York | \begin{align*}3.393\end{align*} | \begin{align*}0.896\end{align*} |
Vermont | \begin{align*}3.252\end{align*} | \begin{align*}0.859\end{align*} |
New Hampshire | \begin{align*}3.152\end{align*} | \begin{align*}0.833\end{align*} |
Maine | \begin{align*}3.309\end{align*} | \begin{align*}0.874\end{align*} |
References
\begin{align*}^1\end{align*} Kunzig, Robert. Drying of the West. National Geographic, February 2008, Vol. 213, No. 2, Page 94.
Notes/Highlights Having trouble? Report an issue.
Color | Highlighted Text | Notes | |
---|---|---|---|
Show More |