Math & Scientific
Calculate Variance: Population and Sample Examples
Follow two variance calculations from mean to squared deviations, verify n versus n−1, and check the result using an independent identity.
Choose a definition before dividing
Variance is a mean squared distance from a mean. For a complete finite population, use the sum of squared deviations divided by N. For the usual sample variance estimating a population variance, use n−1 after estimating the mean from that sample. A worked example should label which result it reports. Both outputs can be arithmetically correct for the same list, while only one matches the question being asked. Do not describe the difference as a rounding discrepancy.
Calculate the mean for the first example
Use the four values 3, 5, 7 and 9. Their sum is 24, giving mean 6. The deviations from the mean are −3, −1, 1 and 3. This symmetric arrangement makes the subtraction easy to check: the deviations add to zero. That zero sum is a property of deviations around the arithmetic mean, not evidence that the data have no variability. The values are clearly spread over the interval from three to nine.
Square deviations and produce both answers
The squared deviations are 9, 1, 1 and 9, with total 20. Population variance is 20/4=5. Sample variance is 20/3≈6.666667. Enter the original observations, not the squared deviations, in the local form and compare both labels. If you paste 9, 1, 1, 9 instead, the calculator treats those four numbers as a new data set and centres them around their own mean. It does not know they are intermediate values from another calculation.
Check the arithmetic with a sum-of-squares identity
For this small example, the sum of the original squared values is 9+25+49+81=164. The identity Σ(x−x̄)²=Σx²−(Σx)²/n gives 164−24²/4=20, matching the direct calculation. This is a useful hand check with modest numbers. It can be numerically unstable in floating-point arithmetic when large, nearly equal quantities are subtracted, so it is not a recommendation to use that shortcut blindly for every computer implementation or measurement scale.
Work a second example with a negative value
For −2, 0 and 4, the mean is 2/3. The deviations are −8/3, −2/3 and 10/3, and their squared sum is 168/9=56/3. Population variance is 56/9≈6.222222; sample variance is 28/3≈9.333333. The variance remains positive even though one observation is negative. Keep fractions or sufficient decimal precision during the calculation, because rounding the mean to one decimal place before squaring introduces avoidable error in the final comparison.
Attach squared units and distinguish SD
If the first list is measured in metres, its population variance is five square metres in the statistical sense of squared measurement units. Its population standard deviation is √5≈2.236068 metres. The variance is not a typical deviation measured in metres; taking the square root restores the original unit. For reporting to readers who need a scale comparable with the observations, standard deviation is often easier to interpret, while variance remains convenient in algebra and statistical models.
Use simple invariance checks
Adding 100 to every value in the first list changes the mean from 6 to 106 but leaves both variances unchanged. Multiplying all values by three multiplies each squared deviation by nine, giving population variance 45 and sample variance 60. These properties provide independent checks on a spreadsheet or a copied formula. They also explain why comparisons of raw variances across different measurement units require care: a unit conversion changes the numerical value by the square of its scale factor.
Keep the sampling interpretation visible
The n−1 denominator makes the usual sample variance unbiased for a population variance under the appropriate independent, identically distributed sampling assumptions. It does not correct selection bias, dependence, recording errors or a mismatch between the sample and target population. If the exercise simply asks for descriptive population variance of the listed values, use N. Record the count, mean, squared-deviation sum and chosen denominator so another reader can reproduce the result without guessing which convention was used.
Calculator for the supported step
The variance form accepts at least two raw numbers and displays population and sample results together. It does not accept a probability distribution or a frequency column; expand modest exact frequencies before entering them.