Two delivery services both take 30 minutes on average. One arrives within a minute or two of that time on almost every order, while the other is sometimes a quarter of an hour early and sometimes a quarter of an hour late. The averages agree, yet anyone planning around a delivery cares a great deal about the difference. This lesson builds a measure of spread from the distances to the mean, explains why a complete population and a sample use different divisors, and returns the result to the original units with the standard deviation.
Key terms
Deviation
Definition Let be numerical observations with mean . The deviation of the th observation is , the observation minus the mean, in the same units as the data. When the values form a complete population with mean , the deviations are . Deviations from the mean always sum to zero, because
In plain words A deviation says how far one observation sits from the center and on which side, positive above the mean and negative below it. The positive and negative deviations always balance, so their average is zero for every dataset, a tightly clustered one and a widely spread one alike. To measure spread, the signs have to be removed somehow.
Example Four constructed delivery times are , , and minutes, with mean minutes. Their deviations are , , and minutes, which add to . Four times that all equal minutes have the same mean, and every one of their deviations is . The means cannot tell the two sets apart, but the deviations can.
Population variance
Definition Let be all values of a complete finite population, with population mean . The population variance is the average squared deviation,
It is measured in the square of the data’s unit. It is never negative, and it equals exactly when all values are equal.
In plain words Square every deviation so that each one counts as a nonnegative amount, then average the squares over the whole population. Squaring gives large deviations much more weight than small ones. Dividing by is right when the values in hand are the entire group you want to describe, rather than a sample from something larger.
Example Suppose the times , , and minutes are every delivery a courier made on one day, and that day is all we want to describe. The squared deviations are , , and , with total , so
The unit is square minutes, which is not a length of time anyone waits. For four times that all equal minutes, the population variance is .
Sample variance
Definition Let be a sample of observations with sample mean . The sample variance is
in squared units. With a single observation the formula gives , and the sample variance is not defined. If the observations are independent draws from a population or process with finite variance , then
so is an unbiased estimator of . Dividing the same sum by instead gives an estimator with expected value , which falls short of on average whenever .
In plain words The sample mean comes from the same data, and no other center gives a smaller sum of squared deviations for those data. Measuring from it therefore never gives a larger sum than measuring from the unknown population mean would, and it typically gives a smaller one. Dividing by instead of makes up for this exactly on average. The correction concerns chance variation between random samples. It does not repair a sample collected in a biased way, and the guarantee assumes independent observations.
Example Treat the times , and minutes as independent observations of a courier’s delivery process. The mean is minutes, the deviations are , and , and the squared deviations total . The sample variance is square minutes, so the sample standard deviation is minutes. If the same three times were instead the complete population of interest, the population variance would be square minutes. The numerator is the same, and the divisor depends on what the number is meant to describe.
Standard deviation
Definition A standard deviation is the nonnegative square root of a variance. The population standard deviation is , and the sample standard deviation is
It has the same units as the data. Adding a constant to every observation leaves it unchanged, and multiplying every observation by a constant multiplies it by and the variance by . Although is unbiased for under independent sampling, is not an unbiased estimator of in general. Because the square root is a concave function, .
In plain words The standard deviation puts spread back into the units of the data and can be read as a typical size of a deviation, in a root-mean-square sense. It is not the average absolute distance from the mean, which is never larger and usually smaller. On its own it also does not say what share of the data lies within one standard deviation of the mean. The familiar figure of about 68 percent belongs to normal distributions, and for other data the share can be quite different.
Example Treated as a complete population, the four times , , and minutes have minutes. Treated as a sample, they give square minutes and minutes. The average absolute distance from the mean is minutes, smaller than both. The interval minutes contains the times and but not or , so exactly half of these data lie within one standard deviation of the mean.
Degrees of freedom
Definition Degrees of freedom count the values that remain free to vary after the constraints created by estimated quantities. The deviations satisfy one linear constraint, since they sum to zero, so any of them determine the last one. The sum of squared deviations about therefore has degrees of freedom, and the sample variance divides by that number. The count depends on the constraints. A straight line fitted with an intercept and a slope, for example, leaves degrees of freedom for its residuals. Behind the divisor is an identity that holds for every number ,
For independent draws with mean and variance , take . The left side has expected value , and the last term has expected value because has variance . So the sum of squared deviations about has expected value .
In plain words Once the sample mean is fixed, only of the deviations can be chosen freely. The identity shows that centering at gives the smallest possible sum of squares, since the extra term is never negative. Measured from the true mean instead, the sum would on average be larger by exactly , one observation’s worth of variance, and dividing by accounts for that loss. The true mean is not needed to compute . It only appears in the argument for why is the right divisor.
Example For the times , , and minutes with mean , the deviations , and force the fourth to be , because the four must add to . To check the identity with , the distances from are , , and , and their squares add to . The right side gives the same total, .
Check yourself
- The waiting times of five customers are , , , and minutes. Find the population variance and standard deviation, then the sample variance and standard deviation. When is each pair the right summary?
Show the answer
The mean is minutes, the deviations are , , , and , and the squared deviations total . Dividing by gives square minutes and minutes. Dividing by gives square minutes and minutes. Use the first pair when these five customers are the whole group you want to describe, for example everyone served during one short event. Use the second when the five are a random sample used to estimate the variability of the shop’s waiting times in general.
- Start again from the times , , and minutes, treated as a complete population. Find the population variance and standard deviation after adding minutes to every time, and separately after doubling every time. Someone claims that doubling the data doubles the variance. Is that right?
Show the answer
After adding minutes the times are , , and with mean . The deviations are still , , and , so the variance stays square minutes and the standard deviation stays minutes. After doubling, the times are , , and with mean , and the deviations double to , , and . Their squares total , so the variance is square minutes and the standard deviation is minutes. The claim is wrong. Doubling multiplies every squared deviation by , so the variance is multiplied by , while the standard deviation doubles.
- A process produces the value or , each with probability , independently each time, so its mean is and its variance is . Take samples of size . Find the expected value of , of the version that divides by , and of .
Show the answer
The four samples , , and are equally likely. Two of them have no spread, and for the other two the mean is and the squared deviations total . So takes the values , , and , and its expected value is , equal to . The version that divides by takes the values , , and , with expected value , which is and too small. The standard deviation takes the values , , and , with expected value , less than . The divisor makes the variance estimate unbiased, but its square root still underestimates on average.