Sub topic 9
Reading a Boxplot
This chapter assumes you can find the median, the quartiles, the range, and the interquartile range (IQR) of a small data set, and that you can read a labeled number line. Earlier chapters covered how to compute these values. Here you will learn to read them back out of a picture, which is how the GRE usually presents them.
What a Boxplot Shows
A boxplot (also called a box-and-whisker plot) is a picture of the five-number summary drawn along a number line. The five numbers are the minimum, the first quartile (Q1), the median (Q2), the third quartile (Q3), and the maximum.
The parts of the picture map to those numbers as follows:
| Part of the picture | What it marks |
|---|---|
| Left end of the lower whisker | Minimum (when there are no outliers) |
| Left edge of the box | Q1, the first quartile |
| Line inside the box | Median, also called Q2 |
| Right edge of the box | Q3, the third quartile |
| Right end of the upper whisker | Maximum (when there are no outliers) |
A boxplot may be drawn horizontally or vertically. A vertical plot has the same parts, with the minimum at the bottom and the maximum at the top. The scale appears on one axis only. The other direction carries no information, so the box's thickness means nothing.
Each Section Holds About a Quarter of the Data
The five marks cut the ordered data into four sections. Each section holds about 25% of the values:
- From the minimum to Q1.
- From Q1 to the median.
- From the median to Q3.
- From Q3 to the maximum.
The data is split into equal portions, but the picture is not split into equal lengths. A short section means the values in that quarter are packed closely together. A long section means they are spread out. The length of a section tells you about spread, not about how many values it holds.
Two consequences follow, and the GRE tests both:
- The box, from Q1 to Q3, holds about 50% of the data. The IQR is the width of the box.
- The median line splits the box into two parts that each hold about 25% of the data, even when the line is not centered.
Reading the Numbers Off the Axis
To read a boxplot, find each of the five marks and read its value from the axis. If a mark falls between tick marks, estimate its position proportionally. The GRE normally uses plots where the key marks land on labeled ticks, or it asks only for approximate answers.
Suppose a boxplot of exam scores for a class has these marks:
- Minimum 52
- Q1 64
- Median 70
- Q3 82
- Maximum 95
From these you can compute:
- Range: 95 − 52 = 43
- IQR: 82 − 64 = 18
- Lower whisker length: 64 − 52 = 12
- Upper whisker length: 95 − 82 = 13
- Median to Q1: 70 − 64 = 6
- Q3 to median: 82 − 70 = 12
You can also answer statements about percentages of the class:
- About 75% of scores are at least 64, because 25% fall below Q1.
- About 50% of scores are between 64 and 82.
- About 25% of scores are above 82.
- About half of the scores are 70 or below, and half are 70 or above.
If the class has 200 students, about 50 of them scored between 70 and 82. Every statement of this kind says "about," because ties and odd-sized data sets can shift the exact counts slightly.
The same arithmetic works as a short program. The function below takes the five numbers and returns the lengths a reader would measure on the plot. It uses the data set from the earlier chapters, [3, 5, 7, 8, 12, 13, 14, 18, 21], whose five-number summary is 3, 6, 12, 16, 21.
def read_boxplot(minimum, q1, median, q3, maximum):
return {
"range": maximum - minimum,
"iqr": q3 - q1,
"lower whisker length": q1 - minimum,
"median minus Q1": median - q1,
"Q3 minus median": q3 - median,
"upper whisker length": maximum - q3,
}
summary = read_boxplot(3, 6, 12, 16, 21)
for name, value in summary.items():
print(f"{name}: {value}")This prints a range of 18, an IQR of 10, a lower whisker of 3, 6 from Q1 to the median, 4 from the median to Q3, and an upper whisker of 5.
Reading Shape from Lengths
You cannot see individual values, but the lengths of the sections give you clues about how the data is distributed.
- Median position in the box. If the median is closer to Q1 than to Q3, the values between Q1 and the median are packed more tightly than those between the median and Q3. In the exam example above, 70 is 6 above Q1 and 12 below Q3, so the lower-middle quarter is more compact.
- Whisker lengths. A long upper whisker means the top quarter of the data is spread over a wide interval. A short whisker means the top quarter is tightly packed.
- Overall width. A wide box means a large IQR, so the middle half of the data is spread out. A narrow box means the middle half is concentrated.
A longer tail on the right is usually called right skew, and a longer tail on the left is left skew. Treat these as hints. The GRE tends to ask only what you can state from the marks, such as "which section is longest."
Whiskers and Outliers
In the simplest boxplot, the whiskers run all the way to the minimum and maximum. Many plots, including those on the GRE when a problem states the rule, treat extreme values differently. A value is an outlier when it is below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. Outliers are drawn as separate points beyond the whiskers, and each whisker ends at the most extreme value that is not an outlier.
For the data set above, Q1 = 6, Q3 = 16, and IQR = 10, so the fences are −9 and 31. A value of 40 would appear as a lone dot, and the upper whisker would end at the largest value of 31 or below.
def outlier_fences(q1, q3):
iqr = q3 - q1
return q1 - 1.5 * iqr, q3 + 1.5 * iqr
low, high = outlier_fences(6, 16)
print(low, high) # -9.0 31.0This changes how you read the plot. When separate points appear, the range is the distance from the lowest point to the highest point, including the dots, not the length of the whiskers. The whisker ends are no longer the minimum and maximum. If a problem shows no dots, assume the whiskers end at the minimum and maximum unless the problem says otherwise.
What a Boxplot Cannot Tell You
A boxplot compresses a data set into five numbers, so some questions cannot be answered from it.
| Question | Answerable from a boxplot? |
|---|---|
| What is the median? | Yes |
| What is the IQR or range? | Yes |
| About what percent of values are above Q3? | Yes, about 25% |
| What is the mean? | No |
| How many values are in the data set? | No |
| Is a specific value, such as 75, in the data set? | No |
| How many values are exactly equal to the median? | No |
| Is the data bunched in one spot inside the box? | No |
Two data sets of very different sizes, or with very different insides, can produce the same boxplot. For example, 8 values and 800 values can share one five-number summary.
Common Mistakes
- Treating the quartile as a percent. Q1 is a value on the axis, such as 64 points. It is not "25%." The percent of the data below Q1 is about 25%. The value of Q1 is a score, a height, or a price.
- Assuming equal length means equal data. Each section holds about 25% of the values no matter how long it looks. A longer section does not hold more data, and a short section does not hold less.
- Reading the box as the whole range. The box shows the middle 50%. The range includes the whiskers, and any dots as well.
- Mixing up the IQR and the range. The IQR is Q3 − Q1, the width of the box. The range is the maximum minus the minimum.
- Reading the median as the center of the box. The median line sits wherever the middle value falls. Only a symmetric middle half puts it exactly at the center of the box.
- Counting from the wrong end of a section. "About 75% of values are at least Q1" is correct, because 25% are below it. Check which side of the mark a statement refers to.
A Quick Procedure for Boxplot Questions
- Read the axis and identify which of the five marks the question is about.
- Write down the five values, estimating if the marks fall between ticks.
- Decide whether the question is about a value (a number on the axis) or a percent of the data (a multiple of about 25%).
- For spread, use the IQR for the middle half and the range for the whole data set.
- Check each answer choice against what the plot supports.
Exercise
A boxplot of delivery times in minutes has these marks: minimum 12, Q1 20, median 26, Q3 44, maximum 70, with no outliers. (a) What are the range and the IQR? (b) About what percent of deliveries took longer than 26 minutes? (c) Which is longer, the section from Q1 to the median or the section from the median to Q3, and does the longer one hold more deliveries?
Show answer
(a) The range is 70 − 12 = 58 minutes. The IQR is 44 − 20 = 24 minutes. (b) The median splits the data in half, so about 50% of deliveries took longer than 26 minutes. (c) The section from the median to Q3 is longer (18 minutes versus 6 minutes). It does not hold more deliveries. Each section holds about 25% of them. The longer section means those deliveries are more spread out in time.
Exercise
A boxplot of 80 test scores has Q1 = 55 and Q3 = 75. A student says, "Since Q3 is 75, 75% of the students scored 75 points." What is wrong with this statement, and what can you correctly say about the scores?
Show answer
The student has confused a quartile with a percent. Q3 = 75 is a score on the axis, and it means about 75% of the students scored 75 or lower, not that 75% scored 75 points. About 25% of the 80 students, roughly 20 of them, scored above 75, and about 50% of them, roughly 40, scored between 55 and 75.