Standard Deviation

AS · S1 · 18 min

The standard deviation measures how far the values in a data set typically lie from their mean. The range and the interquartile range also describe spread, but the standard deviation uses every value, and it is the measure that the rest of the course is built on: the variance of a random variable, the binomial distribution and the normal distribution all use it. On Paper 5 you calculate it from raw data, frequency tables, grouped data and given totals, combine two data sets, and use it to compare and contrast distributions in context.

Measuring spread from the mean

Take the eight values 9,10,12,14,15,18,20,229, 10, 12, 14, 15, 18, 20, 22. Their mean is xˉ=15\bar{x} = 15. Each value has a deviation from the mean, x−xˉx - \bar{x}:

xx991010121214141515181820202222
x−xˉx - \bar{x}−6-6−5-5−3-3−1-100335577
(x−xˉ)2(x - \bar{x})^2363625259911009925254949

A natural first idea is to average the deviations, but they always add to zero: the values above the mean exactly balance those below. That is what the mean is. So the deviations are squared first, which makes them all positive and gives large deviations more weight. Averaging the squared deviations gives the variance:

∑(x−xˉ)2n=1548=19.25.\frac{\sum (x - \bar{x})^2}{n} = \frac{154}{8} = 19.25.

The variance is measured in squared units (if xx is in cm, the variance is in cm2\text{cm}^2), so we take its square root to return to the units of the data. That is the standard deviation: 19.25=4.39\sqrt{19.25} = 4.39 to 3 significant figures. Roughly speaking, a typical value lies about 4.44.4 from the mean.

Definition

The variance of a data set is the mean of the squared deviations from the mean. The standard deviation is the positive square root of the variance. It has the same units as the data. A larger standard deviation means the values are more spread out about the mean; a standard deviation of 00 means every value is equal.

The two forms of the formula

Expanding ∑(x−xˉ)2\sum (x - \bar{x})^2 gives an equivalent form that is far quicker to use, because it needs only the totals ∑x\sum x and ∑x2\sum x^2 and never the individual deviations.

Key result

For nn values xx with mean xˉ=∑xn\bar{x} = \dfrac{\sum x}{n}:

variance=∑(x−xˉ)2n=∑x2n−xˉ2,standard deviation=∑x2n−xˉ2.\text{variance} = \frac{\sum (x - \bar{x})^2}{n} = \frac{\sum x^2}{n} - \bar{x}^2, \qquad \text{standard deviation} = \sqrt{\frac{\sum x^2}{n} - \bar{x}^2}.

For a frequency table, or grouped data using the mid-points as xx:

xˉ=∑xf∑f,variance=∑(x−xˉ)2f∑f=∑x2f∑f−xˉ2.\bar{x} = \frac{\sum xf}{\sum f}, \qquad \text{variance} = \frac{\sum (x - \bar{x})^2 f}{\sum f} = \frac{\sum x^2 f}{\sum f} - \bar{x}^2.

Both forms are on the formula list. A useful way to remember the second: the variance is the mean of the squares minus the square of the mean.

Check with the eight values: ∑x=120\sum x = 120 and ∑x2=1954\sum x^2 = 1954, so the variance is 19548−152=244.25−225=19.25\tfrac{1954}{8} - 15^2 = 244.25 - 225 = 19.25, as before.

Watch out

∑x2\sum x^2 is not (∑x)2(\sum x)^2. ∑x2\sum x^2 means square each value, then add. For the data above, ∑x2=1954\sum x^2 = 1954, but (∑x)2=14400(\sum x)^2 = 14400. Mixing these up gives a nonsense (often negative) variance.

Frequency tables and grouped data

In a frequency table each value xx occurs ff times, so it contributes xfxf to the total and x2fx^2 f to the total of squares. Add two columns, xfxf and x2fx^2 f, to the table and total them. Note that x2fx^2 f means x×x×fx \times x \times f, not (xf)2(xf)^2.

For grouped data the individual values are unknown, so each class is represented by its mid-point, found from the class boundaries (see histograms and class boundaries). The answers are then estimates, because we are assuming every value in a class sits at its mid-point.

