Standard deviation in this visualization
The standard deviation says how far the values of a data set typically lie from their mean . Each value’s deviation is squared, the squares are averaged, and the square root of that average is . Here each squared deviation is a square hanging under the number line, and the average of their areas is the hollow square above it: its side is σ, a length in the same units as the data. You can move single values, or shift and stretch the whole data set and watch which squares change.
Why the deviations are squared
The deviations themselves always add up to zero, because the mean is the point where they balance, so their plain average says nothing about spread. Squaring makes every deviation count, on either side, and it makes far values count much more: a value twice as far from the mean adds four times as much area. One far value can therefore raise the standard deviation a lot. It is also why σ is never smaller than the mean distance, the average of ; the two are equal only when every value lies the same distance from the mean.
The final square root turns an average area back into a length. The average square itself, σ², is the variance, measured in squared units.
Moving and stretching the data
Adding the same number to every value moves the mean by that number and leaves every deviation, every square and σ as they were. Multiplying every distance from the mean by multiplies each square by and σ by . In general the values have standard deviation . Shifting the mean to 0 and stretching σ to 1 rewrites each value in standard units, .
Dividing by n or by n − 1
Dividing by gives the standard deviation of the values themselves, written σ when they are a whole population. Often the values are a random sample, and what is wanted is the spread of the population they came from. Measured from the sample’s own mean, which lies closer to the sample than the population mean does, the squared deviations are too small on average. Dividing by removes that bias from the variance: is an unbiased estimate of the population variance, and its square root is the sample standard deviation. Then the hollow square is the sum of the squares divided by , a little more than their average. The difference is large only for small samples: with two values, is times σ.
Things to notice
- The standard deviation is 0 exactly when all the values are equal.
- About 68% of values within one standard deviation of the mean is a property of data shaped roughly like a normal distribution. Other data can have many more or many fewer; the readout counts the values that are actually there.
Controls
- Drag the triangle under the mean to move every value, or the corner of the average square to stretch every value about the mean.
- With the keyboard, Tab to a value and use the left and right arrow keys; hold Alt for steps of 0.01.