Standard Deviation

Category: Statistics   Level: 301

σ = √(∑ (x - μ)2 / n)

Standard deviation is the typical distance from the mean. Find each distance, square it, average the squares, and take the square root to get back to the original units.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Put each value on its own row

Give each of the 8 values a row so none hide behind another. The mean, 5, is the blue line.

μ = 40/8 = 5

Step 1: Put each value on its own row

Step 2: Measure each deviation

Draw a bar from the mean to each value. Bars to the left are negative and bars to the right are positive. They always add to zero, so their plain average is useless.

x - μ: −3, −1, −1, −1, 0, 0, 2, 4; sum = 0

Step 2: Measure each deviation

Step 3: Square the deviations

Squaring makes every distance positive and gives far values extra weight. Each orange square has side |x − μ| and area (x − μ)².

9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32

Step 3: Square the deviations

Step 4: Average the squares

Pool the total area, 32, and share it among 8 values. The average square has area 4. This is the variance.

σ2 = 32/8 = 4

Step 4: Average the squares

Step 5: Take the square root

The side of the average square is 2, back in the units of the data. Most values sit within one standard deviation of the mean, between 3 and 7.

σ = √(4) = 2

Step 5: Take the square root

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render standard-deviation --out /tmp/standard-deviation

Source: svgmath/diagrams/statistics.py