Standard Deviation & Variance
Two numbers tell you how spread out your data is. Variance is the average squared distance from the mean; standard deviation is its square root — the typical distance of a value from the average, in the data's own units.
What it is
The mean tells you where a dataset is centered. It says nothing about whether the values huddle close to that center or scatter far from it. Standard deviation answers that second question: how far, typically, is a value from the mean?
Two datasets can share a mean of 50 yet look nothing alike. One might run 49, 50, 51 — barely moving. The other might run 10, 50, 90 — flung wide. Same center, wildly different spread. Standard deviation puts a single number on that difference. A small standard deviation means tight, consistent, predictable; a large one means scattered, variable, hard to pin down.
Variance is the same idea one step earlier in the calculation. It's the average of the squared distances from the mean. Squaring keeps everything positive (so distances above and below the mean don't cancel) and penalizes far-flung values more heavily. The catch: squaring also squares the units. If your data is in dollars, the variance is in dollars-squared, which means nothing to a human. Taking the square root undoes that — and the result, in plain dollars, is the standard deviation.
The formula
There are two versions, and the difference matters. The population version assumes you have every value there is; the sample version assumes your data is a sample drawn from a larger population you're trying to describe.
Population variance: σ² = (1/N) · Σ (xᵢ − μ)²
Sample variance: s² = (1/(n−1)) · Σ (xᵢ − x̄)²
Standard deviation = √variance (σ or s)
Here μ is the true population mean, x̄ is the sample mean, N is the population size, and n is the sample size. The only structural difference is the divisor: N for a population, n−1 for a sample.
Why n−1?
When you compute variance from a sample, you don't know the true mean μ — you estimate it with the sample mean x̄. But x̄ is, by construction, the point that sits closest to your particular sample. So the squared distances measured against x̄ are systematically a little too small, and dividing by n would underestimate the real spread. Dividing by n−1 instead inflates the result just enough to correct that bias — this is Bessel's correction. The intuition: estimating the mean "uses up" one degree of freedom, leaving only n−1 independent pieces of information about the spread.
How to read it
| What you see | What it means |
|---|---|
| SD small relative to the mean | Tight, consistent data — values cluster near the average |
| SD large relative to the mean | Wide spread — values scatter far from the average |
| SD = 0 | Every value is identical; there is no spread |
| Variance vs. SD | Same information; SD is in the data's units, variance in squared units |
For roughly bell-shaped (normal) data, standard deviation has a handy reading: about 68% of values fall within one SD of the mean, about 95% within two, and about 99.7% within three. That "empirical rule" is also why standard deviation is the natural unit for a z-score — how many SDs a value sits from the mean.
ddof=1, pandas (.std()), and R (sd()), so a Stratum result lines up with those tools on the same data. Missing and non-finite values are dropped first, and the reported N is the count actually used — see the conventions page for the full missing-value rule.
See also
- Related terms
- Z-Score · Normal Distribution · Mean, Median & Mode
- On the blog
- Mean vs. median: which to use
- In the app
- Read SD and variance in the Summary report
Standard deviation is the most-used measure of spread for good reason: it's in the data's own units, it underpins the normal distribution, and it's the building block of z-scores, confidence intervals, and most of inferential statistics. Just remember which divisor produced it — sample n−1 is almost always what you want.