Leave lesson

Statistics · Data presentation

1 / 10

Measures of spread, standard deviation and coding

Range, interquartile and interpercentile range, and — the big one — variance and standard deviation from sums Σx and Σx² (and Σfx, Σfx²). Plus coding: how a linear change of variable rescales the mean and standard deviation, and how to decode back to the original data.

Statistics · Data presentation

Measures of spread, standard deviation and coding

Range, interquartile and interpercentile range, and — the big one — variance and standard deviation from sums Σx and Σx² (and Σfx, Σfx²). Plus coding: how a linear change of variable rescales the mean and standard deviation, and how to decode back to the original data.

Why it works

A measure of location tells you where the data sits; a measure of spread tells you how scattered it is. Two data sets can share a mean yet be wildly different — spread is what separates them.

The simple ranges.
  • Range == largest - smallest. Quick, but ruined by a single outlier.
  • Interquartile range IQR=Q3Q1\text{IQR} = Q_3 - Q_1 — the spread of the middle
50%50\%, so it ignores the extreme quarters and resists outliers.
  • Interpercentile range — e.g. the 10%10\% to 90%90\% range, P90P10P_{90} - P_{10}.
Variance and standard deviation use every value. The variance is the mean squared distance from the mean. The version you actually compute is "the mean of the squares minus the square of the mean": σ2=x2n(xn)2=x2nxˉ2,\sigma^2 = \frac{\sum x^2}{n} - \left(\frac{\sum x}{n}\right)^2 = \frac{\sum x^2}{n} - \bar{x}^2, and from a frequency table σ2=fx2f(fxf)2.\sigma^2 = \frac{\sum f x^2}{\sum f} - \left(\frac{\sum f x}{\sum f}\right)^2. The standard deviation σ=σ2\sigma = \sqrt{\sigma^2} is the one quoted, because it's back in the original units (the variance is in units²). You'll also meet Sxx=x2(x)2nS_{xx} = \sum x^2 - \dfrac{(\sum x)^2}{n}, with σ2=Sxxn\sigma^2 = \dfrac{S_{xx}}{n} — the same thing rearranged.

Two habits save marks: don't forget to subtract xˉ2\bar{x}^2 (the mean of the squares is not the variance), and remember the square root when the question asks for standard deviation, not variance.

Coding — rescaling the data. When numbers are awkward (e.g. pressures near 10201020), replace xx by a simpler coded variable y=xab.y = \frac{x - a}{b}. Work out the mean and standard deviation of the easy yy values, then decode:
  • Mean: yˉ=xˉab\bar{y} = \dfrac{\bar{x} - a}{b}, so rearranged xˉ=byˉ+a\boxed{\bar{x} = b\,\bar{y} + a}.
  • Standard deviation: σx=bσy\boxed{\sigma_x = b\,\sigma_y}.
The key insight is in that second box. Subtracting aa shifts every value by the same amount, so it doesn't change the spread at all — the standard deviation is untouched by the "a-a". Only the scaling by bb stretches the spread, so σx=bσy\sigma_x = b\,\sigma_y (the aa has vanished). For the simplest coding y=xay = x - a (that is b=1b = 1), decoding is just xˉ=yˉ+a\bar{x} = \bar{y} + a and σx=σy\sigma_x = \sigma_y — the standard deviation of the coded data equals that of the original.