Method
  1. Find ∑f\sum f (or nn).
  2. Make columns for xx (mid-points if grouped), xfxf and x2fx^2 f, and total them.
  3. Calculate xˉ=∑xf∑f\bar{x} = \dfrac{\sum xf}{\sum f} and keep it to full calculator accuracy.
  4. Calculate the variance ∑x2f∑f−xˉ2\dfrac{\sum x^2 f}{\sum f} - \bar{x}^2, then square-root it.
  5. Give the answer to 3 significant figures, and say "estimate" if the data were grouped.

Working from totals

Exam questions often skip the data and give you summary totals, or give you the mean and standard deviation and ask you to work backwards. Everything follows from three facts, all just rearrangements of the formulas:

Key result
∑x=nxˉ,∑x2=n(σ2+xˉ2),\sum x = n\bar{x}, \qquad \sum x^2 = n\left(\sigma^2 + \bar{x}^2\right),

where σ\sigma is the standard deviation and σ2\sigma^2 the variance. Totals can be added and subtracted; means and standard deviations cannot.

The second fact is the variance formula σ2=∑x2n−xˉ2\sigma^2 = \dfrac{\sum x^2}{n} - \bar{x}^2 rearranged for ∑x2\sum x^2. It is the key to every "combine two groups" and "a value is removed" question.

Combining two data sets

To find the mean and standard deviation of two data sets put together:

Method
  1. For each set, find ∑x=nxˉ\sum x = n\bar{x} and ∑x2=n(σ2+xˉ2)\sum x^2 = n(\sigma^2 + \bar{x}^2).
  2. Add the nns, the ∑x\sum xs and the ∑x2\sum x^2s.
  3. Apply the formulas to the combined totals.

The combined mean is not the average of the two means (unless the sets are the same size), and the combined standard deviation is never found by averaging or adding standard deviations. It can even be larger than both, because the gap between the two means adds spread.

Using the calculator

Your calculator's statistics mode will give xˉ\bar{x} and the standard deviation directly from a list or a frequency table. Use it to check, not to replace, written working: the examiner needs to see ∑x\sum x, ∑x2\sum x^2 (or ∑xf\sum xf, ∑x2f\sum x^2 f) and the formula, or the method marks are lost if the final answer is wrong. The calculator symbol you want is σx\sigma_x (or σn\sigma_n), which divides by nn. The symbol sxs_x (or σn−1\sigma_{n-1}) divides by n−1n - 1 and belongs to Paper 6; it gives a slightly larger answer that Paper 5 mark schemes do not accept.

Interpreting and comparing

A standard deviation means nothing on its own; it is a tool for comparison. When asked to "compare" two data sets, make one comment on the average and one on the spread, each in the context of the question.

  • "On average, the girls took longer than the boys (mean 58.058.0 s compared with 52.552.5 s)."
  • "The boys' times were more variable (standard deviation 6.26.2 s compared with 4.54.5 s), so the girls' times were more consistent."

The standard deviation is affected by every value, including extreme ones; one outlier can inflate it a lot. For skewed data or data with outliers, the median and interquartile range (see median, quartiles and interquartile range) describe the data better. For roughly symmetrical data without outliers, the mean and standard deviation are preferred because they use all the data.

Two quick checks catch most arithmetic errors. The variance can never be negative, and the standard deviation can never be more than half the range. For the eight values above, the range is 1313 and the standard deviation 4.394.39, comfortably inside that limit.

Worked examples

Raw data (routine)

The numbers of emails received by a worker on eight days were

12, 15, 9, 20, 14, 18, 10, 22.12, \ 15, \ 9, \ 20, \ 14, \ 18, \ 10, \ 22.

Find the mean and standard deviation.

Solution

n=8n = 8, ∑x=120\sum x = 120, ∑x2=144+225+81+400+196+324+100+484=1954\sum x^2 = 144 + 225 + 81 + 400 + 196 + 324 + 100 + 484 = 1954.

xˉ=1208=15\bar{x} = \frac{120}{8} = 15sd=19548−152=244.25−225=19.25=4.39 (3 s.f.)\text{sd} = \sqrt{\frac{1954}{8} - 15^2} = \sqrt{244.25 - 225} = \sqrt{19.25} = 4.39 \text{ (3 s.f.)}
A frequency table

The number of goals scored by a team in each of 4040 matches is recorded.

