Skip to main content
Examonaut

Topic S · Lesson 3 of 4

Histograms, cumulative frequency and comparing distributions

HistogramsHigher tier

A histogram looks like a bar chart but is used for continuous grouped data, so there are no gaps between bars. When class widths are unequal, bar heights would be misleading (a wide class collects more data simply because it is wide). So in a histogram the area of each bar represents the frequency. The height is the frequency density:

frequency density=frequencyclass widthfrequency=frequency density×class width\text{frequency density} = \frac{\text{frequency}}{\text{class width}} \qquad \text{frequency} = \text{frequency density} \times \text{class width}

How to draw a histogram

  1. Step 1: Find each class width.
  2. Step 2: Divide each frequency by its class width to get the frequency density.
  3. Step 3: Draw bars with no gaps, from the class boundaries, up to the frequency density, with frequency density on the vertical axis.

In the diagram, the class 15≤t<2015 \le t < 20 has frequency 18 and width 5, so its frequency density is 3.6; the class 30≤t<5030 \le t < 50 has frequency 6 and width 20, so its frequency density is only 0.3.

O10203040501234time t (minutes)frequency density186

Worked example

Estimating from a histogramgrade 8–9

Use the histogram to estimate how many people waited between 12 and 25 minutes.

Show solution
  1. Frequency in 12≤t<1512 \le t < 15: the bar for 10 to 15 has frequency density 2.4, so a 3-minute strip holds 2.4×3=7.22.4 \times 3 = 7.2.
  2. Frequency in 15≤t<2015 \le t < 20: 3.6×5=183.6 \times 5 = 18.
  3. Frequency in 20≤t<2520 \le t < 25: frequency density 1.6, width 5, so 1.6×5=81.6 \times 5 = 8.
  4. Total: 7.2+18+8=33.27.2 + 18 + 8 = 33.2, so about 33 people. This assumes the people are spread evenly within each class.

Cumulative frequencyHigher tier

Cumulative frequency is a running total: the number of values up to and including each class. For the waiting-time data (frequencies 8, 12, 18, 16 and 6), the running totals are 8, 20, 38, 54 and 60.

How to draw and use a cumulative frequency graph

  1. Step 1: Work out the running totals.
  2. Step 2: Plot each one at the upper boundary of its class (8 at 10 minutes, 20 at 15, and so on), starting from zero at the lower boundary of the first class.
  3. Step 3: Join the points with a smooth curve (or straight lines).
  4. Step 4: For nn values, read across from n2\frac{n}{2} for the median, from n4\frac{n}{4} for the lower quartile (LQ) and from 3n4\frac{3n}{4} for the upper quartile (UQ), then down to the horizontal axis.

The points are plotted at the upper boundary because by the end of each class all of its values have been counted. In the diagram, n=60n = 60, so read across from 15, 30 and 45: LQ ≈ 13 minutes, median ≈ 18 minutes, UQ ≈ 23 minutes.

LQmedianUQO102030405015304560time t (minutes)cumulative frequency

The interquartile range is IQR=UQ−LQ≈23−13=10\text{IQR} = \text{UQ} - \text{LQ} \approx 23 - 13 = 10 minutes. It measures the spread of the middle half of the data, so, unlike the range, extreme values do not affect it. You can also answer "how many waited more than 25 minutes?" by reading up from 25 to the curve (about 48) and subtracting from 60: about 12 people.

Box plotsHigher tier

A box plot summarises a data set with five values on a scale: minimum, LQ, median, UQ and maximum. The box covers the middle 50% of the data, from LQ to UQ, with a line at the median, and the whiskers stretch out to the minimum and maximum. Box plots drawn on the same scale make comparisons quick, as the diagram shows.

01020304050ABmedianmaxmin

Try it: change the data or the frequencies and see the averages, box plot, histogram and cumulative frequency graph change together.

Try it: simulation

Averages, spread and graphs

Loading the simulation…

Comparing distributions

To compare two data sets, always make two comparisons, and always say what they mean in context:

  1. Compare an average (the median, or the mean): which group is generally higher?
  2. Compare a measure of spread (the IQR, or the range): which group is more consistent?

For the box plots above, a full answer might be: "Group B's median (22 minutes) is higher than group A's (18 minutes), so group B generally waited longer. Group B's IQR (27−15=1227 - 15 = 12) is about the same as group A's (24−13=1124 - 13 = 11), so the middle halves of the two groups are about equally spread out, but group A's range (40) is larger than group B's (30) because of one very long wait." Use the median and IQR when there are outliers or skewed data; use the mean and range otherwise.

Practise this topic

Both are part of Premium.