15.3 Measures of Dispersion

SL 4.3

In this section you will learn
  • why we need a measure of spread as well as an average
  • the range, the quartiles of discrete data and the interquartile range (IQR)
  • the variance and standard deviation: what they mean, the formula, and how to find them with a GDC
  • the effect of constant changes on the mean, variance and standard deviation (the method of coding)

Why measure spread?

Two data sets can have the same mean but be very different. Here are the test marks of two classes of 10 students.

Class Marks Mean Standard deviation
1 58, 60, 61, 62, 63, 63, 64, 65, 66, 68 63 2.79
2 35, 41, 50, 58, 63, 68, 72, 75, 82, 86 63 16.1

The marks in Class 2 are much more spread out. A measure of spread (a measure of dispersion) tells us how far the values are from each other, or from the centre.

As another example, two buses are each late by an average of 5 minutes over three days. Bus A is late by \(4, 5, 6\) minutes; Bus B is late by \(0, 11, 4\) minutes. Bus A is reliable; Bus B is not. Only a measure of spread shows this difference.

Range

Range Not in the formula booklet

\[ \text{range} = \text{largest value} - \text{smallest value} \]

The range is easy to find, but it uses only the two extreme values. One unusual value can make it very large, and it says nothing about the values in between.

Quartiles and the interquartile range

The median splits the ordered data into two halves. The quartiles split it into quarters.

Quartiles of discrete data Partly in the formula booklet

  1. Write the data in order and find the median \(Q_2\).
  2. The lower quartile \(Q_1\) is the median of the lower half of the data.
  3. The upper quartile \(Q_3\) is the median of the upper half of the data.

If \(n\) is odd, the median itself is not included in either half.

\[ \text{IQR} = Q_3 - Q_1 \]

In the booklet

  • \(Q_2\): the median
  • \(Q_1\): the lower quartile
  • \(Q_3\): the upper quartile
  • \(n\): the number of data values
  • \(\text{IQR}\): the interquartile range

The method for finding the quartiles is not in the booklet.

The middle 50% of the data lies between \(Q_1\) and \(Q_3\). The IQR measures the spread of this middle half, so it is not affected by a few extreme values.

Example 1 Find the median, the quartiles and the IQR of each data set.

(a) \(2, 5, 6, 9, 12, 15, 17, 20\)

(b) \(3, 7, 8, 10, 12, 13, 15, 18, 19, 22, 25\)

(a) \(n = 8\). The median is between the 4th and 5th values: \(Q_2 = \dfrac{9 + 12}{2} = 10.5\).

Lower half: \(2, 5, 6, 9\), so \(Q_1 = \dfrac{5 + 6}{2} = 5.5\). Upper half: \(12, 15, 17, 20\), so \(Q_3 = \dfrac{15 + 17}{2} = 16\).

\(\text{IQR} = 16 - 5.5 = 10.5\).

(b) \(n = 11\). The median is the 6th value: \(Q_2 = 13\).

Lower half (without the median): \(3, 7, \mathbf{8}, 10, 12\), so \(Q_1 = 8\). Upper half: \(15, 18, \mathbf{19}, 22, 25\), so \(Q_3 = 19\).

\(\text{IQR} = 19 - 8 = 11\).

There are several methods for quartiles. Some books, software and calculators include the median in each half when \(n\) is odd, or use a formula such as the \(\frac{n + 1}{4}\)th value. These methods can give slightly different answers. The method above is the one the TI-Nspire CX II uses, so your hand answers and GDC answers will agree.

Variance and standard deviation

The range and IQR do not use all the values. A better measure looks at how far every value is from the mean.

The deviation of a value \(x_i\) from the mean \(\mu\) is \(x_i - \mu\). Values above the mean have positive deviations; values below have negative deviations.

The deviations always add up to zero, so their mean is no use. Instead we square them (so that they are all positive) and take the mean of the squares.

Variance \(\sigma^2\) and standard deviation \(\sigma\) In the HL formula booklet

