Coded data
- Coding means: make the numbers friendlier, calculate, then undo the code.
- Subtract from every value and the mean drops by exactly .
- So after working with , add back at the end.
- Most exam questions hand you a coded total and test whether you can un-shift it.
Un-shift a coded total
The second identity recovers itself — which is what lets you combine two coded data sets (un-shift each to its total first).
- Read the code (e.g. ).
- Recover the true total: .
- Mean: , or directly .
- To combine sets, un-shift each to its first, then add.
Worked example
Start simple: the core un-shift
Ten boys' ages 5 years ago summed to 127: . Today's mean age?
, or .
Worked example
Grouped coded data
40 values coded as with coded mid-values and : .
Worked example
Combine two coded sets
for 10 boys and for 15 girls. Un-shift each: ; . Combined mean .
Coding by ×a as well: undo −b first, then ÷a
Worked example
A multiplicative code: ax − b
For 20 values coded as it is given that . The coded mean is . Undo the code in reverse order — add 3, then divide by 2:
.
Cross-check via totals: .
Coding just slides the numbers; slide the answer back by +b — and keep the n in Σx = Σ(x−b) + nb. For ax − b, undo −b before ÷a.
| The code | Undo it by… |
|---|---|
| add b at the end | |
| grouped (x−b) | coded mid-values, then +b |
| add b, then ÷a (in that order) |
Examiner note
Common mistake
Common mistake