Statistics · Lesson 3 of 6
Variance and Standard Deviation
“Average squared deviations to measure spread, then restore the original unit with a square root.”
• Explain why squaring deviations prevents cancellation and why their total needs a denominator. • Derive variance from average squared distance to the mean and interpret zero variance. • Calculate standard deviation and distinguish its unit from the unit of variance. • Calculate variance and standard deviation for raw observations and discrete frequencies. • Use algebra and known summation formulas to reason about structured datasets.
A second way to retain every deviation
Absolute distances prevented positive and negative deviations from cancelling. Squaring each deviation also makes its contribution nonnegative, and it gives a useful algebraic measure. Larger deviations contribute disproportionately more: a distance of 4 contributes 16, whereas a distance of 2 contributes 4. This makes squared deviations especially responsive to values far from the mean.
Start with observations x₁, x₂, …, xₙ and their mean x̄. Their squared deviations are (x₁ − x̄)² through (xₙ − x̄)². If their sum is zero, every squared deviation must be zero, because none can be negative. Hence every observation equals the mean. If the sum is positive, some variation exists, but its size also depends on how many observations were included.
Why a total of squares can give a misleading comparison
Imagine comparing a small dataset with a much larger one. Even if each value in the larger set lies closer to the common mean, it has many more contributions to its squared-deviation total. A measure intended to describe average scatter should not grow merely because more observations were counted. The chapter’s two datasets make this issue concrete.
Problem
Set A is 5, 15, 25, 35, 45, 55. Set B contains every integer from 15 to 45. Compare their squared-deviation totals and averages.
- 1.Both sets have mean 30. A’s deviations are −25, −15, −5, 5, 15, 25.
- 2.A’s squared total is 625 + 225 + 25 + 25 + 225 + 625 = 1750.
- 3.B’s deviations are every integer from −15 to 15. Its squared total is 2(1² + 2² + … + 15²) = 2 × 15 × 16 × 31/6 = 2480.
- 4.The total for B is larger, but B also has 31 observations while A has 6. Averaging gives 1750/6 ≈ 291.67 for A and 2480/31 = 80 for B.
- 5.The average squares correctly reflect the greater distances in A. The difference arises from dividing by each dataset’s own count, not from changing either dataset.
| Dataset | Count | Mean | Squared-deviation total | Average squared deviation |
|---|---|---|---|---|
| A | 6 | 30 | 1750 | 1750/6 ≈ 291.67 |
| B | 31 | 30 | 2480 | 80 |
Variance is the mean squared deviation
The quantity obtained by averaging the squared deviations from the mean is called variance. It uses every observation and accounts for the dataset size. Its symbol is σ², read as sigma squared. The lowercase sigma σ is different from the uppercase summation symbol Σ.
Variance is the arithmetic mean of the squared deviations of the observations from their arithmetic mean. In the convention used here, the denominator is the number of observations in the dataset.
Variance is always nonnegative. It equals zero exactly when all observations are identical. A large variance indicates larger average squared distances, but comparisons need a common measurement scale and context. A variance of 25 in one unit is not directly comparable with 25 in an unrelated unit.
Problem
Find the variance of 7, 7, 7, 7.
- 1.The mean is 28/4 = 7.
- 2.Each deviation is 7 − 7 = 0, so each squared deviation is zero.
- 3.The variance is 0/4 = 0. The dataset has a centre but no spread.
Standard deviation returns to the original unit
If observations are measured in centimetres, deviations are also in centimetres, but squaring produces square centimetres. Variance therefore has a squared unit. Taking its nonnegative square root produces standard deviation, which uses the same unit as the original observations and is easier to interpret alongside the mean.
Standard deviation is the nonnegative square root of variance. It is denoted by σ and has the same unit as the original observations. It is zero when the variance is zero.
Standard deviation is not the same as mean deviation: one is the square root of an average of squares, while the other is an average of absolute distances. Both describe scatter, but they weigh the distances differently. A standard deviation does not tell us that every observation is exactly that far from the mean.
Problem
A length dataset has variance 16 cm². What is its standard deviation?
- 1.The standard deviation is the nonnegative square root of the variance.
- 2.σ = √16 = 4 cm. Taking the square root also restores the length unit.
- 3.The negative number −4 is not chosen, even though its square is 16, because a measure of spread is nonnegative.
A complete calculation for raw data
A clear table makes the calculation traceable: find the mean, subtract it from every value, square each deviation and sum. When the values form a regular sequence, an assumed-mean calculation can simplify finding the mean. The variance still uses deviations from the actual mean, not deviations from a convenient assumed value.
Problem
Find the variance and standard deviation of 6, 8, 10, 12, 14, 16, 18, 20, 22, 24.
- 1.Use assumed mean A = 14 and common scale h = 2. The coded values are −4, −3, −2, −1, 0, 1, 2, 3, 4, 5, whose sum is 5.
- 2.The true mean is 14 + 2 × 5/10 = 15.
- 3.Deviations from 15 are −9, −7, −5, −3, −1, 1, 3, 5, 7, 9. Their squares total 330.
- 4.Variance is 330/10 = 33, and standard deviation is √33 ≈ 5.74.
- 5.The coding origin 14 helped find the mean; using it instead of 15 in the squared-deviation column would calculate a different average.
| Value xᵢ | dᵢ = (xᵢ − 14)/2 | xᵢ − 15 | (xᵢ − 15)² |
|---|---|---|---|
| 6 | -4 | -9 | 81 |
| 8 | -3 | -7 | 49 |
| 10 | -2 | -5 | 25 |
| 12 | -1 | -3 | 9 |
| 14 | 0 | -1 | 1 |
| 16 | 1 | 1 | 1 |
| 18 | 2 | 3 | 9 |
| 20 | 3 | 5 | 25 |
| 22 | 4 | 7 | 49 |
| 24 | 5 | 9 | 81 |
| Total | 5 | 0 | 330 |
Variance is the average of squared deviations, not the square of the average deviation. The latter is zero about the mean. Standard deviation takes one square root after summing and dividing, and deviations must be measured from the actual mean.
Discrete frequencies weight squared distances
A frequency table compresses repeated values, just as it did for mean deviation. A value with frequency fᵢ contributes its squared deviation fᵢ times. Multiply each square by its frequency before summing, then divide by total frequency N. Neither the number of rows nor the sum of distinct values is the correct observation count.
Problem
Find variance and standard deviation for values 4, 8, 11, 17, 20, 24, 32 with frequencies 3, 5, 9, 5, 4, 3, 1.
- 1.Total frequency is 30, and Σfᵢxᵢ = 420, so the mean is 14.
- 2.Deviations are −10, −6, −3, 3, 6, 10, 18. Square them and weight by frequency.
- 3.The contributions are 300, 180, 81, 45, 144, 300 and 324. Their sum is 1374.
- 4.Variance is 1374/30 = 45.8; standard deviation is √45.8 ≈ 6.77.
- 5.A rare extreme observation can still contribute substantially: value 32 occurs once but contributes 18² = 324 to the total.
| Value | Frequency | fᵢxᵢ | xᵢ − 14 | (xᵢ − 14)² | fᵢ(xᵢ − 14)² |
|---|---|---|---|---|---|
| 4 | 3 | 12 | -10 | 100 | 300 |
| 8 | 5 | 40 | -6 | 36 | 180 |
| 11 | 9 | 99 | -3 | 9 | 81 |
| 17 | 5 | 85 | 3 | 9 | 45 |
| 20 | 4 | 80 | 6 | 36 | 144 |
| 24 | 3 | 72 | 10 | 100 | 300 |
| 32 | 1 | 32 | 18 | 324 | 324 |
| Total | 30 | 420 | 1374 |
Problem
Values 1 and 4 have frequencies 2 and 1. Find variance and standard deviation.
- 1.The underlying observations are 1, 1, 4. Their mean is (2 × 1 + 1 × 4)/3 = 2.
- 2.The weighted squared-deviation total is 2(1 − 2)² + 1(4 − 2)² = 2 + 4 = 6.
- 3.Variance is 6/3 = 2, and standard deviation is √2.
- 4.Expanding the table gives the same three contributions 1, 1 and 4. Weighting preserves the raw-data definition.
Structured data can be handled algebraically
When the observations follow a known pattern, a general calculation can replace a long table. The first n natural numbers provide a useful example. Their mean comes from a known sum, and expanding the centred squares lets the sum of squares formula do the remaining work. This also shows why it is useful to understand the definition rather than only a numerical routine.
Problem
Find the mean and variance of 1, 2, …, n.
- 1.Their total is n(n + 1)/2, so their mean m = (n + 1)/2.
- 2.Expand the squared-deviation total: Σ(i − m)² = Σi² − 2mΣi + nm².
- 3.Use Σi = nm and Σi² = n(n + 1)(2n + 1)/6. The total becomes n(n + 1)(2n + 1)/6 − nm².
- 4.Divide by n: variance = (n + 1)(2n + 1)/6 − (n + 1)²/4.
- 5.With denominator 12 this is [(n + 1)(4n + 2) − 3(n + 1)²]/12 = (n + 1)(n − 1)/12 = (n² − 1)/12.
- 6.For n = 1 this gives zero, as it should for a single observation. Standard deviation is √((n² − 1)/12).
Check your understanding
Focus on why the divisor and square root appear. A correct numerical calculation should agree with the definition, use the right unit, and yield a nonnegative spread.
Quiz
Why divide a squared-deviation total by the number of observations?
A variance of 9 m² corresponds to which standard deviation?
When is variance zero?
What is the variance of 2, 4, 6?
Values 1 and 4 have frequencies 2 and 1. What is their variance?
What is the mean of the first n natural numbers?
Variance is 33. What is standard deviation?
Practice Problems
- Calculate the mean and variance of 6, 7, 10, 12, 13, 4, 8, 12. Compare variance with the mean deviation found earlier.
- Derive the variance (n² − 1)/12 for the first n natural numbers, including the expansion of centred squares.
- Find mean and variance for the first ten positive multiples of 3 by a direct centred-deviation calculation.
- Find mean and variance for values 6, 10, 14, 18, 24, 28, 30 with frequencies 2, 4, 7, 12, 8, 4, 3.
- Find mean and variance for values 92, 93, 97, 98, 102, 104, 109 with frequencies 3, 2, 3, 2, 6, 3, 3.
- Explain why a squared-deviation total can give a misleading comparison for datasets of different sizes.
- For measurements in seconds, state the units of mean deviation, variance and standard deviation, and explain each.
Key Takeaways
• Squaring deviations prevents cancellation but a total of squares still depends on the number of observations. • Variance averages squared deviations from the actual mean using n or total frequency N. • Variance is nonnegative and vanishes exactly when every observation is the same. • Standard deviation is the nonnegative square root of variance and returns to the original unit. • Frequency weighting collects repeated contributions without changing the definition. • Averages of absolute distances and square roots of average squared distances are different measures.