Boxplot vs Histogram

Both terms below come up in the same part of the course, and students mix them up. Here is each one defined on its own, side by side, so you can see where they part company.

Boxplot

Graphs and displays

A boxplot pictures the five-number summary as a box from the first quartile to the third, a line at the median, and a whisker toward each extreme.

A boxplot draws exactly five numbers: the minimum, Q1Q_1 (Q one, the first quartile), the median, Q3Q_3, and the maximum. The box runs from Q1Q_1 to Q3Q_3, so its length is the interquartile range. In the modified version, the one normally drawn, any value beyond Q11.5×IQRQ_1 - 1.5 \times \text{IQR} or Q3+1.5×IQRQ_3 + 1.5 \times \text{IQR} is plotted as its own point and the whiskers stop at the most extreme values inside those fences. Quartiles here follow the median-excluded (TI-84) rule.

Two sets of eight values show what those five numbers cost. Set A is 10, 20, 30, 40, 60, 70, 80, 90. Set B is 10, 24, 26, 27, 73, 74, 76, 90. Both give minimum 10, Q1=25Q_1 = 25, median 50, Q3=75Q_3 = 75, maximum 90, an IQR of 50, no outliers, and a mean of 50, so the two boxplots are identical. Set A is spread evenly. Set B is two tight clumps with a hole through the middle, which a dotplot shows at a glance. A boxplot says nothing about where values sit inside a quarter, so it cannot show a second peak.

The other misreading appears whenever two boxplots share an axis: "group A's box sits entirely above group B's, so every student in A scored higher than every student in B." Take group A as 41, 62, 68, 72, 78, 82, 86, 95 and group B as 30, 44, 48, 55, 59, 61, 63, 85. A's box runs 65 to 84 and B's runs 46 to 62, so the two boxes never touch. B's top score of 85 still beats six of A's eight scores. A box covers the middle half of its group, not the group's range.

A boxplot also hides sample size completely: 8 observations and 800 with the same five numbers draw the same picture, so report nn beside it. When nn is small the five numbers nearly are the data, and a dotplot then shows everything the boxplot would and more. Boxplots are topic 1.8.

Full entry for boxplot

Histogram

Graphs and displays

A histogram displays quantitative data by grouping values into equal-width intervals and drawing a bar for the count in each interval.

A histogram cuts the number line into bins of equal width and draws a bar over each bin whose height is the count of values inside it, or the relative frequency. The bars touch because the axis is a continuous scale rather than a list of labels. Every histogram needs a boundary rule, and the usual one puts a value in the bin whose lower bound it meets or exceeds and whose upper bound it falls below.

Thirty exam scores binned by tens give 9 scores in 70 to 80 and 12 in 80 to 90, and three of those students scored exactly 80. Switch to the other convention, where a value belongs to the bin whose upper bound it equals, and those three move down: the counts become 12 and 9, the tallest bar changes, and so does the shape you would report. Nothing in the drawn picture tells you which rule was used.

The misreading is "twelve students scored 85." The bar over 80 to 90 says twelve students scored somewhere in that interval and nothing more. The individual values have been thrown away, which is also why you cannot read a median off a histogram, only the bin the median lands in.

Equal width is doing real work in the definition. When bins differ in width, height stops encoding frequency fairly: a bin of width 20 holding 12 values and a bin of width 10 holding 9 draw bars of height 12 and 9, so the wide one looks bigger, while the densities are 12/20=0.612 / 20 = 0.6 and 9/10=0.99 / 10 = 0.9 values per unit and the narrow bin is the more crowded one. With unequal bins the vertical axis has to carry density and you read area, not height.

A histogram also destroys the order the values arrived in, which is what a time plot keeps, and its shape depends on the bin width you choose. Histograms are topic 1.5.

Full entry for histogram

Where each one fits in the course