Answer

Why does standard deviation square the differences?

Inspired by a question on Cross Validated ·

descriptive statisticsstandard deviation

The short answer

Squaring is a convention with real payoffs: variances of independent quantities add, the mean is the value that minimizes squared error, and the result connects directly to the normal distribution and to least squares. Average absolute deviation is a legitimate alternative, but it lacks these tidy properties.

Two ways to measure spread

Both measures start the same way: subtract the mean from each observation to get a deviation. Deviations above and below the mean cancel out, so you need a step that makes them all positive before averaging.

Both are reasonable descriptions of spread. Neither is wrong. The standard deviation became the default because of what it lets you do afterwards, not because absolute values fail as a description.

Variances add up

If two quantities are independent (or just uncorrelated), the variance of their sum is the sum of their variances. Standard deviations then combine like the sides of a right triangle: independent sources of noise with standard deviations of 3 and 4 give a total of 5, not 7.

Mean absolute deviation has no such rule. Its value for a sum depends on the shape of both distributions, so you cannot build it up from the pieces. This additivity is why the variance sits inside so much of statistics, including the standard error of a mean, error propagation and analysis of variance.

The mean and least squares

The mean is the single number that makes the sum of squared deviations as small as possible. If you instead minimize the sum of absolute deviations, the answer is the median. So the variance is the natural spread measure to pair with the mean, and mean absolute deviation is the natural partner of the median.

The same link runs through regression. Ordinary least squares minimizes squared errors, which produces closed-form solutions and a clean geometric picture: the standard deviation is a root-mean-square distance, and distances in several dimensions are computed with sums of squares (Pythagoras). Absolute errors have no formula of that kind, and the function has a kink at zero where the derivative does not exist.

The normal distribution

The normal density contains the squared distance from the mean, so its two parameters are exactly the mean and the standard deviation. For normal data the sample mean and sample variance capture everything the sample says about those parameters, and the standard deviation estimates the spread more precisely than mean absolute deviation does from the same data.

For a normal distribution the two measures are also tied by a fixed ratio, because mean absolute deviation equals about 0.8 times the standard deviation (the exact factor is the square root of 2 divided by pi). That is why the absolute version looks smaller, as you may have noticed.

When absolute deviations are better

Squaring gives big deviations a disproportionate weight, so one wild value can dominate the standard deviation. If outliers or heavy tails are a concern, absolute deviations are more forgiving, and the median absolute deviation is more robust still (R's mad() uses it and rescales it so it matches the standard deviation for normal data).

Absolute-value methods are also everywhere in modern work, such as median regression and lasso penalties. The choice depends on what you need: mathematical convenience and normal-theory tools favor squares, robustness favors absolute values.

See it in R

This example checks the three claims above by simulation. Figures in the text below come from one seeded run, so they will vary slightly with other seeds.

set.seed(2024)

# Standard deviation (squares) and mean absolute deviation (absolute values)
sd_pop  <- function(x) sqrt(mean((x - mean(x))^2))
mad_pop <- function(x) mean(abs(x - mean(x)))

# 1. For normal data the two are tied by a fixed ratio: sqrt(2/pi) = 0.798
x <- rnorm(100000)
round(c(sd = sd_pop(x), mean_abs_dev = mad_pop(x),
        ratio = mad_pop(x) / sd_pop(x), theory = sqrt(2 / pi)), 3)

# 2. Variances of independent variables add, absolute deviations do not
a <- rnorm(100000, sd = 3)
b <- rnorm(100000, sd = 4)
s <- a + b
round(c(var_a_plus_var_b = var(a) + var(b), var_sum = var(s)), 1)
round(c(mad_a_plus_mad_b = mad_pop(a) + mad_pop(b), mad_sum = mad_pop(s)), 2)

# 3. Sensitivity to one outlier
y <- c(rnorm(99), 20)
round(c(sd_clean = sd_pop(y[1:99]), sd_outlier = sd_pop(y),
        mad_clean = mad_pop(y[1:99]), mad_outlier = mad_pop(y)), 2)

In that run, the standard deviation of a standard normal sample came out at 1.001 and the mean absolute deviation at 0.798, a ratio of 0.797, matching the theoretical 0.798. The variances of the two independent variables summed to 25.0 and the variance of their sum was 24.9. The absolute deviations behaved differently: they summed to 5.58, but the mean absolute deviation of the sum was only 3.98.

Adding a single outlier of 20 to 99 ordinary values raised the standard deviation from 1.10 to 2.28, roughly doubling it, while the mean absolute deviation rose from 0.87 to 1.08. Both react, but the squared version reacts far more.

Related tools and guides

More answered questions

Working with your own data?

General answers only go so far. Send us your situation and we'll reply by email within two business days.

Ask your question

Written by AskStats with AI assistance. This is general information, not advice for your specific data or study. When the results matter, check your approach with a qualified statistician.