girgit.org

Statistics

Standard deviation of frequency distributions

The big ideaFor a frequency table, weight each squared deviation by its frequency and divide by \( N \); and since \( \sigma^2 \) also equals "the mean of the squares minus the square of the mean", you can skip the deviations altogether.

In simple words

When a number shows up many times, its "times itself" distance also counts many times. For groups, we again let the middle of each group stand for everyone in it. There is also a clever second way: square the numbers themselves, find their average, and take away the average squared. You get the same answer with fewer awkward decimals.

Discrete frequency distribution

If the values \( x_1, \ldots, x_n \) occur with frequencies \( f_1, \ldots, f_n \) and \( N = \sum f_i \), then

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

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

Worked example 1: a discrete table

Find the variance and standard deviation.

\( x_i \)\( f_i \)\( f_i x_i \)\( x_i - \bar{x} \)\( (x_i - \bar{x})^2 \)\( f_i (x_i - \bar{x})^2 \)
236−41648
4520−2420
6954000
85402420
1033041648
Total25150136

\( \bar{x} = \frac{150}{25} = 6 \), \( \sigma^2 = \frac{136}{25} = 5.44 \), \( \sigma = \sqrt{5.44} \approx 2.33 \).

Continuous frequency distribution

Replace each class by its mid-point \( x_i \), and the class table becomes a discrete one. The same formula then applies.

Worked example 2: travel time again

The travel-time data from the mean deviation pages: mean 27 minutes.

Minutes\( f_i \)\( x_i \)\( (x_i - \bar{x})^2 \)\( f_i (x_i - \bar{x})^2 \)
0–10454841936
10–2011151441584
20–301525460
30–40133564832
40–505453241620
50–602557841568
Total507600

\( \sigma^2 = \frac{7600}{50} = 152 \) and \( \sigma = \sqrt{152} \approx 12.33 \) minutes. (The mean deviation was 10 minutes.)

Another formula: no deviations needed

When \( \bar{x} \) is a messy decimal like 36.2, every \( (x_i - \bar{x})^2 \) is messy too. Expand the square to avoid them:

\[ \begin{aligned} \sigma^2 &= \frac{1}{N}\sum f_i (x_i^2 - 2\bar{x}x_i + \bar{x}^2) \\ &= \frac{1}{N}\sum f_i x_i^2 - 2\bar{x}\cdot\frac{1}{N}\sum f_i x_i + \bar{x}^2 \cdot \frac{1}{N}\sum f_i \\ &= \frac{1}{N}\sum f_i x_i^2 - 2\bar{x}^2 + \bar{x}^2 = \frac{1}{N}\sum f_i x_i^2 - \bar{x}^2 \end{aligned} \]

using \( \frac{1}{N}\sum f_i x_i = \bar{x} \) and \( \sum f_i = N \). In words: variance = mean of the squares − square of the mean. Writing \( \bar{x} = \frac{1}{N}\sum f_i x_i \) and taking out \( \frac{1}{N^2} \):

\[ \sigma^2 = \frac{1}{N^2}\left[ N\sum f_i x_i^2 - \left(\sum f_i x_i\right)^2 \right] \]

\[ \sigma = \frac{1}{N}\sqrt{N\sum f_i x_i^2 - \left(\sum f_i x_i\right)^2} \]

For ungrouped data, put every \( f_i = 1 \) and \( N = n \): \( \sigma^2 = \frac{1}{n}\sum x_i^2 - \bar{x}^2 \).

Try it: lift every value onto the curve \( y = x^2 \) and the formula becomes a picture. Use the table from Worked example 1.

Worked example 3: using the new formula

Classes 10–20, 20–30, 30–40, 40–50, 50–60 with frequencies 4, 10, 18, 12, 6. Find the standard deviation.

Class\( f_i \)\( x_i \)\( f_i x_i \)\( x_i^2 \)\( f_i x_i^2 \)
10–2041560225900
20–3010252506256250
30–401835630122522050
40–501245540202524300
50–60655330302518150
Total50181071650
  1. \( N\sum f_i x_i^2 = 50 \times 71650 = 3582500 \) and \( \left(\sum f_i x_i\right)^2 = 1810^2 = 3276100 \).
  2. Difference: 306400, so \( \sigma = \frac{1}{50}\sqrt{306400} \approx \frac{553.5}{50} \approx 11.07 \).
  3. Check: \( \bar{x} = 36.2 \), and \( \sigma^2 = \frac{71650}{50} - 36.2^2 = 1433 - 1310.44 = 122.56 \), whose square root is 11.07.

Don't mix these up

  • \( \frac{1}{N}\sum f_i x_i^2 \) (mean of the squares) is not \( \bar{x}^2 \) (square of the mean). Variance is their difference, and it is never negative.
  • \( \sum f_i x_i^2 \) means \( f_i \times x_i^2 \), not \( (f_i x_i)^2 \).

Try it. For the shoe sizes (\( x_i \): 5, 6, 7, 8, 9, 10; \( f_i \): 3, 7, 10, 11, 5, 4), \( \sum f_i x_i = 300 \). Find \( \sum f_i x_i^2 \), the variance and the standard deviation.

Answer
\( f_i x_i^2 \): 75, 252, 490, 704, 405, 400, total 2326. \( \sigma^2 = \frac{2326}{40} - 7.5^2 = 58.15 - 56.25 = 1.9 \), \( \sigma = \sqrt{1.9} \approx 1.38 \).

Words to know

\( \sum f_i (x_i - \bar{x})^2 \)
The frequency-weighted sum of squared deviations.
\( \sum f_i x_i^2 \)
Each value squared, times its frequency, all added.
Mean of the squares
\( \frac{1}{N}\sum f_i x_i^2 \).
Square of the mean
\( \bar{x}^2 \); variance is the mean of the squares minus this.

For a distribution, \( N = 25 \), \( \sum f_i x_i = 100 \) and \( \sum f_i x_i^2 = 500 \). What is \( \sigma \)?

  1. 4
  2. 2
  3. \( \sqrt{20} \approx 4.47 \)

A student finds \( \frac{1}{N}\sum f_i x_i^2 = 40 \) and \( \bar{x} = 7 \). What should they conclude?

  1. The variance is −9
  2. They have made a mistake, since the mean of the squares can't be less than \( \bar{x}^2 \)
  3. The variance is 33