Value \(x_i\) occurs \(f_i\) times, \(n = \sum_{i=1}^{k} f_i\), mean \(\mu\):

\[ \sigma^2 = \frac{\sum_{i=1}^{k} f_i (x_i - \mu)^2}{n} = \frac{\sum_{i=1}^{k} f_i x_i^2}{n} - \mu^2 \qquad\qquad \sigma = \sqrt{\frac{\sum_{i=1}^{k} f_i (x_i - \mu)^2}{n}} \]

For \(n\) separate values \(x_1, \ldots, x_n\) (every \(f_i = 1\)):

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

  • \(\sigma^2\): the variance
  • \(\sigma\): the standard deviation
  • \(x_i\): the \(i\)th data value
  • \(f_i\): the frequency of the value \(x_i\)
  • \(n\): the total number of data values (the total frequency)
  • \(\mu\): the mean
  • \(k\): the number of different values
  • The variance is \(\sigma^2\); the standard deviation is \(\sigma\), the square root of the variance.
  • The standard deviation has the same units as the data.
  • Both are never negative. They are zero only when all the values are equal.
  • A small standard deviation means the values are close to the mean; a large one means they are spread out.

At SL the data set is treated as the population, so we divide by \(n\). The syllabus says the standard deviation should be calculated using technology, but working by hand for a small data set helps you understand what it measures.

The second form, “mean of the squares minus the square of the mean”, is often quicker by hand.

Example 2 Prove that \(\dfrac{\sum (x - \mu)^2}{n} = \dfrac{\sum x^2}{n} - \mu^2\), where \(\mu = \dfrac{\sum x}{n}\).

Expand the bracket: \((x - \mu)^2 = x^2 - 2\mu x + \mu^2\). Sum over all \(n\) values (\(\mu\) is a constant):

\[ \sum (x - \mu)^2 = \sum x^2 - 2\mu \sum x + n\mu^2 . \]

Since \(\sum x = n\mu\):

\[ \sum (x - \mu)^2 = \sum x^2 - 2n\mu^2 + n\mu^2 = \sum x^2 - n\mu^2 . \]

Divide by \(n\):

\[ \frac{\sum (x - \mu)^2}{n} = \frac{\sum x^2}{n} - \mu^2 . \qquad \blacksquare \]

Example 3 Find the variance and standard deviation of each data set.

(a) \(2, 4, 6, 8, 10\) \(\qquad\) (b) \(14, 9, 11, 16, 10\)

(a) \(\mu = \dfrac{30}{5} = 6\). Deviations: \(-4, -2, 0, 2, 4\). Squares: \(16, 4, 0, 4, 16\).

\[ \sigma^2 = \frac{40}{5} = 8, \qquad \sigma = \sqrt{8} = 2.83 \text{ (3 s.f.)} \]

(b) \(\mu = \dfrac{60}{5} = 12\). Deviations: \(2, -3, -1, 4, -2\). Squares: \(4, 9, 1, 16, 4\).

\[ \sigma^2 = \frac{34}{5} = 6.8, \qquad \sigma = \sqrt{6.8} = 2.61 \text{ (3 s.f.)} \]

Check with the other form: \(\sum x^2 = 196 + 81 + 121 + 256 + 100 = 754\), and \(\dfrac{754}{5} - 12^2 = 150.8 - 144 = 6.8\) ✓.

Example 4 Find the standard deviation of the lengths in this table (lengths to the nearest cm).

Length (cm) 5–9 10–14 15–19 20–24
Frequency, \(f\) 3 6 8 3

Use the mid-interval values \(x = 7, 12, 17, 22\). From Section 15.2, \(\mu = 14.75\).

By GDC (One-Variable Statistics with \(x\) in list A and \(f\) in list B): \(\sigma_x = 4.60\) cm (3 s.f.).

By hand (to see where it comes from):

\[ \sum f x^2 = 3(49) + 6(144) + 8(289) + 3(484) = 147 + 864 + 2312 + 1452 = 4775 \]

