S1.2 Measures of location and dispersion
⤓ Presentation⤓ PowerPointPresentation: opens offline in any browser, simulations live. PowerPoint: editable.
Statistics 1 (AS). Histograms, stem-and-leaf diagrams, box plots, outliers and skewness are on the S1.1 page; E(X) and Var(X) of a random variable are on the S1.5 page.
What this page covers
7 points
- Mean, median and mode for raw lists, discrete frequency tables and grouped data
- Quartiles and percentiles of a list, the range and the interquartile range
- Variance and standard deviation, including from \(\sum x\), \(\sum x^2\) and \(\sum fx\), \(\sum fx^2\)
- Estimating the mean and standard deviation of grouped data from midpoints
- Interpolation for the median, quartiles and percentiles of grouped data, with class boundaries
- Coding: how adding, subtracting, multiplying and dividing change the mean and standard deviation
- Comparing data sets; combining groups; adding, removing or correcting a value
In one minute
6 points
- A data set is summarised by a measure of location (mean, median or mode) and a measure of spread (range, IQR or standard deviation), and two data sets are compared using one of each, in context.
- Mean \(\bar x=\sum x\div n\) (or \(\sum fx\div\sum f\)); median = middle value; mode = most common value (modal class for grouped data).
- Lists: for the median and quartiles find \(n/2, n/4, 3n/4\). Not a whole number → round up; a whole number \(k\) → average the \(k\)th and \((k+1)\)th values.
- Grouped data: interpolate. Median = lower boundary + \(\dfrac{n/2-\text{cf before}}{\text{class frequency}}\) × class width.
- Variance \(\sigma^2=\dfrac{\sum x^2}{n}-\bar x^2\) ("mean of the squares minus square of the mean"); \(\sigma=\sqrt{\text{variance}}\).
- Coding \(y=\dfrac{x-a}{b}\): \(\bar y=\dfrac{\bar x-a}{b}\) and \(\sigma_y=\dfrac{\sigma_x}{b}\). Shifting does not change the spread.
Contents
14 sections
- What do the mean, median and mode measure?
- How do you find quartiles and percentiles of a list?
- How do you calculate the variance and standard deviation?
- How do you estimate the mean and standard deviation of grouped data?
- How do you interpolate for the median, quartiles and percentiles?
- How does coding change the mean and standard deviation?
- How do you compare and combine data sets?
- How do the pieces fit together in a full question?
- Exam tips for S1.2
- Common misconceptions
- How this topic connects
- Key formulae
- Check your understanding
- Specification checklist
What do the mean, median and mode measure?
The median is the middle value when the data are in order; for \(n\) values it is the \(\tfrac{n+1}{2}\)th value, which is the same as the rule "\(n/2\): round up, or average the two values either side if \(n/2\) is a whole number". The mode is the value with the highest frequency; a data set can have no mode or several. For grouped data quote the modal class (highest frequency density if the widths differ).
The three behave differently. The mean uses every value, so one extreme value can drag it a long way. The median and mode do not care how extreme the largest or smallest values are. That difference decides which average to use.
A courier records the number of parcels, \(x\), delivered to one office on each of 40 days.
| Parcels, \(x\) | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| Frequency, \(f\) | 6 | 11 | 9 | 7 | 4 | 3 |
Find (a) the mode, (b) the median, (c) the mean number of parcels per day.
(a) The highest frequency is 11, so mode = 1.
(b) \(n/2=20\) is a whole number, so average the 20th and 21st values. Cumulative frequencies are 6, 17, 26, …, so the 18th to 26th values are all 2: median = 2.
(c) \(\sum fx=0\times6+1\times11+2\times9+3\times7+4\times4+5\times3=81\), so \(\bar x=\dfrac{81}{40}=\) 2.025 parcels per day. The mean need not be a possible data value.
How do you find quartiles and percentiles of a list?
Three measures of spread come from these positions. The range (largest − smallest) is quick but decided entirely by the two most extreme values. The interquartile range \(\text{IQR}=Q_3-Q_1\) is the spread of the middle half. An interpercentile range, such as \(P_{90}-P_{10}\), is the spread of the middle 80%. Always put the data in order first; with a frequency table, use cumulative frequencies to find a position.
The numbers of minutes that 15 trains arrived late were 0, 1, 1, 2, 3, 3, 4, 5, 6, 6, 8, 9, 12, 15, 27. (a) Find the median and the interquartile range. (b) Find the 10th and 90th percentiles. (c) A 16th train arrives 20 minutes late. Find the new median.
(a) \(n=15\). Median: \(15/2=7.5\to\) 8th value; \(Q_1\): \(15/4=3.75\to\) 4th; \(Q_3\): \(45/4=11.25\to\) 12th. Median = 5, \(Q_1=2\), \(Q_3=9\), so median 5 min, IQR 7 min.
(b) \(10\times15/100=1.5\to\) 2nd value; \(90\times15/100=13.5\to\) 14th value: \(P_{10}=1,\ P_{90}=15\).
(c) \(n=16\), \(16/2=8\) is a whole number, so average the 8th and 9th values of the new list: \(\dfrac{5+6}{2}=\) 5.5 min.
Taking the 4th value as \(Q_1\) for 16 values. \(16/4=4\) is a whole number, so \(Q_1\) is the mean of the 4th and 5th values; in part (c) that is \((2+3)\div2=2.5\).
How do you calculate the variance and standard deviation?
The first form explains the idea: measure each value's deviation from the mean, square it so that negatives do not cancel, and average. The second form is the one you calculate with. Variance is in squared units (years², cm²); the standard deviation is back in the units of the data.
- The order matters: \(\sum x^2\div n\) first, then subtract \(\bar x^2\).
- A variance can never be negative. A negative answer means a slip, usually \((\sum x)^2\) in place of \(\sum x^2\).
- Keep \(\bar x\) at full accuracy before squaring it; rounding first can change the third significant figure of \(\sigma\).
- Adding a value equal to the mean leaves the mean unchanged and makes the standard deviation smaller (the same total spread shared among more values).
Using your calculator
- In statistics mode, enter the data (with a frequency column if needed) and read off \(\bar x\), \(\sigma_x\), \(\sum x\) and \(\sum x^2\). Use \(\sigma_x\) (divisor \(n\)), not \(s_x\).
- Still write the sums down: if a later part adds or corrects a value, you need them.
The ages, \(x\) years, of the 25 members of a choir give \(\sum x=1150\) and \(\sum x^2=54\,610\). (a) Find the mean and the standard deviation of the ages. (b) A new member aged 46 joins. Find the new mean and standard deviation.
(a) \(\bar x=\dfrac{1150}{25}=46\) years. \(\sigma^2=\dfrac{54\,610}{25}-46^2=2184.4-2116=68.4\), so mean 46 years, \(\sigma=8.27\) years (3 s.f.).
(b) Update the sums: \(\sum x=1196\), \(\sum x^2=54\,610+46^2=56\,726\), \(n=26\). \(\bar x=\dfrac{1196}{26}=46\); \(\sigma^2=\dfrac{56\,726}{26}-46^2=65.8\), so mean 46 years, \(\sigma=8.11\) years.
Check by \(S_{xx}\): \(54\,610-1150^2/25=1710\) and \(1710\div25=68.4\). The new value adds 0 to \(S_{xx}\) but 1 to \(n\).
How do you estimate the mean and standard deviation of grouped data?
In grouped data the individual values are lost, so assume every value in a class sits at the class midpoint, then use \(\sum fx\div\sum f\) and \(\sum fx^2\div\sum f-\bar x^2\). The answers are estimates; say so. The midpoint is halfway between the class boundaries: for \(0\le t<10\) it is 5; for ages "20–29" in whole years the boundaries are 20 and 30, midpoint 25; for lengths "20–29" to the nearest mm the boundaries are 19.5 and 29.5, midpoint 24.5.
The journey times, \(t\) minutes, of 70 commuters are summarised below. Estimate the mean and the standard deviation of the journey times.
| Time, \(t\) (min) | Frequency | Midpoint | Cumulative frequency |
|---|---|---|---|
| \(0\le t<10\) | 8 | 5 | 8 |
| \(10\le t<15\) | 14 | 12.5 | 22 |
| \(15\le t<20\) | 21 | 17.5 | 43 |
| \(20\le t<30\) | 17 | 25 | 60 |
| \(30\le t<50\) | 10 | 40 | 70 |
\(\sum fx=40+175+367.5+425+400=1407.5\), so \(\bar x=\dfrac{1407.5}{70}=20.107\ldots\)
\(\sum fx^2=8\times5^2+14\times12.5^2+21\times17.5^2+17\times25^2+10\times40^2=35\,443.75\)
\(\sigma^2=\dfrac{35\,443.75}{70}-20.107\ldots^2=102.04\), so mean ≈ 20.1 min, \(\sigma\) ≈ 10.1 min.
Add a midpoint column and an \(fx\) column to the table, and write the totals \(\sum fx\) and \(\sum fx^2\) in your answer. If the final value slips, those totals still show your method.
How do you interpolate for the median, quartiles and percentiles?
Interpolation assumes the values are spread evenly through the class, which is why the answer is an estimate. This page uses \(n/2\), not \((n+1)/2\), for grouped data. The formula is not something to memorise blindly: it simply says "go \(\tfrac{p-C}{f_c}\) of the way through the class".
Use the journey-time table in Worked example 4. (a) Estimate the median and the interquartile range. (b) Estimate the 10th to 90th interpercentile range.
(a) Median position \(70/2=35\), in \(15\le t<20\) (cumulative frequencies 22, 43): \(Q_2=15+\dfrac{35-22}{21}\times5=18.1\) min.
\(Q_1\): position 17.5, in \(10\le t<15\): \(Q_1=10+\dfrac{17.5-8}{14}\times5=13.39\). \(Q_3\): position 52.5, in \(20\le t<30\): \(Q_3=20+\dfrac{52.5-43}{17}\times10=25.59\). Median 18.1 min, IQR = 25.59 − 13.39 = 12.2 min.
(b) \(P_{10}\): position 7, in \(0\le t<10\): \(0+\tfrac78\times10=8.75\). \(P_{90}\): position 63, in \(30\le t<50\): \(30+\dfrac{63-60}{10}\times20=36\). Range 36 − 8.75 = 27.25 min.
Using the stated class limits instead of the boundaries. Lengths recorded to the nearest cm as "30–34" and "35–39" have boundaries 29.5, 34.5, 39.5, so \(L=34.5\) and \(w=5\) for the class 35–39, not \(L=35\) and \(w=4\).
How does coding change the mean and standard deviation?
Adding or subtracting moves every value by the same amount: the centre moves, the spread does not. Multiplying or dividing scales every distance, so it changes both. The same rules hold for the median and quartiles (the IQR divides by \(b\); subtracting \(a\) does not change it).
The daily output, \(x\) kg, of a machine is recorded on 20 days. The data are coded using \(y=\dfrac{x-200}{5}\), giving \(\sum y=34\) and \(\sum y^2=182\). (a) Find the mean and standard deviation of \(y\). (b) Hence find the mean and standard deviation of \(x\). (c) Find \(\sum x\) and \(\sum x^2\).
(a) \(\bar y=\dfrac{34}{20}=1.7\); \(\sigma_y^2=\dfrac{182}{20}-1.7^2=9.1-2.89=6.21\); \(\sigma_y=2.4920\ldots\)
(b) Decode with \(x=5y+200\): \(\bar x=5\times1.7+200=\) 208.5 kg; \(\sigma_x=5\times2.4920\ldots=\) 12.5 kg.
(c) \(\sum x=20\times208.5=\) 4170. \(\sigma_x^2=25\times6.21=155.25\), so \(\sum x^2=20\times(155.25+208.5^2)=\) 872 550.
Adding 200 back on to the standard deviation, or multiplying the variance by 5 instead of 25. Only the scaling factor affects spread: \(\sigma_x=5\sigma_y\), \(\sigma_x^2=25\sigma_y^2\).
How do you compare and combine data sets?
A comparison needs one measure of location and one measure of spread, each in context: "the median time for group A is higher, so group A were generally slower". Use median and IQR when the data contain extreme values or are not symmetrical; use mean and standard deviation when the data are roughly symmetrical with no extreme values, because they use every value.
Combining two groups: never average the two means. Recover each group's \(\sum x=n\bar x\) and \(\sum x^2=n(\sigma^2+\bar x^2)\), add, then use the formulae on the totals. For example, 30 values with mean 62 and s.d. 5, and 20 values with mean 70 and s.d. 4: \(\sum x=1860+1400=3260\), \(\sum x^2=116\,070+98\,320=214\,390\), so the combined mean is \(3260\div50=65.2\) and the combined s.d. is \(\sqrt{214\,390\div50-65.2^2}=\sqrt{36.76}=6.06\).
Correcting a value: if a value \(p\) was recorded as \(q\), replace it in both sums: \(\sum x-q+p\) and \(\sum x^2-q^2+p^2\).
Two groups of 12 people each completed a puzzle. Their times, in seconds, were
A: 38, 41, 44, 45, 47, 48, 50, 52, 53, 55, 58, 61
B: 29, 33, 36, 40, 42, 46, 49, 55, 60, 64, 70, 84
(a) For group A, find the median and the interquartile range. (b) For group B the median is 47.5 s and the interquartile range is 24 s. Compare the two groups. (c) Find the mean time of all 24 people.
(a) \(n=12\): 12/2 = 6, 12/4 = 3 and 36/4 = 9 are whole numbers, so average pairs. Median \(=\tfrac{48+50}{2}=49\); \(Q_1=\tfrac{44+45}{2}=44.5\); \(Q_3=\tfrac{53+55}{2}=54\). Median 49 s, IQR 9.5 s.
(b) The medians are similar (49 s and 47.5 s), so a typical person in each group took about the same time. Group B's IQR (24 s) is much larger than group A's (9.5 s), so group B's times were much more varied.
(c) Add the totals, not the means: \(\sum x=592+608=1200\), so mean \(=\dfrac{1200}{24}=\) 50 s.
Group B contains one very slow time (84 s). The median and IQR are not affected by how extreme it is, which is why they are the better pair to compare here.
How do the pieces fit together in a full question?
Longer questions combine a grouped table, coding for the mean and standard deviation, interpolation for the median and quartiles, and an interpretation. Keep full accuracy in the middle of the working and round only the final answers.
The masses, \(m\) grams, of 80 apples from an orchard are summarised in the table.
| Mass, \(m\) (g) | \(100\le m<120\) | \(120\le m<130\) | \(130\le m<140\) | \(140\le m<150\) | \(150\le m<170\) | \(170\le m<200\) |
|---|---|---|---|---|---|---|
| Frequency | 7 | 15 | 24 | 19 | 11 | 4 |
The midpoints of the classes are coded using \(y=\dfrac{m-135}{5}\). (a) Use the coding to estimate the mean and the standard deviation of the masses. (b) Use interpolation to estimate the median mass. (c) Estimate the interquartile range. (d) Estimate the number of apples whose masses lie within one standard deviation of the mean.
(a) Midpoints 110, 125, 135, 145, 160, 185 give \(y=-5,-2,0,2,5,10\). \(\sum fy=-35-30+0+38+55+40=68\); \(\sum fy^2=175+60+0+76+275+400=986\). \(\bar y=\tfrac{68}{80}=0.85\); \(\sigma_y^2=\tfrac{986}{80}-0.85^2=12.325-0.7225=11.6025\), \(\sigma_y=3.4062\ldots\) Mean \(=135+5\times0.85=\) 139.25 g (139 g to 3 s.f.); s.d. \(=5\times3.4062\ldots=\) 17.0 g.
(b) Position 40; cumulative frequencies 7, 22, 46, so the median is in \(130\le m<140\): \(Q_2=130+\dfrac{40-22}{24}\times10=\) 137.5 g.
(c) \(Q_1\): position 20, in \(120\le m<130\): \(120+\dfrac{20-7}{15}\times10=128.67\). \(Q_3\): position 60, in \(140\le m<150\): \(140+\dfrac{60-46}{19}\times10=147.37\). IQR = 18.7 g.
(d) Mean ± s.d. \(=139.25\pm17.03\), from 122.22 g to 156.28 g. Interpolate at both ends: \(\dfrac{130-122.22}{10}\times15+24+19+\dfrac{156.28-150}{20}\times11=11.67+43+3.45=58.1\), so about 58 apples. That is about 73% of 80; for a roughly symmetrical, single-peaked distribution about two thirds usually lie within one standard deviation, so this is reasonable.
Exam tips for S1.2
Before any variance, write \(\sum x\) (or \(\sum fx\)) and \(\sum x^2\) (or \(\sum fx^2\)) as numbers. They are the method, and you need them again if a later part adds, removes or corrects a value.
For a list, decide first whether \(n/4, n/2, 3n/4\) are whole numbers: round up if not, average two values if so. For grouped data, use \(n/2, n/4, 3n/4\) directly in the interpolation, with class boundaries.
Write the coding the other way round before using it: \(y=(x-200)/5\) becomes \(x=5y+200\). The mean follows the whole rule; the standard deviation only feels the ×5.
"Group B has a higher IQR" is not enough on its own. Say which measure, which group, and what it means: "the IQR for B is larger, so B's times are less consistent", paired with a comparison of medians or means.
Keep \(\bar x\) at full accuracy when you square it, give final answers to 3 significant figures unless told otherwise, and describe results from grouped data as estimates.
Common misconceptions
| Misconception | Why it is wrong | Correct idea |
|---|---|---|
| Variance = \((\sum x)^2\div n-\bar x^2\). | \((\sum x)^2\) is the square of the total, not the total of the squares. | \(\sigma^2=\sum x^2\div n-\bar x^2\). |
| The mean of two combined groups is the mean of their means. | That only works when the groups are the same size. | Add the totals \(n\bar x\) and divide by the combined \(n\). |
| Adding 10 to every value adds 10 to the standard deviation. | Every value moves by the same amount, so distances from the mean are unchanged. | The mean goes up by 10; the s.d. is unchanged. |
| The median of grouped data is the midpoint of the median class. | The median need not be in the middle of its class. | Interpolate: \(L+\frac{p-C}{f_c}\times w\). |
| The modal class has the highest frequency, whatever the widths. | A wide class can collect many values without being dense. | With unequal widths, compare frequency densities. |
| The range is the best measure of spread because it is easy. | It depends only on the two most extreme values. | Use the IQR (resistant) or the standard deviation (uses all values). |
How this topic connects
S1.1 Representing data
Quartiles and the IQR build box plots and the outlier rule; comparing mean, median and mode, or the quartiles, describes skewness.
S1.4 Correlation and regression
\(S_{xx}=\sum x^2-(\sum x)^2/n\) is the same quantity used for the correlation coefficient and the regression line, and coding appears there too.
S1.5 Discrete random variables and S1.6 The Normal distribution
\(\text{Var}(X)=\text{E}(X^2)-[\text{E}(X)]^2\) is the probability version of "mean of squares minus square of mean"; \(\text{E}(aX+b)\) and \(\text{Var}(aX+b)\) follow the coding rules.
Key formulae
| Formula | Use | In the formulae list? |
|---|---|---|
| \(\bar x=\sum x\div n\); \(\bar x=\sum fx\div\sum f\) | mean of raw data; of a frequency table (midpoints for grouped data) | No – learn it |
| \(Q_1, Q_2, Q_3\) at \(n/4, n/2, 3n/4\) | quartile positions (round up, or average two values if whole) | No – learn it |
| \(L+\dfrac{p-C}{f_c}\times w\) | interpolation for grouped data | No – derive it |
| \(\sigma^2=\sum x^2\div n-\bar x^2\); \(\sigma^2=\sum fx^2\div\sum f-\bar x^2\) | variance of data (divisor \(n\)); \(\sigma=\sqrt{\sigma^2}\) | No – learn it |
| \(S_{xx}=\sum x^2-(\sum x)^2\div n\) | variance \(=S_{xx}\div n\) | Yes |
| \(y=(x-a)\div b\): \(\bar y=(\bar x-a)\div b\), \(\sigma_y=\sigma_x\div b\) | coding and decoding | No – learn it |
| \(\text{IQR}=Q_3-Q_1\); range = max − min | measures of spread | No – learn it |
Check your understanding
1. Find the mean and standard deviation of 3, 7, 8, 10, 12.
\(\sum x=40\), so \(\bar x=8\). \(\sum x^2=366\), so \(\sigma^2=73.2-64=9.2\) and \(\sigma=3.03\).
2. Eight values have \(\sum x=96\) and \(\sum x^2=1240\). Find the mean and standard deviation.
\(\bar x=12\); \(\sigma^2=155-144=11\); \(\sigma=3.32\).
3. Data coded with \(y=(x-50)\div2\) have \(\bar y=3\) and \(\sigma_y=1.5\). Find \(\bar x\) and \(\sigma_x\).
\(x=2y+50\), so \(\bar x=2\times3+50=56\) and \(\sigma_x=2\times1.5=3\).
4. Why is the median usually preferred to the mean for the incomes of people in a town?
A few very high incomes pull the mean upwards, so it is not typical of most people. The median is not affected by how extreme those values are.
5. Lengths are recorded to the nearest cm in classes 10–14, 15–19, 20–24. What are the boundaries and width of the class 15–19?
14.5 and 19.5; width 5. Its midpoint is 17.
Specification checklist
- (S1 2.2) I can find the mean, median and mode of a list, a discrete frequency table and grouped data, and the modal class.
- (S1 2.2) I can estimate the mean of grouped data using class midpoints, with the correct class boundaries.
- (S1 2.2) I can use coding to find a mean, and decode it.
- (S1 2.3) I can calculate the variance and standard deviation from raw data, from \(\sum x\) and \(\sum x^2\), and from a frequency table.
- (S1 2.3) I can find the range, quartiles, interquartile range, percentiles and interpercentile ranges of a list of data.
- (S1 2.3) I can use linear interpolation to estimate the median, quartiles and percentiles of grouped data.
- (S1 2.3) I can state and use the effect of coding on the mean and standard deviation, and recover \(\sum x\) and \(\sum x^2\) from coded summaries.
- (S1 2.3) I can compare data sets using a measure of location and a measure of spread in context, choose suitable measures, and update statistics when values are added, removed or combined.