Why Do We Square the Differences When Calculating Variance?

Bar chart for the data 2, 6 and 10: the deviations −4, 0 and 4 cancel to zero, while the squared deviations 16, 0 and 16 add up to 32.

Ask why variance squares its deviations and many people assume it is just a rule to memorise. It is not. Squaring solves a specific problem that would otherwise make the calculation useless.

The Problem: Deviations Cancel Out

The mean is the balance point of the data, so the deviations from it always add up to exactly zero, however spread out the data is.

Worked Example

Take the data 2, 6, 10.

  • The mean is 18 / 3 = 6.
  • Deviations: −4, 0, 4. Their total is 0.

Averaging the raw deviations gives 0 for this data, and for every other data set too. It cannot tell a tightly clustered data set from a widely scattered one.

The Fix: Square Them

Squaring a non-zero number always gives a positive result (and 0 stays 0), so a value 4 below the mean and a value 4 above it both add 16 instead of cancelling.

  • Squared deviations: 16, 0, 16. The sum of squares is 32.
  • Population variance: 32 / 3 ≈ 10.667. Sample variance: 32 / 2 = 16.

Larger Deviations Count More

Squaring does not treat all deviations equally. A deviation twice as large contributes four times as much; three times as large, nine times as much. Variance is therefore especially sensitive to values far from the mean.

What About Absolute Values?

Taking absolute values also removes the minus signs. For the same data the absolute deviations are 4, 0, 4. They add up to 8, and dividing by 3 gives about 2.667. This is the mean absolute deviation, a perfectly valid measure of spread. It is less affected by outliers than variance.

ApproachResult for 2, 6, 10
Average raw deviation0 (always)
Average squared deviation (population variance)≈ 10.667
Average absolute deviation≈ 2.667

Squares are used more widely because they behave well mathematically: variances of independent quantities add, squares can be differentiated (which least-squares regression relies on), and the normal distribution is described naturally by its variance.

Squaring and the Standard Deviation

Squaring changes the units: dollars become dollars squared. Taking the square root of the variance reverses that, giving the standard deviation in the original units. For the example above the population standard deviation is √10.667 ≈ 3.266.

The Cost: Sensitivity to Outliers

Because large deviations are amplified, one extreme value can dominate the variance. That is a feature when large errors really are worse than small ones, and a limitation when the outlier is just a recording mistake. Check unusual values before trusting the result.

Summary

Raw deviations always cancel to zero; squaring stops that, so every value adds to the total. The side effects (more weight on large deviations and squared units) explain why variance is sensitive to outliers and why we usually report its square root, the standard deviation.

Back to Blog