Variance: Measuring Spread
You already know about averages. If I tell you the average height in a class is 165 cm, you have a central value. But that single number hides a lot. Are all students close to 165 cm, or are some very short and some very tall? Variance answers that question.
The Intuition: How "Spread Out" Are the Numbers?
Imagine two small datasets:
- Dataset A: 160, 162, 165, 168, 170
- Dataset B: 140, 150, 165, 180, 190
Both have the same mean (165). But Dataset B is much more "spread out." Variance is a single number that captures this spread. The bigger the variance, the more the numbers are scattered away from the mean.
Building the Formula Step by Step
We need a way to measure, on average, how far each data point is from the mean. Let's call the mean xˉ.
Step 1: Find the deviation of each point.
For a data point xi, the deviation is xi−xˉ. This tells us how far that point is from the mean, with a sign (positive if above, negative if below).
Step 2: Square each deviation.
Why square? Two reasons:
- Squaring removes the sign. A deviation of +5 and -5 both become 25. We care about distance, not direction.
- Squaring gives more weight to points that are far from the mean. A point 10 units away contributes 100, while a point 2 units away contributes only 4. This is usually what we want — outliers matter more.
Step 3: Average the squared deviations.
For a population (all data), we divide by N (the number of data points). For a sample (a subset), we divide by n−1 (this is called Bessel's correction — it gives a better estimate of the population variance). For a first introduction, focus on the population formula.
Population Variance (σ2)
σ2=N1∑i=1N(xi−xˉ)2
A Worked Example
Take Dataset A: 160, 162, 165, 168, 170. Mean xˉ=165.
| xi | xi−xˉ | (xi−xˉ)2 |
|---|
| 160 | -5 | 25 |
| 162 | -3 | 9 |
| 165 | 0 | 0 |
| 168 | 3 | 9 |
| 170 | 5 | 25 |
Sum of squared deviations = 25+9+0+9+25=68.
Variance σ2=568=13.6.
Now Dataset B: 140, 150, 165, 180, 190. Mean xˉ=165.
| xi | xi−xˉ | (xi−xˉ)2 |
|---|
| 140 | -25 | 625 |
| 150 | -15 | 225 |