Goals, xx001122334455
Frequency, ff6610101111774422

Calculate the mean and standard deviation of the number of goals.

Solution
xxffxfxfx2fx^2 f
00660000
11101010101010
22111122224444
337721216363
444416166464
552210105050
Total40407979231231
xˉ=7940=1.975\bar{x} = \frac{79}{40} = 1.975sd=23140−1.9752=5.775−3.900625=1.874375=1.37 (3 s.f.)\text{sd} = \sqrt{\frac{231}{40} - 1.975^2} = \sqrt{5.775 - 3.900625} = \sqrt{1.874375} = 1.37 \text{ (3 s.f.)}
Grouped data with unequal classes

The times, tt minutes, taken by 6060 people to complete a puzzle are summarised.

Time tt (minutes)0≤t<100 \le t < 1010≤t<2010 \le t < 2020≤t<3020 \le t < 3030≤t<5030 \le t < 5050≤t<8050 \le t < 80
Frequency8815152222101055

Calculate estimates of the mean and standard deviation of the times.

Solution

Mid-points 5,15,25,40,655, 15, 25, 40, 65.

Mid-point xxffxfxfx2fx^2 f
55884040200200
1515151522522533753375
252522225505501375013750
404010104004001600016000
6565553253252112521125
Total6060154015405445054450
xˉ=154060=25.666…=25.7 minutes (3 s.f.)\bar{x} = \frac{1540}{60} = 25.666\ldots = 25.7 \text{ minutes (3 s.f.)}sd=5445060−25.666…2=907.5−658.777…=248.722…=15.8 minutes (3 s.f.)\text{sd} = \sqrt{\frac{54450}{60} - 25.666\ldots^2} = \sqrt{907.5 - 658.777\ldots} = \sqrt{248.722\ldots} = 15.8 \text{ minutes (3 s.f.)}

These are estimates because the times within each class are assumed to be at the mid-point. Notice that xˉ\bar{x} was kept unrounded: using 25.7225.7^2 instead gives 247.0=15.7\sqrt{247.0} = 15.7, a different final answer.

Working backwards from the mean and standard deviation

A set of 2525 values has mean 1515 and standard deviation 44.

(a) Find ∑x\sum x and ∑x2\sum x^2.

(b) A further value, 2121, is added to the set. Find the new mean and standard deviation.

Solution

(a) ∑x=nxˉ=25×15=375\sum x = n\bar{x} = 25 \times 15 = 375.

From 42=∑x225−1524^2 = \dfrac{\sum x^2}{25} - 15^2: ∑x2=25(16+225)=6025\quad \sum x^2 = 25(16 + 225) = 6025.

(b) Now n=26n = 26, ∑x=375+21=396\sum x = 375 + 21 = 396, ∑x2=6025+212=6466\sum x^2 = 6025 + 21^2 = 6466.

xˉ=39626=15.2 (3 s.f.)\bar{x} = \frac{396}{26} = 15.2 \text{ (3 s.f.)}sd=646626−(39626)2=248.692…−231.976…=16.716…=4.09 (3 s.f.)\text{sd} = \sqrt{\frac{6466}{26} - \left(\frac{396}{26}\right)^2} = \sqrt{248.692\ldots - 231.976\ldots} = \sqrt{16.716\ldots} = 4.09 \text{ (3 s.f.)}

The new value is above the mean and further from it than a typical value, so the mean rises slightly and the standard deviation increases.

Combining two groups (exam style)

The times taken by 1818 boys to run 400 m400\ \text{m} have mean 52.552.5 seconds and standard deviation 6.26.2 seconds. The times of 1212 girls have mean 58.058.0 seconds and standard deviation 4.54.5 seconds. Find the mean and standard deviation of the times of all 3030 students.

Solution

Boys: ∑x=18×52.5=945\sum x = 18 \times 52.5 = 945, ∑x2=18(6.22+52.52)=18(38.44+2756.25)=50304.42\quad \sum x^2 = 18(6.2^2 + 52.5^2) = 18(38.44 + 2756.25) = 50304.42.

Girls: ∑x=12×58=696\sum x = 12 \times 58 = 696, ∑x2=12(4.52+582)=12(20.25+3364)=40611\quad \sum x^2 = 12(4.5^2 + 58^2) = 12(20.25 + 3364) = 40611.