\[ \sigma^2 = \frac{4775}{20} - 14.75^2 = 238.75 - 217.5625 = 21.1875, \qquad \sigma = \sqrt{21.1875} = 4.60 \text{ cm}. \]

Because we used mid-interval values, this is an estimate.

The effect of constant changes (coding)

Sometimes the values are large and awkward. We can code them, for example by subtracting a constant, to make them easier to handle.

Adding or subtracting a constant

\(x\) 5004 4998 5007 5001 4995 5003 5006
\(y = x - 5000\) 4 \(-2\) 7 1 \(-5\) 3 6

The \(y\)-values have mean \(\bar{y} = \dfrac{14}{7} = 2\), so \(\bar{x} = 5000 + 2 = 5002\). Every value moved down by \(5000\), so the mean moved down by \(5000\), but the values are just as spread out as before: the variance does not change. Here \(\sigma_y^2 = \dfrac{140}{7} - 2^2 = 16\), so \(\sigma_x^2 = 16\) and \(\sigma_x = 4\).

Proof. Let \(y_i = x_i - c\). Then

\[ \bar{y} = \frac{\sum (x_i - c)}{n} = \frac{\sum x_i - nc}{n} = \bar{x} - c, \]

and \(y_i - \bar{y} = (x_i - c) - (\bar{x} - c) = x_i - \bar{x}\). The deviations are unchanged, so the variance is unchanged.

Example 5 The masses, \(m\) grams, of 150 parcels were recorded. It was found that

\[ \sum (m - 500) = 1170 \qquad \text{and} \qquad \sum (m - 500)^2 = 30\,726 . \]

Find the mean and the standard deviation of the masses.

Let \(y = m - 500\). Then \(\bar{y} = \dfrac{1170}{150} = 7.8\), so \(\bar{m} = 500 + 7.8 = 507.8\) g.

\[ \sigma_y^2 = \frac{30\,726}{150} - 7.8^2 = 204.84 - 60.84 = 144 . \]

Subtracting 500 does not change the spread, so \(\sigma_m = \sigma_y = \sqrt{144} = 12\) g.

Multiplying by a constant

If every value is multiplied by \(k\), the mean is multiplied by \(k\). Every deviation is also multiplied by \(k\), so every squared deviation is multiplied by \(k^2\).

Proof. Let \(y_i = kx_i\). Then \(\bar{y} = \dfrac{\sum kx_i}{n} = k\bar{x}\), and

\[ \sigma_y^2 = \frac{\sum (kx_i - k\bar{x})^2}{n} = \frac{k^2 \sum (x_i - \bar{x})^2}{n} = k^2 \sigma_x^2 . \]

So \(\sigma_y = |k|\,\sigma_x\) (the standard deviation is never negative).

Example 6 These \(x\)-values are scaled down by a factor of \(\dfrac{1}{200}\), giving \(y = \dfrac{x}{200}\).

\(x\) 600 1400 1000 1800 1200
\(y\) 3 7 5 9 6

Verify that \(\bar{y} = \dfrac{1}{200}\bar{x}\) and that the variance of \(y\) is \(\left(\dfrac{1}{200}\right)^2 \times\) the variance of \(x\).

\(\bar{x} = \dfrac{6000}{5} = 1200\) and \(\bar{y} = \dfrac{30}{5} = 6 = \dfrac{1200}{200}\) ✓.

Variance of \(y\): deviations \(-3, 1, -1, 3, 0\), so \(\sigma_y^2 = \dfrac{9 + 1 + 1 + 9 + 0}{5} = 4\).

Variance of \(x\): deviations \(-600, 200, -200, 600, 0\), so \(\sigma_x^2 = \dfrac{800\,000}{5} = 160\,000\).

\(\left(\dfrac{1}{200}\right)^2 \times 160\,000 = \dfrac{160\,000}{40\,000} = 4\) ✓.

Effect of constant changes: \(y = kx + c\) Not in the formula booklet

  • mean: \(\bar{y} = k\bar{x} + c\)
  • variance: \(\sigma_y^2 = k^2 \sigma_x^2\)
  • standard deviation: \(\sigma_y = |k|\,\sigma_x\)

