Start with the question: Am I describing the entire group I care about, or using a sample to estimate variability in a larger group? The choice depends on that goal, not simply on whether the data set is large or small.
1. Use the population formula for the entire population of interest.
If you have all N values in the group you want to describe, calculate its mean μ and use:
σ² = Σ(xᵢ − μ)² / N
σ = √σ²
Variance is the average squared distance from the population mean. Standard deviation takes the square root, putting the measure back in the original units. If observations are measured in minutes, variance has units of minutes squared, while standard deviation is measured in minutes.
2. Use the sample formula to estimate population variability from a sample.
When the population mean is unknown and you estimate it using the same sample, calculate the sample mean x̄ and use:
s² = Σ(xᵢ − x̄)² / (n − 1)
s = √s²
This formula requires n ≥ 2.
Why n − 1? The sample mean is fitted to the observed data, making the squared distances around it smaller, on average, than those around the true population mean. Dividing by n − 1 corrects that downward bias in the variance estimate under the usual independent, identically distributed sampling model with finite variance.
There is also a useful “degrees of freedom” interpretation: the deviations from x̄ sum to zero. Once you know n − 1 deviations, the last one is determined.
3. Compare both calculations using the same numbers.
For the values 2, 4, and 6, the mean is 4, and the sum of squared deviations is:
(2 − 4)² + (4 − 4)² + (6 − 4)² = 8.
If these three values are your entire population:
σ² = 8/3 ≈ 2.667, and σ ≈ 1.633.
If they are a random sample used to estimate variability in a larger population:
s² = 8/(3 − 1) = 4, and s = 2.
Two distinctions to remember: The n − 1 correction makes s² unbiased under the stated model; taking its square root does not make s exactly unbiased. Also, standard deviation describes variability among individual observations. The estimated standard error of a sample mean, s/√n under the usual independent sampling model, describes uncertainty in the estimated mean.
Quick check: If those three numbers describe every student in a class of three, and that class is your population of interest, which denominator applies? Three, not two.