Free access until 31 December 2026 · Physics and Maths questions and notes, updated continuously · Build a test

ExaminerPrep › Cambridge IGCSE Maths › Notes

Cambridge IGCSE Maths · Topic 9 · 9.2 · Core and Extended (Extended only for the last two)

Scatter diagrams, correlation, cumulative frequency and histograms

This note covers four ways of displaying and interpreting data: scatter diagrams with correlation and lines of best fit (Core and Extended), then cumulative frequency graphs and histograms (Extended only). These tools help you spot relationships, find medians and quartiles from grouped data, and compare data sets with uneven class widths.

Key ideas

Scatter diagrams and correlation (Core and Extended)

A scatter diagram plots paired data as points, one variable on each axis, to see whether the two variables are linked. The link is called correlation.

  • Positive correlation: as one variable increases, the other tends to increase (points slope upwards).
  • Negative correlation: as one variable increases, the other tends to decrease (points slope downwards).
  • No correlation: no clear pattern.

Correlation can be strong (points close to a straight line) or weak (points scattered widely). Correlation shows a link but does not prove that one thing causes the other.

A line of best fit is a straight line drawn through the data so that it follows the trend, with roughly equal numbers of points above and below it. It should pass through the point showing the mean of both variables. Use it to estimate one value from the other:

  • Interpolation: estimating inside the range of the data. This is usually reliable.
  • Extrapolation: estimating outside the range of the data. This is much less reliable because the trend may not continue.

To find the equation of a line of best fit, pick two points on the line (not necessarily data points), find the gradient \(m = \dfrac{y_2 - y_1}{x_2 - x_1}\), then use \(y - y_1 = m(x - x_1)\). An outlier is a point that is far from the trend.

Cumulative frequency (Extended only)

A cumulative frequency is a running total of the frequencies. For grouped data, plot each cumulative frequency against the upper class boundary (because all of the class has been counted only once you reach the end of it), and join the points with a smooth curve. The curve starts at the lowest boundary with cumulative frequency 0.

For a total frequency \(n\), read these values from the curve:

  • Median: the value at cumulative frequency \(\tfrac12 n\).
  • Lower quartile \(Q_1\): at \(\tfrac14 n\).
  • Upper quartile \(Q_3\): at \(\tfrac34 n\).
  • Interquartile range (IQR) \(= Q_3 - Q_1\): the spread of the middle half of the data. It is not affected by extreme values.
  • Percentiles: the \(p\)th percentile is at \(\dfrac{p}{100} n\).

To find how many values are above or below a given number, read the cumulative frequency at that number from the curve, then subtract from \(n\) if needed.

Histograms (Extended only)

A histogram shows grouped continuous data with bars that touch. When the class widths are unequal, the height of each bar is the frequency density, and the area of each bar equals the frequency:

\[ \text{frequency density} = \frac{\text{frequency}}{\text{class width}} \qquad \text{frequency} = \text{frequency density} \times \text{class width} \]

The vertical axis is labelled "frequency density", not "frequency".

Definitions and formulae

Term or formulaMeaning / when to use
CorrelationThe type of relationship between two variables: positive, negative or none, and strong or weak.
Line of best fitStraight line that follows the trend of a scatter diagram.
Interpolation / extrapolationEstimating inside / outside the range of the data.
Cumulative frequencyRunning total of frequencies, plotted at upper class boundaries.
Median, \(Q_1\), \(Q_3\)Read at \(\tfrac12 n\), \(\tfrac14 n\) and \(\tfrac34 n\) on the cumulative frequency axis.
\(\text{IQR} = Q_3 - Q_1\)Spread of the middle half of the data.
Frequency density \(= \dfrac{f}{\text{width}}\)Height of a histogram bar.

Worked examples

Example 1 A cafe records the daily temperature \(x\) (in °C) and the number of cold drinks \(y\) sold. The scatter diagram shows strong positive correlation. A line of best fit passes through \((10, 35)\) and \((30, 115)\). (a) Find the equation of the line. (b) Estimate the sales on a day at 22 °C. (c) Why is the line not reliable at 45 °C?

(a) Gradient \(m = \dfrac{115 - 35}{30 - 10} = \dfrac{80}{20} = 4\).

Use \(y - 35 = 4(x - 10)\), so \(y = 4x - 40 + 35 = 4x - 5\).

(b) At \(x = 22\): \(y = 4 \times 22 - 5 = 83\). This is interpolation, as 22 is within the data range.

