Variance: Understand the n−1 Correction and Squared Units
Learn what variance measures, why a sample estimate commonly divides by n−1, how squared units and extreme values affect interpretation, and when to report standard deviation or a robust spread measure.
Variance summarizes spread by squaring each observation’s deviation from the mean. The variance of a complete population is the average squared deviation; when a sample is used to estimate a larger population’s variance, the conventional formula divides by n−1. Because variance is measured in squared units and gives extra weight to distant values, readers often need the standard deviation and the distribution’s shape alongside it.
What does variance calculate?
For each value xᵢ, subtract the mean to get its deviation. If you add signed deviations, positive and negative values cancel and the sum is zero. Squaring makes every contribution nonnegative and gives more weight to a large departure. NIST illustrates the effect: a value 2 units from the mean contributes 4 to the squared-deviation sum, while one 10 units away contributes 100. A point five times farther away can therefore contribute 25 times as much. This sensitivity is useful in calculations, but it also makes variance sensitive to extremes.
If every member of the population is observed, calculate the population variance:
Population variance σ² = Σ(xᵢ − μ)² / N
Here μ is the population mean and N is the number of population values. For a probability distribution, the same idea weights each squared deviation by the probability of its value and adds the results.
When a sample is used to estimate the variance of a larger population, the usual sample variance is:
Sample variance s² = Σ(xᵢ − x̄)² / (n − 1)
Here x̄ is the sample mean and n is the sample size. For an independent, identically distributed sample, dividing by n−1 makes s² an unbiased estimator of the population variance. By contrast, if the goal is to describe the observed sample as a complete group in its own right, dividing its squared-deviation sum by n gives that group’s average squared deviation. The formulas answer different questions; neither denominator is universally correct. OpenStax, “Measures of the Spread of the Data” — https://openstax.org/books/introductory-statistics-2e/pages/2-7-measures-of-the-spread-of-the-data.
Why does a sample formula use n−1?
Once you calculate x̄ from the sample, the deviations from x̄ must sum to zero. If n−1 deviations are known, the last one is fixed, so there are only n−1 freely varying deviations. From an estimation perspective, using the same sample to estimate the mean tends to make the sum of squared deviations smaller than it would be if the population mean were known. Under independent, identically distributed sampling with finite variance, the expected sum is (n−1)σ²; dividing by n−1 therefore gives σ² on average. OpenStax’s data science text discusses the sample correction — https://openstax.org/books/principles-data-science/pages/3-2-measures-of-variation.
Do not apply n−1 mechanically in every situation. If the data include every transaction in the period you want to describe, N matches the population definition. If a sample is intended to estimate a broader customer or process population, the sample formula is usually appropriate. Complex survey designs, weights, or time-dependent observations may require estimators that reflect the design; the simple n−1 formula does not automatically handle them. State the target population and sampling process before choosing a denominator.
Work through a small example
Suppose, hypothetically, a system records these request times for one batch, in minutes: 2, 4, 4, 5, 5. The mean is (2+4+4+5+5)/5 = 4 minutes. The deviations are −2, 0, 0, 1, 1 minutes, and their squares are 4, 0, 0, 1, 1 minutes². They sum to 6 minutes².
If these five requests are the entire group of interest, the population variance is 6/5 = 1.2 minutes². If the same observations are treated as a random sample from a larger request stream, the sample variance is 6/4 = 1.5 minutes². Taking square roots gives standard deviations of about 1.10 and 1.22 minutes, respectively. The arithmetic is the same, but the question changes: the first describes this batch; the second estimates variation in a larger stream. These values are an illustrative assumption, not measurements of a real system.
How should variance and standard deviation be read?
Variance is an average squared deviation, or an estimator of that quantity, so data measured in minutes produce variance in minutes², and lengths produce variance in length². Do not interpret a variance value as the typical number of minutes by which observations differ. The standard deviation is the square root of variance and returns to the original unit, which often makes it easier to communicate. Variance is useful in squared-error models, calculations of variation components, and statistical inference; standard deviation is often more suitable when a report needs an intuitive measure of spread. OpenStax explains why standard deviation is commonly used to communicate spread — https://openstax.org/books/principles-data-science/pages/3-2-measures-of-variation.
Variance is nonnegative and equals zero only when all observed values are identical. Changing units rescales it by the square of the conversion factor. For example, converting minutes to seconds multiplies every value by 60, so variance is multiplied by 60² = 3,600. Adding the same constant to every value changes neither the deviations from the mean nor the variance. Do not compare raw variance values across data sets with different units or scales.
When should you add another measure of spread?
Because variance squares deviations from the mean, it is sensitive to long tails and extreme observations. Do not automatically delete an extreme value before confirming that it is an error; inspect the distribution and the data’s context. If a distribution is strongly skewed or a few large observations dominate the squared deviations, the median and interquartile range (IQR), or the median absolute deviation (MAD), may provide a more stable summary. NIST describes how variance and standard deviation respond to tails and contrasts them with less extreme-sensitive measures — https://itl.nist.gov/div898/handbook/eda/section3/eda356.htm.
Also distinguish variance from standard error. Variance describes spread among observations or outcomes of a random variable. Standard error describes the sampling variation of a statistic across repeated samples. For example, under appropriate conditions with independent observations, the standard error of a mean is the population standard deviation divided by the square root of the sample size. A small data standard deviation does not by itself establish that an estimate is precise; sampling design and sample size matter too.
A practical reporting sequence
State whether the data are the entire group being described or a sample from a larger population.
Check the unit of analysis, missing-value handling, and duplicate rule before calculating the mean and squared deviations.
Choose a denominator that matches the goal: N for describing the full population; n−1 for the usual variance estimate from an independent sample. For weights or complex sampling, check a design-aware method.
Keep the squared-deviation sum before rounding so the result can be reproduced. If software is used, verify whether its option is population or sample variance.
Report the variance with squared units and, for readers, add the standard deviation and a distribution summary. If the tails are long, consider the median with IQR or MAD as well.
For example, “request-time variance is 1.5” does not reveal the unit, denominator, or target. “In a random sample of n=5, the sample variance of request time was 1.5 minutes² and the sample standard deviation was about 1.22 minutes, under an independent-sample assumption” makes the scope and meaning clearer.
Variance compresses squared deviations around the mean into one number that can compare variability and support inference. Its squared units are less intuitive, and extremes receive extra weight, so state the denominator and inspect the distribution. For a broader comparison of means, medians, IQR, and other summaries, see the descriptive-statistics guide — https://knowledge.linkspot.net/ko/articles/8293b6d7-aa04-4a04-a0de-dc704dc46ac8.
References
NIST/SEMATECH, “Measures of Scale” — https://itl.nist.gov/div898/handbook/eda/section3/eda356.htm OpenStax, “Measures of the Spread of the Data” — https://openstax.org/books/introductory-statistics-2e/pages/2-7-measures-of-the-spread-of-the-data OpenStax, “Measures of Variation” — https://openstax.org/books/principles-data-science/pages/3-2-measures-of-variation OpenStax, “Mean or Expected Value and Standard Deviation” — https://openstax.org/books/introductory-statistics-2e/pages/4-2-mean-or-expected-value-and-standard-deviation