Standard deviation of a random variable

By Jude Wallis · Updated

The standard deviation of a random variable, sigma-X, is the typical distance of its values from the mean mu-X over the long run.

The standard deviation of a random variable is the square root of its variance, and the variance is a probability-weighted average of squared distances from the mean: σX=(xiμX)2P(xi)\sigma_X = \sqrt{\sum (x_i - \mu_X)^2 P(x_i)} (sigma-X, with μX\mu_X the mean of XX). Each squared deviation is multiplied by the probability of that value, so an outcome that almost never happens contributes almost nothing however far out it sits. The answer is in the same units as XX, while the variance is in squared units.

Take the number of defective items in a box: 0 with probability 0.5, 1 with probability 0.3, and 2 with probability 0.2, giving mean μX=0.7\mu_X = 0.7. The weighted squared deviations are (00.7)2(0.5)=0.245(0 - 0.7)^2(0.5) = 0.245, (10.7)2(0.3)=0.027(1 - 0.7)^2(0.3) = 0.027 and (20.7)2(0.2)=0.338(2 - 0.7)^2(0.2) = 0.338. They sum to the variance 0.610, and σX=0.6100.781\sigma_X = \sqrt{0.610} \approx 0.781 defects.

"Just take the standard deviation of 0, 1 and 2" is the wrong move, and it is a common one. Treating the three values as a list of data makes them equally likely, which they are not: as a population that returns 0.816, and with the n1n - 1 divisor it returns 1.000. Neither one is σX\sigma_X. Notice also that no nn appears anywhere in the formula. There is nothing to divide by and no sample-size correction to make, because nothing was sampled. The probabilities have already done the weighting.

The value of σX\sigma_X is never negative, and it equals 0 in exactly one situation: when XX takes a single value with probability 1, so there is nothing to vary. It is a parameter of a distribution, not an estimate from data. When the random variable in question is itself a statistic, this same quantity is the standard deviation of its sampling distribution, and putting sample estimates in place of the parameters inside it is what turns it into a standard error.

This is topic 2.9 of Unit 2, Parameters of Random Variables.

More random variables and distributions terms, or browse the full statistics glossary.