Sub topic 7
Deviations from the Mean
This chapter assumes you can add, subtract, square numbers, and calculate a mean. You should also be comfortable reading an ordered list of values.
A deviation from the mean measures how far a value is from the mean. For a data value \(x\) and mean \(\bar{x}\),
\text{deviation} = x-\bar{x}A positive deviation means the value is above the mean. A negative deviation means it is below the mean. A deviation of zero means the value equals the mean.
Finding deviations
Consider the data set:
2,\ 4,\ 4,\ 4,\ 5,\ 5,\ 7,\ 9The mean is
\bar{x}=\frac{2+4+4+4+5+5+7+9}{8}=\frac{40}{8}=5Subtract 5 from each value.
| Value \(x\) | Deviation \(x-5\) |
|---|---|
| 2 | -3 |
| 4 | -1 |
| 4 | -1 |
| 4 | -1 |
| 5 | 0 |
| 5 | 0 |
| 7 | 2 |
| 9 | 4 |
The deviations add to zero:
-3-1-1-1+0+0+2+4=0This always happens when deviations are measured from the arithmetic mean. The values below the mean balance the values above the mean.
Why signed deviations are not enough
Because positive and negative deviations cancel, their sum cannot measure overall spread. For the data above, the sum is zero even though the values are not identical.
To avoid cancellation, square each deviation. Squaring makes every result nonnegative:
(-3)^2=9,\quad (-1)^2=1,\quad 2^2=4,\quad 4^2=16The squared deviations for all eight values are
9,\ 1,\ 1,\ 1,\ 0,\ 0,\ 4,\ 16Their sum is
9+1+1+1+0+0+4+16=32The population variance is the average of the squared deviations:
\text{variance}=\frac{32}{8}=4The population standard deviation is the square root of the variance:
\text{standard deviation}=\sqrt{4}=2Standard deviation is therefore based on deviations, but it returns to the original units of the data. If the data are measured in dollars, the standard deviation is measured in dollars, not dollars squared.
import math
data = [2, 4, 4, 4, 5, 5, 7, 9]
mean = sum(data) / len(data)
deviations = [x - mean for x in data]
squared = [d ** 2 for d in deviations]
variance = sum(squared) / len(data)
standard_deviation = math.sqrt(variance)
print(deviations)
print(squared)
print(variance)
print(standard_deviation)GRE reasoning with deviations
If two data sets have the same mean, compare their deviations from that mean. A set whose values lie farther from the mean generally has the larger standard deviation.
For example, the sets \(4,5,6\) and \(1,5,9\) both have mean 5. The second set has larger deviations, so it has a larger standard deviation.
Exercise
A data set has mean 12. What is the deviation of 7, and what is its squared deviation?
Show answer
The deviation is \(7-12=-5\). Its squared deviation is \((-5)^2=25\).