Standard deviation, and the choice between sample and population
Standard deviation measures spread: how far, typically, the values sit from their mean. For 2, 4, 4, 6, 8 the mean is 4.8, and the sample standard deviation is 2.28. Switch the method to population and the same data gives 2.04.
Why two answers from one dataset
The difference is the denominator. The population formula divides the summed squared deviations by n; the sample formula divides by n − 1. That subtraction — Bessel's correction — exists because a sample's own mean is always the point that minimises its squared deviations, so the spread measured around it systematically understates the spread around the true population mean. Dividing by a smaller number corrects the bias upward.
The correction matters most when n is small. With 5 values it inflates the result by about 12%; with 100 values it is about half a percent. Which is to say: with a decent sample size, stop worrying about it; with five data points, it is the difference between two visibly different answers.
Which one to pick
- Sample
- Use this when your values are a subset drawn from a larger group you want to say something about — survey respondents, measured parts off a production line, a month of readings. This is the right default for nearly all real analysis, which is why it is the page's default.
- Population
- Use this only when your values are the entire group: every employee in the company, every match in the season, all six faces of a die. If you can imagine collecting more data from the same source, you have a sample.
Reading the number
Standard deviation is in the same units as the data, which is its advantage over variance. For roughly bell-shaped data, about 68% of values fall within one standard deviation of the mean and about 95% within two. That rule fails for skewed or multi-peaked data, and it is worth plotting before leaning on it.
It is also sensitive to outliers, because deviations are squared before averaging. One extreme value can dominate the result — add a 40 to the example data and the figure jumps from 2.28 to about 14.5. Where outliers are expected, the interquartile range is a sturdier measure of spread.
Common questions
- Which does Excel use?
- STDEV.S is the sample formula; STDEV.P is the population one. The older STDEV is the sample version. Spreadsheets disagreeing with a textbook is almost always this.
- What is the relationship to variance?
- Standard deviation is the square root of variance. Variance is easier to work with algebraically; standard deviation is easier to interpret, because it shares the data's units.
- How many values do I need?
- At least two for a sample, or the correction divides by zero. For a figure you would act on, considerably more — small samples produce unstable estimates of spread.
Your privacy
Nothing you type leaves your browser.