Combined: n=30n = 30, ∑x=1641\sum x = 1641, ∑x2=90915.42\sum x^2 = 90915.42.

xˉ=164130=54.7 seconds\bar{x} = \frac{1641}{30} = 54.7 \text{ seconds}sd=90915.4230−54.72=3030.514−2992.09=38.424=6.20 seconds (3 s.f.)\text{sd} = \sqrt{\frac{90915.42}{30} - 54.7^2} = \sqrt{3030.514 - 2992.09} = \sqrt{38.424} = 6.20 \text{ seconds (3 s.f.)}

The combined standard deviation is close to the boys' value, even though the girls' times were less spread out, because the difference between the two means adds to the overall spread.

Two unknown values (exam-hard)

Five numbers are 3,7,8,a3, 7, 8, a and bb, where a<ba < b. Their mean is 66 and their variance is 4.44.4. Find aa and bb.

Solution

Mean. ∑x=5×6=30\sum x = 5 \times 6 = 30, so 18+a+b=3018 + a + b = 30 and a+b=12a + b = 12.

Variance. ∑x2=5(4.4+62)=5×40.4=202\sum x^2 = 5(4.4 + 6^2) = 5 \times 40.4 = 202, so 9+49+64+a2+b2=2029 + 49 + 64 + a^2 + b^2 = 202 and a2+b2=80a^2 + b^2 = 80.

Substitute b=12−ab = 12 - a:

a2+(12−a)2=80 ⇒ 2a2−24a+64=0 ⇒ a2−12a+32=0 ⇒ (a−4)(a−8)=0.a^2 + (12 - a)^2 = 80 \ \Rightarrow \ 2a^2 - 24a + 64 = 0 \ \Rightarrow \ a^2 - 12a + 32 = 0 \ \Rightarrow \ (a - 4)(a - 8) = 0.

Since a<ba < b, a=4a = 4 and b=8b = 8.

Check: 3,7,8,4,83, 7, 8, 4, 8 have ∑x=30\sum x = 30 and ∑x2=202\sum x^2 = 202, giving variance 2025−36=4.4\tfrac{202}{5} - 36 = 4.4.

Watch out

Rounding the mean too early. Squaring a rounded mean in ∑x2n−xˉ2\dfrac{\sum x^2}{n} - \bar{x}^2 can change the third significant figure of the answer, and with large values can even make the variance negative. Store xˉ\bar{x} in the calculator memory and use the stored value.

Watch out

Using the wrong mid-points. For classes such as "1010–1919" of rounded or discrete data, the mid-point is 9.5+19.52=14.5\tfrac{9.5 + 19.5}{2} = 14.5, not 1515. Find the class boundaries first.

Watch out

Averaging standard deviations. When two groups are combined, the combined standard deviation is not 6.2+4.52\tfrac{6.2 + 4.5}{2} and not a weighted average. Always go back to ∑x\sum x and ∑x2\sum x^2.

Watch out

Forgetting the square root. A question asking for the standard deviation wants variance\sqrt{\text{variance}}. Write "variance ==" and "standard deviation ==" so you and the examiner can see which is which.

Exam tip
  • Show the totals ∑x\sum x and ∑x2\sum x^2 (or ∑xf\sum xf and ∑x2f\sum x^2 f) and the formula with numbers substituted. A correct method earns marks even after an arithmetic slip; a bare calculator answer earns nothing if it is wrong.
  • Give final answers to 3 significant figures unless told otherwise, but carry full accuracy in between.
  • Use σx\sigma_x (divide by nn) on the calculator, never sxs_x.
  • For grouped data, the word "estimate" in the question is a reminder to use mid-points; say why the answer is an estimate if asked.
  • "Compare" questions need two comments, one on the centre and one on the spread, each with the figures quoted and phrased in the context of the question ("the girls' times were more consistent"), not just "B has a higher standard deviation".
