Coded data: shift and scale
Coding replaces awkward values with simpler ones. To decode spread correctly, separate the two actions: adding shifts every value, while multiplying changes every gap.
Shift slides; scale stretches
original x
2, 4, 6 → SD = s
shift x + 10
12, 14, 16 → SD = s
All gaps stay the same.
scale 3x
6, 12, 18 → SD = 3s
Variance becomes 9 times as large.
Shift leaves spread; scale changes it
Adding shifts every value by the same amount. Multiplying changes every gap by the scale factor, so it changes the spread.
Symbols
- = scale factor (none)
- = shift applied to every value (data unit)
Standard deviation is the square root of variance, so it takes one factor of the scale. Distance cannot be negative, hence the absolute value.
- Add b to every value: add b to the mean; SD and variance do not change.
- Multiply every value by a: multiply the mean by a, the SD by |a| and the variance by a².
Shift moves the centre without changing gaps. Scale stretches or compresses every gap.
Use coded totals as a complete data set
Let . First find the mean and variance of from its totals. Then undo the scale and shift.
Worked example
Decode mean and standard deviation
For 10 values, and .
The coded variance is:
Since , the mean is multiplied by 5 then shifted by 100. SD is only multiplied by 5.
Common mistake
A pure shift can be left coded
If , then . The mean needs the shift restored, but the variance and SD of are already the variance and SD of .
Worked example
Standard deviation from shifted totals
Eight values satisfy and . Let .
The coded variance is:
Write the inverse before decoding
- Name the coded variable. Write the given relationship exactly.
- Rearrange for the original variable. This exposes the scale and shift in the correct order.
- Decode centre and spread differently. Mean uses both scale and shift. SD uses only the absolute scale; variance uses its square.
For , 20 coded values have mean 25 and variance 144. Find the mean, variance and standard deviation of .
Show worked answer
Rearrange first: .
