girgit.org

Statistics

Why square? Variance and standard deviation

The big ideaSquare each deviation from the mean so no sign can cancel, average the squares to get the variance \( \sigma^2 \), and take the square root to get the standard deviation \( \sigma \), back in the data's own units.

In simple words

Another way to stop left and right steps from cancelling is to multiply each step by itself. A number times itself is never below zero. Far-away numbers get counted much more strongly than near ones. We average these, and then undo the "times itself" at the end, so the answer is in the same kind of units we started with.

Squaring instead of dropping signs

For observations \( x_1, \ldots, x_n \) with mean \( \bar{x} \), every squared deviation \( (x_i - \bar{x})^2 \) is zero or positive. Their sum

\[ \sum_{i=1}^{n} (x_i - \bar{x})^2 \]

is zero only if every \( x_i = \bar{x} \), that is, no scatter at all. A small sum means the values hug the mean; a large sum means they are spread out. So is this sum itself a good measure of dispersion?

Guess first: which set is more spread out?

Set P has just three values: 10, 30, 50. Set Q has the 23 whole numbers 19, 20, 21, …, 41. Both have mean 30. Guess: which has the bigger sum of squared deviations, and which is more spread out?

See what happens
P: \( (-20)^2 + 0^2 + 20^2 = 800 \). Q: \( 2(1^2 + 2^2 + \cdots + 11^2) = 2 \times \frac{11 \times 12 \times 23}{6} = 1012 \). Q's sum is bigger, yet P is plainly more spread out: its values sit 20 away from the mean, while Q's are never more than 11 away. The sum grows just because Q has more values. Divide by the number of observations and the truth appears: P gives \( \frac{800}{3} \approx 266.7 \), Q gives \( \frac{1012}{23} = 44 \).

Try it: see each squared deviation as an actual square, and build set Q one value at a time.

So the fair measure is the mean of the squared deviations. This is the variance, written \( \sigma^2 \) (read "sigma squared"):

\[ \sigma^2 = \frac{1}{n}\sum_{i=1}^{n} (x_i - \bar{x})^2 \]

Standard deviation

Variance has a problem with units. If the data are in runs, the squares are in "runs squared", which means nothing to a cricket fan. So we take the positive square root, which brings us back to the original unit. This is the standard deviation, written \( \sigma \) (sigma):

\[ \sigma = \sqrt{\frac{1}{n}\sum_{i=1}^{n} (x_i - \bar{x})^2} \]

The standard deviation is the most widely used measure of dispersion about the mean.

Worked example 1

Find the variance and standard deviation of 2, 4, 6, 8, 10, 12, 14.

\( x_i \)\( x_i - \bar{x} \)\( (x_i - \bar{x})^2 \)
2−636
4−416
6−24
800
1024
12416
14636
Total 560112
  1. \( \bar{x} = \frac{56}{7} = 8 \).
  2. \( \sigma^2 = \frac{112}{7} = 16 \).
  3. \( \sigma = \sqrt{16} = 4 \).

Worked example 2: the two batters

Dev's runs were 45, 50, 39, 47, 53, 42, 48, 44, mean 46. Deviations: −1, 4, −7, 1, 7, −4, 2, −2. Squares: 1, 16, 49, 1, 49, 16, 4, 4, total 140.

\( \sigma^2 = \frac{140}{8} = 17.5 \) and \( \sigma = \sqrt{17.5} \approx 4.18 \) runs.

Doing the same for Kabir (30, 0, 95, 8, 62, 2, 96, 75) gives squares adding to 11750, so \( \sigma^2 = 1468.75 \) and \( \sigma \approx 38.32 \) runs. Same mean, but Kabir's standard deviation is about nine times Dev's.

Don't mix these up

  • Variance is \( \sigma^2 \); standard deviation is \( \sigma \). If a question gives one, square or square-root to get the other.
  • Variance is in squared units (cm²); standard deviation is in the data's units (cm).
  • Standard deviation is always taken about the mean, never the median.

Try it. Find the variance and standard deviation of the train data 3, 7, 0, 12, 5, 9, 4, 8 (mean 6).

Answer
Deviations −3, 1, −6, 6, −1, 3, −2, 2; squares 9, 1, 36, 36, 1, 9, 4, 4, total 100. \( \sigma^2 = \frac{100}{8} = 12.5 \), \( \sigma = \sqrt{12.5} \approx 3.54 \) minutes. Compare with the mean deviation of 3 minutes: the standard deviation is a little larger, as it usually is, because squaring gives extra weight to the 0 and the 12.

Words to know

Squared deviation
\( (x_i - \bar{x})^2 \), never negative.
Variance \( \sigma^2 \)
The mean of the squared deviations from the mean.
Standard deviation \( \sigma \)
The positive square root of the variance, in the data's units.
Sigma \( \sigma \)
The Greek letter used for standard deviation.

What is the variance of 1, 2, 3, 4, 5?

  1. 10
  2. 2
  3. 1.41
  4. 1.2

The heights of a group of plants have variance 36 cm². What is their standard deviation?

  1. 6 cm
  2. 6 cm²
  3. 18 cm

Every observation in a set is 7. What is its standard deviation?

  1. 7
  2. 0
  3. 1