Maths › Statistics › Measures of location and spread
Measures of location and spread
Two numbers summarise a thousand: one for where the data sits, one for how far it strays. This lesson builds the mean, median and quartiles, then the standard deviation, and shows how coding moves them all in predictable ways.
Builds on Sampling and the large data set.
IN THIS TOPIC
- Find the median, quartiles and percentiles of listed and grouped data, interpolating where the data is grouped.
- Calculate variance and standard deviation from raw data or from the summary sums Σx and Σx².
- Undo coding: recover the mean and standard deviation of x from those of a coded y.
WHAT YOU PROBABLY THINK
Adding 5 to every value in a data set increases the standard deviation.
Location: mean, median, mode
The mean adds everything and shares it out equally:
It uses every value, which is its strength and its weakness: one wild value drags it. The median is the middle of the ordered list, immune to wild values because it never looks at them; the mode is the most common value, the only measure that works for non-numerical data.
For a list of n values, find positions before values: the median sits at position (n + 1)/2 when n is odd. Quartiles quarter the list the same way, and the interquartile range Q₃ − Q₁ measures the spread of the middle half.
Grouped data: interpolation
Grouped data has lost the individual values, so the median is estimated by assuming the values spread evenly through their class. Walk the cumulative frequency to the class that contains position n/2, then take the matching fraction of the class width.
WORKED EXAMPLE
A median by interpolation
Masses of 25 parcels: 8 in the class 10 ≤ m < 20, 12 in 20 ≤ m < 30, and 5 in 30 ≤ m < 40. Estimate the median.
The median position is n/2 = 12.5. The first class carries the count to 8, so the median is the 4.5th value of the 12 inside 20 ≤ m < 30.
Assuming an even spread: median ≈ 20 + (12.5 − 8)/12 × 10 = 20 + 3.75 = 23.75, so about 23.8 kg.
The check: 23.75 sits in the correct class, less than halfway through, matching 4.5 out of 12.
Spread: variance and standard deviation
The range uses only the two extremes. The variance uses everything: the mean of the squared distances from the mean, most usefully in the form
“the mean of the squares minus the square of the mean”. The standard deviation σ is its square root, back in the same units as the data. The squaring step is why one distant value inflates σ sharply: distances count by their squares.
WORKED EXAMPLE
Mean and standard deviation from the sums
For 20 values, Σx = 340 and Σx² = 6180. Find the mean and standard deviation.
The mean is 340/20 = 17.
The variance is 6180/20 − 17² = 309 − 289 = 20, so σ = √20 ≈ 4.47.
Sense check: σ is a typical distance from the mean, and values a few units either side of 17 is entirely believable for this data.
Coding
Data is often coded before the arithmetic: y = (x − a)/b turns clumsy values into small ones. The summary statistics follow the code exactly, and undo it exactly:
The picture explains the asymmetry. Subtracting a slides every value equally: the mean slides with them, but distances between values, and so σ, do not change at all. Dividing by b shrinks the ruler, so both the mean and the standard deviation divide by b.
THE EXAM BIT
- Grouped-data medians are interpolation: class boundaries, cumulative counts, then the fraction of the width. Show the fraction; it is where the method mark lives.
- Know σ² = Σx²/n − (Σx/n)² by heart and expect to use it straight from given sums.
- Coding questions almost always end by asking for the statistics of the original data: adding shifts only the mean, multiplying scales both mean and σ.
- Say which measure a context deserves: median and IQR when the data is skewed or has outliers, mean and σ when it is well behaved and every value should count.
CHECK YOURSELF
Ten values have Σx = 120 and Σx² = 1560. Find the mean and the standard deviation.
Show a hint
Mean of the squares minus the square of the mean.
Show the answer
Mean: 120/10 = 12.
Variance: 1560/10 − 12² = 156 − 144 = 12, so σ = √12 ≈ 3.46.
Location by position: order the data, find the position, then read the value.
Spread by squares: σ² is the mean of the squares minus the square of the mean, and only stretching the data, never sliding it, changes σ.
WORKBOOK
Printable practice for this topic: original exam-style questions with room to work, and a fully worked answer book. Free to use; please do not redistribute or sell.
CHECK YOUR PROGRESS
Rate how confident you feel with each objective for this lesson. Ratings are saved in this browser, on this device only.
- Find the median, quartiles and percentiles of listed and grouped data, interpolating where the data is grouped.
- Calculate variance and standard deviation from raw data or from the summary sums Σx and Σx².
- Undo coding: recover the mean and standard deviation of x from those of a coded y.
No animated video for this topic yet; these notes stand alone.