Leave lesson

Statistics · Histograms

1 / 18

Histograms & frequency density

Why a histogram with unequal class widths cannot use frequency as the bar height, and how the rule "area = frequency" fixes it: height = frequency ÷ class width. Drawing the bars, reading a frequency back off a bar as density × width, and why the axis must say "Frequency density".

Statistics · Histograms

Histograms & frequency density

Why a histogram with unequal class widths cannot use frequency as the bar height, and how the rule "area = frequency" fixes it: height = frequency ÷ class width. Drawing the bars, reading a frequency back off a bar as density × width, and why the axis must say "Frequency density".

Why it works

A bar chart and a histogram look like the same picture, and they are not. A bar chart is for categories — favourite sport, eye colour — and its bars stand apart, because there is nothing in between "football" and "netball". A histogram is for continuous data grouped into classes, and its bars touch, because the data runs straight on from one class into the next.

That would be a cosmetic difference if every class were the same width. The trouble starts because in real data they usually aren't: you group finely where the values are packed together and coarsely out in the tail, or half your classes come out empty.

The trap, with real numbers. Ninety people were timed on a puzzle.
Time, tt (minutes)Frequency
0<t100 < t \le 1015
10<t1510 < t \le 1520
15<t2015 < t \le 2015
20<t4020 < t \le 4030
40<t6040 < t \le 6010
Take the frequency as the height of each bar — the obvious thing to do — and you get this:10203040506051015202530Time, t (minutes)Frequency (wrong height)The picture makes one loud claim: the 20<t4020 < t \le 40 group is the big one. Thirty people, the tallest bar, nothing else close.

It isn't true. That class is 2020 minutes wide; 10<t1510 < t \le 15 is only 55. Of course the wide one collected more people — it was catching them for four times as long. Chop 20<t4020 < t \le 40 into four five-minute strips and each strip holds roughly 30÷4=7.530 \div 4 = 7.5 people. The single five-minute strip from 1010 to 1515 holds 2020. Minute for minute, the class the chart called small is nearly three times as crowded as the class it called biggest. The tall bar is tall because the class is wide, not because the data is dense there.

The repair: let area carry the frequency. If a bar is going to be rewarded for being wide, that width has to be paid for. So insist that the area of each bar is its frequency, and then solve for the height that makes it so:

width×height=frequencyheight=frequencyclass width.\text{width} \times \text{height} = \text{frequency} \quad\Longrightarrow\quad \text{height} = \frac{\text{frequency}}{\text{class width}}.

That height has a name — the frequency density — and it is a rate: the number of items per unit of whatever is on the xx-axis, per minute or per gram or per centimetre. Like speed, which is distance per hour, a rate is exactly the thing that lets you compare fairly across intervals of different length. Redo the table with it:
Time, tt (minutes)FrequencyClass widthFrequency density
0<t100 < t \le 10151015÷10=1.515 \div 10 = 1.5
10<t1510 < t \le 1520520÷5=420 \div 5 = 4
15<t2015 < t \le 2015515÷5=315 \div 5 = 3
20<t4020 < t \le 40302030÷20=1.530 \div 20 = 1.5
40<t6040 < t \le 60102010÷20=0.510 \div 20 = 0.5
1020304050601234Time, t (minutes)Frequency densityNow 10<t1510 < t \le 15 is the tallest bar, as it should be, and 20<t4020 < t \le 40 has settled to exactly the same height as 0<t100 < t \le 10 — those two classes really are equally crowded, 1.51.5 people per minute each, even though one holds twice as many people as the other. Nothing was lost in the swap: the bar areas are still 1.5×10=151.5 \times 10 = 15, 4×5=204 \times 5 = 20, 3×5=153 \times 5 = 15, 1.5×20=301.5 \times 20 = 30 and 0.5×20=100.5 \times 20 = 10, adding to 9090. ✓

Class width means the true width of the interval. For 10<t1510 < t \le 15 that is 1510=515 - 10 = 5. Take care when data has been rounded before it was grouped: nail lengths measured to the nearest millimetre and grouped 25252929 really run from 24.524.5 up to 29.529.5, so that class is 55 wide, not 44. A class width that is out by one makes its frequency density wrong, which makes its bar the wrong height, which loses the accuracy mark.

Going backwards is where the marks go. Almost every histogram question is the same equation rearranged, so read it in both directions:

frequency=frequency density×class width.\text{frequency} = \text{frequency density} \times \text{class width}.

Forwards (drawing): from the table, work out each width, divide, plot. Backwards (reading): take a bar's height off the vertical axis, multiply by how wide the bar is, and that is the frequency — the number of items in that class. The height on its own is never a frequency. And to total up a histogram you add the areas, never the heights: the five densities above sum to 10.510.5, which is not 9090 and is not a count of anything.

Why the axis must be labelled "Frequency density". The label is what tells a reader which rule to use. Write "Frequency" on a frequency-density axis and you have invited them to read 44 off the tallest bar and conclude that 44 people took between 1010 and 1515 minutes, when in fact 2020 did. The axis label is not decoration; on a "draw the histogram" question it carries a mark of its own, and it is one examiners take.