Adding a constant changes the mean but not the spread. Multiplying changes both.

  • \(x\): the original data values
  • \(y\): the new data values
  • \(k\): the constant each value is multiplied by
  • \(c\): the constant added to each value
  • \(\bar{x}\), \(\bar{y}\): the means of \(x\) and \(y\)
  • \(\sigma_x\), \(\sigma_y\): the standard deviations of \(x\) and \(y\) (\(\sigma_x^2\), \(\sigma_y^2\) are the variances)

Example 7 A data set has mean \(40\) and standard deviation \(6\). Every value is multiplied by \(3\) and then \(5\) is subtracted. Find the new mean, standard deviation and variance.

New mean \(= 3 \times 40 - 5 = 115\). New standard deviation \(= 3 \times 6 = 18\) (the \(-5\) has no effect). New variance \(= 18^2 = 324\).

Using your GDC

In Paper 2 the standard deviation (and the quartiles) should be found with your GDC.

TI-Nspire CX II:

  1. Lists & Spreadsheet page. Type the data in column A. Name the column (for example x). For a frequency table, put the values in column A and the frequencies in column B.
  2. Menu → Statistics → Stat Calculations → One-Variable Statistics. Number of lists: 1.
  3. X1 List: a[] (or your list name). Frequency List: 1 for a plain list, or b[] for a frequency table.

The output includes:

Symbol on GDC Meaning
\(\bar{x}\) mean
\(\Sigma x\), \(\Sigma x^2\) sum of values, sum of squares
\(\sigma x\) standard deviation (divide by \(n\)) — use this one
\(sx\) sample standard deviation (divide by \(n - 1\)) — not used at SL
\(n\) number of values
MinX, \(Q_1\)X, MedianX, \(Q_3\)X, MaxX five-number summary

The variance is not shown: square \(\sigma x\) yourself. For Example 4 the GDC gives \(\bar{x} = 14.75\) and \(\sigma x = 4.6030\ldots\), so \(\sigma = 4.60\) and \(\sigma^2 = 21.2\) (3 s.f.).

Common errors

✗ Wrong ✓ Right Why
Using \(sx\) from the GDC Use \(\sigma x\) At SL the data is the population: divide by \(n\).
Variance \(= \sigma\) Variance \(= \sigma^2\) The standard deviation is the square root of the variance.
Adding 7 to each value adds 7 to \(\sigma\) \(\sigma\) is unchanged Adding moves the data but does not spread it.
Multiplying by 3 multiplies the variance by 3 Variance \(\times 9\) Variance is multiplied by \(k^2\).
\(\frac{\sum x^2}{n} - \mu\) \(\frac{\sum x^2}{n} - \mu^2\) Subtract the square of the mean.
Including the median in each half when \(n\) is odd Leave it out This is the method used by the GDC (other methods exist).

Exercises

1 Find the range, the quartiles and the IQR of \(13, 7, 21, 9, 16, 11, 18, 5, 14\).

In order: \(5, 7, 9, 11, \mathbf{13}, 14, 16, 18, 21\). Range \(= 21 - 5 = 16\); median \(= 13\).

Lower half \(5, 7, 9, 11\): \(Q_1 = 8\). Upper half \(14, 16, 18, 21\): \(Q_3 = 17\). IQR \(= 9\).

2 Find the median and the IQR of \(42, 35, 50, 38, 47, 55, 40, 33, 45, 52\).

In order: \(33, 35, 38, 40, 42, 45, 47, 50, 52, 55\). Median \(= \dfrac{42 + 45}{2} = 43.5\).

Lower half \(33, 35, \mathbf{38}, 40, 42\): \(Q_1 = 38\). Upper half \(45, 47, \mathbf{50}, 52, 55\): \(Q_3 = 50\). IQR \(= 12\).

3 By hand, find the variance and standard deviation of \(3, 5, 6, 8, 13\).

\(\mu = \dfrac{35}{5} = 7\). Deviations \(-4, -2, -1, 1, 6\); squares \(16, 4, 1, 1, 36\); total \(58\).

