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.
Give each of the 8 values a row so none hide behind another. The mean, 5, is the blue line.
μ = 40/8 = 5
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
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
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
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
cd svg-generator python3 -m svgmath render standard-deviation --out /tmp/standard-deviation
Source: svgmath/diagrams/statistics.py