Skip to content

Mathematics · Ch 13 — Statistics

Variance and Standard Deviation for Grouped Data

6

Variance and Standard Deviation for Grouped Data

The variance and standard deviation formulas extend to grouped data exactly as the mean deviation formulas did in the previous section — every squared deviation is weighted by the frequency with which it occurs.

Discrete frequency distribution. For distinct values x1,…,xkx_1,\ldots,x_k with frequencies f1,…,fkf_1,\ldots,f_k and N=∑fiN=\sum f_i,

xˉ=1N∑i=1kfixi,σ2=1N∑i=1kfi(xi−xˉ)2,σ=σ2.\bar x = \dfrac1N\sum_{i=1}^k f_i x_i, \qquad \sigma^2 = \dfrac1N\sum_{i=1}^{k}f_i(x_i-\bar x)^2, \qquad \sigma=\sqrt{\sigma^2}.

Continuous frequency distribution. Exactly as for grouped mean deviation, each class is represented by its midpoint xix_i, and the same discrete-style formulas are applied using these midpoints:

xˉ=1N∑fixi,σ2=1N∑fi(xi−xˉ)2.\bar x = \dfrac1N\sum f_i x_i, \qquad \sigma^2 = \dfrac1N\sum f_i(x_i-\bar x)^2.

The computational shortcut, extended to grouped data. The identity derived in the previous section extends directly (the derivation is identical, with every xix_i replaced by frequency-weighted sums):

σ2=1N∑i=1kfixi2−xˉ2\boxed{\sigma^2 = \dfrac1N\sum_{i=1}^{k} f_i x_i^2 - \bar x^2}

— again, "the (frequency-weighted) mean of the squares minus the square of the (frequency-weighted) mean." This is frequently the fastest route to the variance of grouped data, since it needs only two running column totals, ∑fixi\sum f_i x_i and ∑fixi2\sum f_i x_i^2, computed once each.

Steps to compute (either discrete or continuous, direct method).

  1. Find N=∑fiN=\sum f_i and the mean xˉ=1N∑fixi\bar x = \dfrac1N\sum f_i x_i (using class midpoints for continuous data).
  2. Find xi−xˉx_i-\bar x (or, for the shortcut identity, simply xi2x_i^2) for every distinct value/midpoint.
  3. Form the column fi(xi−xˉ)2f_i(x_i-\bar x)^2 (or fixi2f_i x_i^2 for the shortcut).
  4. Sum this column, divide by NN — and, for the shortcut identity, subtract xˉ2\bar x^2 at the very end.
  5. Take the square root of the result to get the standard deviation. …