Summary
  • Variance == mean of the squared deviations =∑(x−xˉ)2n=∑x2n−xˉ2= \dfrac{\sum (x - \bar{x})^2}{n} = \dfrac{\sum x^2}{n} - \bar{x}^2; standard deviation =variance= \sqrt{\text{variance}}.
  • For frequency tables and grouped data, weight by ff: ∑x2f∑f−xˉ2\dfrac{\sum x^2 f}{\sum f} - \bar{x}^2. Grouped data use mid-points and give estimates.
  • ∑x2\sum x^2 is the sum of the squares, not the square of the sum.
  • ∑x=nxˉ\sum x = n\bar{x} and ∑x2=n(σ2+xˉ2)\sum x^2 = n(\sigma^2 + \bar{x}^2): use these to work backwards and to combine or adjust data sets.
  • Add totals, never means or standard deviations.
  • Keep xˉ\bar{x} unrounded until the end; answers to 3 s.f.
  • Compare with one comment on average and one on spread (consistency), in context.
  • The standard deviation uses all the data but is distorted by outliers; then prefer the median and IQR.

Practice questions

Question
  1. Find the mean and standard deviation of 6,8,11,13,176, 8, 11, 13, 17.

  2. The table shows the number of people, xx, living in each of 3030 houses.

    xx1122334455
    Frequency4477996644

    Calculate the mean and standard deviation of xx.

  3. For 2020 values, ∑x=310\sum x = 310 and ∑x2=5000\sum x^2 = 5000. Find the mean and the standard deviation.

  4. 1212 values have mean 8.58.5 and standard deviation 2.42.4. Find ∑x\sum x and ∑x2\sum x^2.

  5. The heights, hh cm, of 5050 students are summarised.

    Height hh (cm)150≤h<160150 \le h < 160160≤h<165160 \le h < 165165≤h<170165 \le h < 170170≤h<180170 \le h < 180180≤h<195180 \le h < 195
    Frequency5512121818111144

    Calculate estimates of the mean and standard deviation of the heights.

  6. In a test, the 2424 students in class P had mean mark 6161 and standard deviation 88. The 1616 students in class Q had mean 6666 and standard deviation 1010. Find the mean and standard deviation of the marks of all 4040 students.

  7. Fifteen values have mean 4040 and standard deviation 66. One value, 5252, is found to be an error and is removed. Find the mean and standard deviation of the remaining 1414 values.

  8. Two shops record the number of customers each day over a month. Shop A: mean 8484, standard deviation 66. Shop B: mean 7979, standard deviation 1515. Compare the numbers of customers at the two shops.

  9. A set of 1616 values has mean 55 and standard deviation 22. A further kk values, each equal to 55, are added. The standard deviation of the new set is 1.61.6. Find kk.

  10. For a set of nn values, ∑x=72\sum x = 72, ∑x2=600\sum x^2 = 600 and the variance is 1414. Find nn and the mean.

