This note shows how to organise data in frequency tables and display it in histograms, cumulative frequency graphs and box-and-whisker plots. You will also learn to read medians, quartiles and percentiles from a graph, and to use the plots to compare data sets.
Key ideas
Frequency tables. A frequency table lists each value (or class) and how often it occurs. For continuous data, values are grouped into classes such as \(10\le t\lt20\). Class widths should be equal for the graphs in this note.
Frequency histograms. A histogram shows grouped continuous data.
- The horizontal axis is a continuous scale, with each bar covering one class.
- Bars touch, because there are no gaps between classes.
- With equal class widths, the height of a bar is the frequency.
- The tallest bar shows the modal class.
Cumulative frequency. The cumulative frequency at a value is the total number of data items less than or equal to that value. To build a table, add the frequencies as you go down. Plot each cumulative frequency against the upper class boundary and join the points with a smooth curve (or straight lines). The graph rises from 0 to the total frequency \(n\).
- Median: read across at \(\tfrac12 n\), then down to the horizontal axis.
- Lower quartile \(Q_1\): read at \(\tfrac14 n\). Upper quartile \(Q_3\): read at \(\tfrac34 n\).
- The \(p\)th percentile: read at \(\tfrac{p}{100}n\). It is the value below which \(p\%\) of the data lies.
- Values read from a grouped table or graph are estimates, because we do not know where each item sits inside its class.
Box-and-whisker plots. A box plot summarises five numbers: minimum, \(Q_1\), median, \(Q_3\), maximum.
- The box runs from \(Q_1\) to \(Q_3\), with a line at the median. Its length is the IQR.
- Each whisker runs from the box to the lowest and highest data values that are not outliers.
- Outliers (more than \(1.5\times\text{IQR}\) beyond \(Q_1\) or \(Q_3\)) are shown separately as crosses.
- Each quarter of the data lies in one section: whisker, lower half of box, upper half of box, whisker.
Comparing data sets. Put box plots on the same scale. Compare a measure of centre (median) and a measure of spread (IQR or range), and give your conclusion in the context of the question.
Definitions and formulae
| Term or formula | Meaning / when to use |
|---|---|
| Class interval \(a\le x\lt b\) | Group of continuous values; width \(b-a\); midpoint \(\tfrac{a+b}{2}\). |
| Modal class | Class with the highest frequency (tallest bar when widths are equal). |
| Cumulative frequency | Running total of frequencies up to a given upper boundary. |
| Median position \(\tfrac12 n\) | Read the median from a cumulative frequency graph here. |
| Quartile positions \(\tfrac14 n\), \(\tfrac34 n\) | Read \(Q_1\) and \(Q_3\) here. |
| Percentile position \(\tfrac{p}{100}n\) | Read the \(p\)th percentile here. |
| \(\text{IQR}=Q_3-Q_1\) | Length of the box in a box plot. |
| Interpolation in a class | Estimate \(=\text{lower bound}+\dfrac{\text{position}-\text{cum. freq. before}}{\text{class frequency}}\times\text{width}\). |
Worked examples
Example 1 The times, \(t\) minutes, taken by 50 couriers to complete a route are summarised below.
\(10\le t\lt20\): 4; \(20\le t\lt30\): 11; \(30\le t\lt40\): 20; \(40\le t\lt50\): 9; \(50\le t\lt60\): 6.
Estimate (a) the median, (b) the interquartile range, (c) the 40th percentile.
Cumulative frequencies at the upper boundaries 20, 30, 40, 50, 60 are 4, 15, 35, 44, 50.
(a) \(\tfrac12n=25\). The 25th value is in \(30\le t\lt40\). Cumulative frequency before this class is 15, and the class has 20 values.
Median \(\approx30+\dfrac{25-15}{20}\times10=35\).
(b) \(Q_1\): position \(12.5\), in \(20\le t\lt30\) (4 before, 11 in class): \(Q_1\approx20+\dfrac{12.5-4}{11}\times10=27.7\).
\(Q_3\): position \(37.5\), in \(40\le t\lt50\) (35 before, 9 in class): \(Q_3\approx40+\dfrac{37.5-35}{9}\times10=42.8\).
\(\text{IQR}\approx42.8-27.7=15.1\).
(c) 40th percentile: position \(0.4\times50=20\), in \(30\le t\lt40\): \(30+\dfrac{20-15}{20}\times10=32.5\).
Answer: (a) 35 minutes; (b) 15.1 minutes; (c) 32.5 minutes (all estimates)
Example 2 The scores in a gaming tournament have minimum 12, \(Q_1=20\), median 26, \(Q_3=34\) and maximum 61. The next highest score after 61 is 52. (a) Show that 61 is an outlier. (b) Describe how to draw the box plot.
(a) \(\text{IQR}=34-20=14\), and \(1.5\times14=21\).
Upper fence: \(34+21=55\). Since \(61\gt55\), 61 is an outlier.
Lower fence: \(20-21=-1\). The minimum, 12, is above this, so there is no low outlier.
(b) Draw a scale covering 0 to 65. Draw a box from 20 to 34 with a vertical line at 26. Draw the left whisker from 20 down to 12. Draw the right whisker from 34 up to 52, the highest value that is not an outlier. Mark 61 with a cross, with no line joining it to the whisker.
Answer: 61 is above the fence of 55, so it is an outlier; the right whisker ends at 52.
Example 3 The heights, \(h\) cm, of 30 students are: \(150\le h\lt160\): 3; \(160\le h\lt170\): 8; \(170\le h\lt180\): 12; \(180\le h\lt190\): 5; \(190\le h\lt200\): 2. (a) Describe the frequency histogram. (b) Estimate how many students are taller than 175 cm.
(a) Five touching bars of equal width, with heights 3, 8, 12, 5, 2 on the frequency axis. The tallest bar is \(170\le h\lt180\), the modal class. The shape rises to a peak and then falls.
(b) 175 is the midpoint of \(170\le h\lt180\), so assume half of its 12 students, which is 6, are above 175.
Add the higher classes: \(6+5+2=13\).
Answer: about 13 students
Common errors
- Common error: plotting cumulative frequency against the class midpoint or lower boundary. Use the upper class boundary.
- Common error: leaving gaps between histogram bars. Continuous data needs touching bars; gaps are for bar charts of separate categories.
- Common error: reading the median at the value \(\tfrac12(n+1)\) on a grouped graph. For cumulative frequency graphs use \(\tfrac12 n\).
- Common error: extending a box-plot whisker to an outlier. The whisker stops at the last value inside the fence.
- Common error: comparing two box plots by saying only "this one is bigger". Compare both centre and spread, in context.
Exam tip: Draw construction lines on a cumulative frequency graph (a clear horizontal line across, then a vertical line down). They show where your reading came from.
Check yourself
- Write the cumulative frequencies for the heights in Example 3.
Answer
3, 11, 23, 28, 30 at upper boundaries 160, 170, 180, 190, 200. - Estimate the median height in Example 3.
Answer
Position \(15\), in \(170\le h\lt180\) (11 before, 12 in class): \(170+\dfrac{15-11}{12}\times10=173.3\) cm. - Find the five-number summary for 4, 7, 9, 12, 15, 18, 20.
Answer
Minimum 4, \(Q_1=7\), median 12, \(Q_3=18\), maximum 20. - A box plot has \(Q_1=40\) and \(Q_3=70\). State the IQR and the fraction of the data that lies inside the box.
Answer
\(\text{IQR}=70-40=30\). Half of the data lies between \(Q_1\) and \(Q_3\).