# Sample variance

Sample variance divides the sum of squared gaps by n minus 1, not n. This corrects for the fact that a sample sits closer to its own mean than to the true population mean.

Statistics (university) · Part 01: Describing data · Card 6 of 9 · Last updated 2026-10-19

## Analogy

A sample is a photo of a crowd. The photo makes the crowd look slightly more alike than it is, so we nudge the estimate upward.

## Example

**Why n minus 1**

Sample: 2, 4, 6
Mean = 4
Squared gaps: 4, 0, 4 (sum 8)
Sample variance = 8 / 2 = 4
Sample SD = 2
(Dividing by 3 gives 2.67)

## In practice

Whenever you estimate spread from a sample, which is almost always, you use n minus 1.

## Practice

### Flashcards

- **Why use n minus 1 in sample variance?** It corrects the bias from measuring spread around the sample mean.

### Interview questions

**A sample is 2, 4, 6. Calculate the sample standard deviation and explain the n minus 1.**

- Mean is 4
- Squared gaps sum to 8
- Variance 8 / 2 = 4
- SD is 2
- n minus 1 corrects bias

## Questions people ask

### Why do we divide by n minus 1 for a sample?

The sample mean is calculated from the same data, so values sit closer to it than to the true mean. Dividing by n would underestimate the true variance on average. Using n minus 1 removes that bias. The effect matters most for small samples.

### What does n minus 1 mean in degrees of freedom?

Once the sample mean is known, only n minus 1 values are free to vary, because the last one must make the total match. Those free values are the degrees of freedom. With 3 values and a known mean, picking two fixes the third.

## Related concepts

- [Standard deviation](https://studyvisually.com/learn/science/statistics-university/statistics-university-part-1/statistics-university-part-1-concept-5)
- [Quartiles and IQR](https://studyvisually.com/learn/science/statistics-university/statistics-university-part-1/statistics-university-part-1-concept-7)

Web page: https://studyvisually.com/learn/science/statistics-university/statistics-university-part-1/statistics-university-part-1-concept-6
Study this card in the app: https://studyvisually.com/app/learn?category=statistics-university&card=statistics-university-part-1-concept-6