Answers
  1. n=5n = 5, ∑x=55\sum x = 55, ∑x2=36+64+121+169+289=679\sum x^2 = 36 + 64 + 121 + 169 + 289 = 679. Mean =11= 11. Variance =6795−121=135.8−121=14.8= \tfrac{679}{5} - 121 = 135.8 - 121 = 14.8, so standard deviation =14.8=3.85= \sqrt{14.8} = 3.85 (3 s.f.).

  2. ∑f=30\sum f = 30, ∑xf=4+14+27+24+20=89\sum xf = 4 + 14 + 27 + 24 + 20 = 89, ∑x2f=4+28+81+96+100=309\sum x^2 f = 4 + 28 + 81 + 96 + 100 = 309. Mean =8930=2.97= \tfrac{89}{30} = 2.97 (3 s.f.). Variance =30930−(8930)2=10.3−8.8011…=1.4988…= \tfrac{309}{30} - \left(\tfrac{89}{30}\right)^2 = 10.3 - 8.8011\ldots = 1.4988\ldots, standard deviation =1.22= 1.22 (3 s.f.).

  3. Mean =31020=15.5= \tfrac{310}{20} = 15.5. Variance =500020−15.52=250−240.25=9.75= \tfrac{5000}{20} - 15.5^2 = 250 - 240.25 = 9.75. Standard deviation =9.75=3.12= \sqrt{9.75} = 3.12 (3 s.f.).

  4. ∑x=12×8.5=102\sum x = 12 \times 8.5 = 102. ∑x2=12(2.42+8.52)=12(5.76+72.25)=12×78.01=936.12\sum x^2 = 12(2.4^2 + 8.5^2) = 12(5.76 + 72.25) = 12 \times 78.01 = 936.12.

  5. Mid-points 155,162.5,167.5,175,187.5155, 162.5, 167.5, 175, 187.5. ∑f=50\sum f = 50, ∑xf=775+1950+3015+1925+750=8415\sum xf = 775 + 1950 + 3015 + 1925 + 750 = 8415, ∑x2f=120125+316875+505012.5+336875+140625=1419512.5\sum x^2 f = 120125 + 316875 + 505012.5 + 336875 + 140625 = 1419512.5. Mean =841550=168.3 cm= \tfrac{8415}{50} = 168.3\ \text{cm}. Variance =1419512.550−168.32=28390.25−28324.89=65.36= \tfrac{1419512.5}{50} - 168.3^2 = 28390.25 - 28324.89 = 65.36. Standard deviation =65.36=8.08 cm= \sqrt{65.36} = 8.08\ \text{cm} (3 s.f.). Both are estimates, since mid-points were used.

  6. P: ∑x=24×61=1464\sum x = 24 \times 61 = 1464, ∑x2=24(64+3721)=90840\sum x^2 = 24(64 + 3721) = 90840. Q: ∑x=16×66=1056\sum x = 16 \times 66 = 1056, ∑x2=16(100+4356)=71296\sum x^2 = 16(100 + 4356) = 71296. Combined: n=40n = 40, ∑x=2520\sum x = 2520, ∑x2=162136\sum x^2 = 162136. Mean =252040=63= \tfrac{2520}{40} = 63. Variance =16213640−632=4053.4−3969=84.4= \tfrac{162136}{40} - 63^2 = 4053.4 - 3969 = 84.4. Standard deviation =84.4=9.19= \sqrt{84.4} = 9.19 (3 s.f.).

  7. Original: ∑x=15×40=600\sum x = 15 \times 40 = 600, ∑x2=15(36+1600)=24540\sum x^2 = 15(36 + 1600) = 24540. Remove 5252: ∑x=548\sum x = 548, ∑x2=24540−2704=21836\sum x^2 = 24540 - 2704 = 21836, n=14n = 14. Mean =54814=39.1= \tfrac{548}{14} = 39.1 (3 s.f.). Variance =2183614−(54814)2=1559.714…−1532.163…=27.551…= \tfrac{21836}{14} - \left(\tfrac{548}{14}\right)^2 = 1559.714\ldots - 1532.163\ldots = 27.551\ldots. Standard deviation =5.25= 5.25 (3 s.f.).

  8. On average, shop A had more customers per day than shop B (mean 8484 compared with 7979). The number of customers at shop B was much more variable (standard deviation 1515 compared with 66), so shop A's daily numbers were more consistent.

  9. Original: ∑(x−5)2=n×variance=16×4=64\sum (x - 5)^2 = n \times \text{variance} = 16 \times 4 = 64. Each added value equals the mean, so it adds 00 to ∑(x−5)2\sum (x - 5)^2 and leaves the mean at 55. New variance =6416+k=1.62=2.56= \dfrac{64}{16 + k} = 1.6^2 = 2.56, so 16+k=2516 + k = 25 and k=9k = 9.

  10. 14=600n−(72n)214 = \dfrac{600}{n} - \left(\dfrac{72}{n}\right)^2. Multiply by n2n^2: 14n2=600n−518414n^2 = 600n - 5184, so 14n2−600n+5184=014n^2 - 600n + 5184 = 0, i.e. 7n2−300n+2592=07n^2 - 300n + 2592 = 0. The discriminant is 3002−4×7×2592=17424=1322300^2 - 4 \times 7 \times 2592 = 17424 = 132^2, so n=300±13214n = \dfrac{300 \pm 132}{14}, giving n=12n = 12 or n=30.857…n = 30.857\ldots. The number of values must be a whole number, so n=12n = 12 and the mean is 7212=6\tfrac{72}{12} = 6. (Check: 60012−62=50−36=14\tfrac{600}{12} - 6^2 = 50 - 36 = 14.)

How well do you know this?

Builds on

Where this leads

Console

Search notes, courses and tools, or run an action