30% off your first 3 months

Get the deal

Standard deviation by hand

by DuckyHelperNov 12, 20264 min read
Math

TL;DR:

  • Standard deviation measures the typical distance of values from the mean.

  • Steps: find the mean, take deviations, square them, average the squares, take the square root.

  • Divide by n for a whole population and by n − 1 for a sample.

Two classes both have a mean test score of 75. In one, every student scored between 73 and 77. In the other, scores ranged from 40 to 100. The means match, but the classes are very different. The standard deviation puts a number on that difference, and you can compute it with nothing more than a pencil.

The idea: a typical distance from the mean

Each value sits some distance from the mean. If we averaged the signed distances, the positives and negatives would cancel to exactly zero, which tells us nothing. So we square each distance first (making everything positive and giving extra weight to far-off values), average the squares, and then take the square root to get back to the original units.

Worked example: 2, 4, 4, 4, 5, 5, 7, 9

  1. Mean: the sum is 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40, and there are 8 values, so the mean is 40 / 8 = 5.

  2. Deviations from the mean: −3, −1, −1, −1, 0, 0, 2, 4. Check: they add to 0.

  3. Square them: 9, 1, 1, 1, 0, 0, 4, 16.

  4. Add the squares: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32.

  5. Divide by n = 8: 32 / 8 = 4. This is the variance.

  6. Take the square root: √4 = 2.

The standard deviation is 2. Reading it: a typical value in this set lies about 2 away from the mean of 5. Check against the data: five of the eight values lie within 2 of the mean, between 3 and 7. Reasonable.

Value

Deviation

Squared

2

−3

9

4

−1

1

4

−1

1

4

−1

1

5

0

0

5

0

0

7

2

4

9

4

16

The working, with a total of 32

Population or sample?

If the eight numbers are the entire group you care about (a population), divide the squares by n, as above. If they are a sample from a bigger group, you divide by n − 1. The reason is that a sample's values sit closer to their own mean than to the true population mean, so dividing by n would tend to underestimate the spread. Using n − 1 corrects that on average.

For the same data treated as a sample: 32 / 7 ≈ 4.571, and √4.571 ≈ 2.14. The difference between 2 and 2.14 is modest here, and it shrinks as the sample grows. When a problem does not say, check your course notes or the calculator's labels, usually σ for population and s for sample.

A second small example

Take 1, 5, 9. The mean is 5, the deviations are −4, 0 and 4, and the squares are 16, 0 and 16, which add to 32. As a population: 32 / 3 ≈ 10.67, so σ ≈ 3.27. As a sample: 32 / 2 = 16, so s = 4. With only three values, the choice of divisor matters a lot. Notice also that 3.27 and 4 sit between the smallest distance (0) and the largest (4), which is a quick plausibility test.

What the number tells you

Compare spreads, not just centres. A set with the same mean 5 but values 4, 5, 5, 5, 6 has deviations −1, 0, 0, 0, 1, squares add to 2, population variance 2 / 5 = 0.4 and σ ≈ 0.63. Much tighter than the first set's 2. Standard deviation is in the same units as the data, so it can be read directly: points on a test, centimetres of height, minutes of delay.

Try one yourself: 10, 12, 14, 16, 18

The mean is 70 / 5 = 14. Deviations: −4, −2, 0, 2, 4, adding to 0. Squares: 16, 4, 0, 4, 16, adding to 40. As a population, the variance is 40 / 5 = 8 and σ = √8 ≈ 2.83. As a sample, it is 40 / 4 = 10 and s = √10 ≈ 3.16.

Notice the evenly spaced values. Their spread is easy to see: the typical distance from the middle is a little under 3, and the standard deviation agrees. If you double every value, the standard deviation doubles as well, to about 5.66. If you add 100 to every value, it does not change at all, because the gaps between the values stay the same.

How to check your answer

  • Deviations sum to zero. If not, the mean is wrong.

  • Size. The standard deviation cannot exceed the biggest deviation. Here the biggest is 4, and 2 fits.

  • Units. The answer has the same units as the data, while variance has squared units.

  • Zero test. If all values are identical, the standard deviation is 0.

Common mistakes

  • Forgetting to take the square root, and reporting the variance.

  • Squaring after adding rather than before.

  • Dividing by the wrong count.

  • Using the wrong mean when the deviations are computed.

Where you will use it next

Standard deviation pairs with the centre measures from mean, median and mode: which one to report. A different, outlier-resistant way to show spread is in reading a box plot. To keep a worked example for revision, write it up step by step like the table above.

Frequently asked questions

Why not use absolute values instead of squares?

You can: that gives the mean absolute deviation. Squares are preferred in statistics because they have convenient algebraic properties, but both measure spread.

Can the standard deviation be negative?

No. It is a square root of a sum of squares, so it is zero or positive.

Get started

DuckyHelper can
do more

It sees your screen and works in any app you use. Try it for 10 minutes, no card.

Get it for Mac, Windows or Linux

Share

Questions and jobs

Do anything

Ask it a question or hand it a job, in any app.

Doing jobs for you is in early access on Mac. Asking works on Mac, Windows and Linux.