\(\sigma^2 = \dfrac{58}{5} = 11.6\), \(\;\sigma = \sqrt{11.6} = 3.41\) (3 s.f.).

4 Find the mean and standard deviation of this frequency table, using \(\sigma^2 = \dfrac{\sum fx^2}{n} - \mu^2\).

\(x\) 1 2 3 4
\(f\) 2 5 8 5

\(n = 20\), \(\sum fx = 2 + 10 + 24 + 20 = 56\), \(\mu = 2.8\).

\(\sum fx^2 = 2 + 20 + 72 + 80 = 174\), \(\;\sigma^2 = \dfrac{174}{20} - 2.8^2 = 8.7 - 7.84 = 0.86\), \(\;\sigma = 0.927\) (3 s.f.).

5 For 8 values, \(\sum x = 84\) and \(\sum x^2 = 1020\). Find the mean and the standard deviation.

\(\mu = \dfrac{84}{8} = 10.5\). \(\;\sigma^2 = \dfrac{1020}{8} - 10.5^2 = 127.5 - 110.25 = 17.25\), \(\;\sigma = 4.15\) (3 s.f.).

6 Paper 2 Use your GDC to find the mean and the standard deviation of the waiting times.

Time, \(t\) (min) \(0 \le t < 10\) \(10 \le t < 20\) \(20 \le t < 30\) \(30 \le t < 40\) \(40 \le t < 50\)
Frequency 5 12 18 10 5

Enter the mid-interval values \(5, 15, 25, 35, 45\) in list A and the frequencies in list B. One-Variable Statistics gives \(\bar{x} = 24.6\) and \(\sigma x = 11.128\ldots\)

Mean \(= 24.6\) min, standard deviation \(= 11.1\) min (3 s.f.).

7 A data set has mean \(18\) and standard deviation \(2.5\). Find the new mean and standard deviation when

(a) \(7\) is added to every value,

(b) every value is multiplied by \(4\),

(c) every value \(x\) is replaced by \(10 - x\).

(a) Mean \(25\), s.d. \(2.5\).

(b) Mean \(72\), s.d. \(10\).

(c) Mean \(10 - 18 = -8\), s.d. \(|-1| \times 2.5 = 2.5\).

8 The temperatures in a city in June have mean \(25\,^\circ\)C and standard deviation \(3\,^\circ\)C. The formula \(F = 1.8C + 32\) converts them to degrees Fahrenheit. Find the mean and the variance in \(^\circ\)F.

Mean \(= 1.8 \times 25 + 32 = 77\,^\circ\)F. Standard deviation \(= 1.8 \times 3 = 5.4\,^\circ\)F, so the variance is \(5.4^2 = 29.16\).

9 For 12 values of \(x\), \(\sum (x - 50) = 36\) and \(\sum (x - 50)^2 = 420\). Find the mean and the standard deviation of \(x\).

Let \(y = x - 50\): \(\bar{y} = 3\), so \(\bar{x} = 53\). \(\sigma^2 = \dfrac{420}{12} - 3^2 = 35 - 9 = 26\), \(\;\sigma = \sqrt{26} = 5.10\) (3 s.f.).

10 The five numbers \(4, 6, 9, a, b\) (with \(a < b\)) have mean \(7\) and variance \(3.6\). Find \(a\) and \(b\).

Sum: \(19 + a + b = 35\), so \(a + b = 16\).

Variance: \(\dfrac{\sum x^2}{5} - 49 = 3.6\), so \(\sum x^2 = 263\), and \(16 + 36 + 81 + a^2 + b^2 = 263\), so \(a^2 + b^2 = 130\).

Substitute \(b = 16 - a\): \(a^2 + (16 - a)^2 = 130 \Rightarrow 2a^2 - 32a + 126 = 0 \Rightarrow a^2 - 16a + 63 = 0 \Rightarrow (a - 7)(a - 9) = 0\).

Since \(a < b\): \(a = 7\), \(b = 9\).