Key Points
The sample variance formula is , dividing the summed squared deviations by one less than the number of observations.
The NIST e-Handbook of Statistical Methods prints the sample variance with in the denominator, not , in its Measures of Scale section.
Dividing by rather than corrects a downward bias, because deviations are measured from the sample mean rather than the unknown population mean.
Sample variance is always reported in squared units, so a variance of 9 on a set of heights in centimetres is 9 square centimetres.
Taking the square root of the sample variance gives the sample standard deviation, which returns the spread to the original units.
What Is the Sample Variance Formula?
The sample variance formula measures how far a set of sample values spreads from their own mean, and it is written
where is the sample mean and is the number of observations. The NIST/SEMATECH e-Handbook of Statistical Methods prints this same formula with in the denominator.
The Full Definition
Variance answers a narrow question: take each value's distance from the mean, square those distances, and average them. Squaring matters because raw deviations from the mean always sum to zero, so without it every data set would appear to have no spread at all.
The sample version differs from the population version in one place only, the denominator. That single change makes an unbiased estimate of the population variance it stands in for, and everything else about the calculation is identical.
Why the Denominator Is n Minus 1
The sample mean is computed from the same data whose spread is being measured, and that is the problem. It sits, by construction, at the point making the sum of squared deviations as small as it can possibly be.
So deviations measured from the sample mean run systematically a little too small against deviations from the true population mean, and dividing by would carry that understatement into the answer. Reducing the denominator to inflates the result by just enough to cancel the bias on average.
The quantity is the degrees of freedom: once the mean is fixed, only deviations vary freely, because the last is forced by their summing to zero.
Variable Key
Symbol | Meaning | Unit or type | Notes |
|---|---|---|---|
sample variance | squared units of | the quantity being computed | |
the th observation | same units as the data | one value from the sample | |
sample mean | same units as the data | ||
sample size | count | the number of observations | |
degrees of freedom | count | the divisor, not | |
summation over all | operator | runs from to |
Examples of the Sample Variance Formula
Example 1
Find the sample variance of 4, 6, 8.
The mean is . The deviations are :
Final answer:
Example 2
Find the sample variance of 2, 4, 4, 4, 5, 5, 7, 9 by dividing by n.
Dividing by the number of observations is what "average" means everywhere else in arithmetic, so is the natural choice. Try it.
The mean is , and the squared deviations are , summing to 32:
That gives 4. But this is a sample standing in for a larger population, and the deviations were measured from the sample's own mean, which always sits where the squared total is smallest. So 4 understates the population spread.
The correction is to divide by :
Final answer:
The two answers differ by about 14 per cent here. On a sample of 100 the gap would be about 1 per cent, which is why the correction matters most on small samples.
Example 3
A sample of five test scores is 70, 75, 80, 85, 90. Find the sample variance.
The mean is , and the deviations are :
Final answer: squared marks
Example 4
Two samples have the same mean. Sample A is 49, 50, 51 and sample B is 20, 50, 80. Compare their sample variances.
Both means are 50. For A the squared deviations are , and for B they are :
Final answer: and
Equal means tell you nothing about spread, which is the gap variance exists to fill.
Example 5
A sample of four measurements in centimetres is 12.1, 12.4, 12.2, 12.5. Find the sample variance, keeping four decimal places.
The mean is , and the deviations are :
Final answer: square centimetres
The unit is square centimetres, which has no physical meaning as a length. That is why the standard deviation, about 0.18 cm here, is usually reported instead.
Don't Confuse This With the Population Variance or the Standard Deviation
Quantity | Symbol | Formula | When to use |
|---|---|---|---|
Sample variance | Data is a sample from a larger population | ||
Population variance | Data is the entire population | ||
Sample standard deviation | You need the spread in original units | ||
Mean deviation | You want absolute, not squared, distances |
The decision between and is about what the data represents, not about its size. Twenty thousand values are still a sample if drawn from something larger, and five values are a population if those five are all that exist.
Where Do Students Trip Up on Sample Variance?
Mistake 1: Dividing by n instead of n minus 1
Where it slips in: Every other average in school divides by the count, so is the reflex, and calculators often offer both without labelling which is which.
Don't do this: for sample data.
The correct way: . Ask first whether the data is a sample or the whole population, and let that choose the denominator.
Students who write the denominator before computing anything else make this error far less often, because the choice gets made deliberately rather than at the end when attention has moved on. On a calculator, the sample version is usually the key marked or .
Mistake 2: Forgetting to square the deviations
Where it slips in: The subtraction is the visible work, so the squaring step gets skipped when the arithmetic is done mentally.
Don't do this: , whose numerator is always zero.
The correct way: Square each deviation before summing. A numerator of zero on data that visibly varies is the signature of this slip.
Mistake 3: Reporting variance in the original units
Where it slips in: The answer is a number and the data had units, so the units get carried across unchanged.
Don't do this: Describe a variance of 62.5 as 62.5 marks.
The correct way: Variance is in squared units, so it is 62.5 squared marks. If the original units are wanted, take the square root and report the standard deviation instead.
Key Takeaways
The sample variance formula is , the summed squared deviations over the degrees of freedom.
The divisor exists because deviations taken from the sample mean understate the true spread, and it corrects that bias.
Variance is always non-negative and always in squared units, which is why the standard deviation is usually reported instead.
Choosing between and depends on whether the data is a sample or an entire population, not on how much data there is.
To work through spread and dispersion with a teacher, explore a high school math tutor or math classes online.
A Practical Next Step
Find the sample variance of 3, 7, 7, 19. Then compute it again dividing by instead, and note how much smaller the second answer is on a sample this small.
Want a live Bhanzu trainer to walk through more statistics problems? Book a free demo class.
Read More
Was this article helpful?
Your feedback helps us write better content