Sub topic 3
What happens when values are added, scaled, or changed
This chapter assumes you can compute a mean and a median, square numbers, take square roots, and solve a linear equation.
Transformations of a data set
Adding a constant c to every value shifts the mean, median, and mode by c. The range and standard deviation stay the same, because every gap between values is unchanged. Multiplying every value by k scales all four measures by k. The standard deviation scales by |k|.
Take the data set [2, 4, 4, 4, 5, 5, 7, 9], which has mean 5, median 4.5, range 7, and population standard deviation 2.
| Transformation | Mean | Median | Range | Standard deviation |
|---|---|---|---|---|
| Add 10 | 15 | 14.5 | 7 | 2 |
| Multiply by 3 | 15 | 13.5 | 21 | 6 |
import statistics
data = [2, 4, 4, 4, 5, 5, 7, 9]
new = [3 * x + 10 for x in data]
print(statistics.mean(new)) # 25
print(statistics.median(new)) # 23.5
print(max(new) - min(new)) # 21
print(statistics.pstdev(new)) # 6.0Outliers and skew: mean versus median
One extreme value pulls the mean toward it but barely moves the median. For [2, 4, 4, 4, 5, 5, 7, 90], the mean is 15.125 and the median is 4.5. When the mean is larger than the median, the data is skewed to the right.
Quartiles and the interquartile range
Sort the data, split it at the median, and take the median of each half. For [2, 4, 4, 4, 5, 5, 7, 9], the lower half is [2, 4, 4, 4] with median 4, and the upper half is [5, 5, 7, 9] with median 6. The interquartile range (IQR) is 6 minus 4, which equals 2.
The 68-95-99.7 rule
For approximately normal data, about 68% of values lie within 1 standard deviation of the mean, about 95% within 2, and about 99.7% within 3. For a mean of 100 and a standard deviation of 15, about 68% of values fall between 85 and 115.
GRE strategies and common traps
- Sort the data before finding the median, quartiles, or range.
- With an even count, the median is the average of the two middle values.
- A set can have several modes or none.
Exercise
If every value in a set is multiplied by 4 and then 6 is subtracted, what happens to the standard deviation?
Show answer
The subtraction has no effect, and multiplying by 4 scales the standard deviation by 4. For the set above, the standard deviation becomes 8.