(c) 45 °C is outside the range of the data, so using it is extrapolation. The trend may not continue, for example sales may level off.

Answer: (a) \(y = 4x - 5\). (b) About 83 drinks. (c) 45 °C is outside the data, so the estimate is unreliable.

Example 2 The times, in minutes, taken by 60 runners to finish a race are grouped: \(20 \lt t \le 30\): 4; \(30 \lt t \le 40\): 11; \(40 \lt t \le 50\): 19; \(50 \lt t \le 60\): 16; \(60 \lt t \le 70\): 10. Find the cumulative frequencies, and estimate the median, the interquartile range and the number of runners who took more than 55 minutes.

Cumulative frequencies at the upper boundaries 30, 40, 50, 60, 70 are 4, 15, 34, 50, 60.

Plot (20, 0), (30, 4), (40, 15), (50, 34), (60, 50), (70, 60) and join with a smooth curve.

Median: \(\tfrac12 \times 60 = 30\). Reading across at 30 on the curve gives about 48 minutes. (Between 40 and 50 the curve rises from 15 to 34, so \(40 + \dfrac{30 - 15}{19} \times 10 = 47.9\).)

\(Q_1\) is at \(\tfrac14 \times 60 = 15\), which is at 40 minutes. \(Q_3\) is at \(\tfrac34 \times 60 = 45\); between 50 and 60 the curve rises from 34 to 50, so \(50 + \dfrac{45 - 34}{16} \times 10 = 56.9\).

\(\text{IQR} = 56.9 - 40 = 16.9\) minutes.

At 55 minutes the cumulative frequency is about \(34 + \dfrac{5}{10} \times 16 = 42\), so \(60 - 42 = 18\) runners took longer than 55 minutes.

Answer: median about 48 minutes, IQR about 16.9 minutes, about 18 runners over 55 minutes. (Values read from a graph may differ slightly.)

Example 3 The table shows the lengths of 80 phone calls. \(0 \lt x \le 10\): 12; \(10 \lt x \le 30\): 30; \(30 \lt x \le 40\): 18; \(40 \lt x \le 60\): 20. (a) Find the frequency density of each class. (b) In a second histogram, a bar is 4 units wide and 2.5 units high on a frequency density scale. Find its frequency.

(a) Class widths are 10, 20, 10 and 20.

\(0 \lt x \le 10\): \(\dfrac{12}{10} = 1.2\). \(10 \lt x \le 30\): \(\dfrac{30}{20} = 1.5\). \(30 \lt x \le 40\): \(\dfrac{18}{10} = 1.8\). \(40 \lt x \le 60\): \(\dfrac{20}{20} = 1.0\).

(b) Frequency \(=\) frequency density \(\times\) width \(= 2.5 \times 4 = 10\).

Answer: (a) 1.2, 1.5, 1.8, 1.0. (b) 10.

Common errors

  • Common error: saying that correlation proves that one variable causes the other.
  • Common error: joining the dots of a scatter diagram, or drawing a line of best fit that has to go through the first and last points.
  • Common error: plotting cumulative frequency at the class midpoints or the lower boundaries instead of the upper boundaries.
  • Common error: reading the median at \(\tfrac12(n + 1)\) from the curve, or at half of the final value of the horizontal axis. Use half of the total frequency.
  • Common error: using frequency as the bar height in a histogram with unequal class widths.

Exam tip: When reading from a graph, draw construction lines with a ruler from the axis to the curve and back to the other axis, and state the value you read. This shows your method even if the reading is slightly off.

Check yourself

  1. Describe the correlation you would expect between hours of television watched and exam score for a group of students, if more television goes with lower scores.
    AnswerNegative correlation: as the hours of television increase, the scores tend to decrease.
  2. A line of best fit passes through \((2, 9)\) and \((8, 33)\). Find its gradient and its equation.
    Answer\(m = \dfrac{33 - 9}{8 - 2} = 4\). Then \(y - 9 = 4(x - 2)\), so \(y = 4x + 1\).
  3. For 120 data values on a cumulative frequency graph, at which cumulative frequencies do you read the lower quartile, median and upper quartile?
    AnswerLower quartile at \(\tfrac14 \times 120 = 30\), median at \(\tfrac12 \times 120 = 60\), upper quartile at \(\tfrac34 \times 120 = 90\).
  4. A histogram bar has class width 5 and frequency density 3.2. Find the frequency.
    AnswerFrequency \(= 3.2 \times 5 = 16\).