How to calculate mean, variance, and standard deviation
The mean tells us where the data are centered. Variance and standard deviation tell us how spread out the values are around that mean. We’ll calculate all three and see what changes when the data are a sample.
Find the population or sample mean
A population contains the whole group you want to describe. A sample is part of that group. Add the values and divide by their count. We use and for population size and mean, and and for sample size and mean.
Square the deviations, then choose the denominator
Subtract the mean from each value and square the result. Squaring keeps the positive and negative deviations from canceling. Add the squares.
For a sample with at least two observations, dividing by gives an unbiased estimate of population variance under the usual random sampling assumptions. That means it is correct on average over repeated samples. An individual estimate can be above or below the population variance.
Take the square root to get standard deviation
Variance is in squared units. Taking the square root puts standard deviation back in the units of the original values. The square root of an unbiased variance estimate is generally biased as an estimate of population standard deviation.
Example: Find all three measures for a sample
A principal samples ten teachers’ ages. Their ages add to , so the mean is years. Subtract from each age, then square each difference.
| Age | Deviation | Squared deviation |
|---|---|---|
The squared deviations add to 1,007.60. The sample has ten observations, so divide by nine before taking the square root.
The sample variance is about 111.96 square years and the sample standard deviation is about 10.58 years.