Coded Data and Totals
Coding replaces awkward data values with simpler ones. It does not change which observations belong to the data set, and every step must be reversible. A scale factor multiplies every value; a shift adds or subtracts the same amount from every value.
Coding is a reversible machine
encode
x → multiply by 2 → subtract 3 → y
decode in reverse
y → add 3 → divide by 2 → x
check
x = (y + 3) ÷ 2
Undo the last operation first.
Decode a mean in reverse order
Symbols
- = original value (original unit)
- = coded value (coded scale)
- = scale factor (none)
- = shift (coded scale)
The scale factor must not be zero; otherwise every original value would be sent to the same coded value and the coding could not be reversed.
The same transformation acts on the mean:
Reverse the coding to recover the original mean:
Worked example
Undo a scale and a shift
Data are coded by . If the coded mean is 17, reverse the code: add 3, then divide by 2.
Common mistake
A shift appears once for every value
The subtraction of happens to every one of the values. That is why the total changes by , not by only .
With a frequency table, the total number of observations is . The same idea becomes
Divide the coded total by to get the coded mean, then undo the shift and scale in reverse order.
- Expand the coded total. Write .
- Solve for the requested total or count. Keep attached to the shift.
- Check the scale. Substitute the result back into the coded-total equation.
Examiner note
Now you try
For values, and . Find and the mean of the original values.
Show worked answer
Since ,, so .
