Maths › Edexcel › Chapter 2: Measures of location and spread
Coding
Statistics and Mechanics Year 1, chapter 2 (Measures of location and spread), section 2.5
Coding
To make calculations easier, data can be coded with a linear change:
y=bx−a
Choose a to be near the middle of the data and b to simplify the values.
Effect on the mean and standard deviation
If y=bx−a, then x=a+by, and
xˉ=a+byˉσx=bσy
Adding or subtracting a number shifts the mean but does not change the spread.
Multiplying or dividing changes both.
Worked example 1
Data are coded as y=x−100, with yˉ=4.2 and σy=1.5.
xˉ=100+4.2=104.2σx=1.5
Worked example 2
Coded with y=5x−50, with yˉ=3 and σy=2.
xˉ=50+5(3)=65σx=5×2=10
Worked example 3: from sums
∑(x−20)=45 and ∑(x−20)2=305 for n=15. With y=x−20: yˉ=3 and σy2=15305−9=11.33, so xˉ=23 and σx=11.33≈3.37.
Why the standard deviation ignores the shift
Subtracting a constant moves every value by the same amount, so the distances between values do not change.
Common mistake: applying the same shift to the standard deviation. Only the multiplierb affects the spread. Also, remember to decode the variance by multiplying by b2.
Exam tip: state the code, then decode: xˉ=a+byˉ and σx=bσy. Show each step so a slip in one still earns method marks.
Check yourself
If y=x−30 and yˉ=5, find xˉ.
35.
If y=10x and σy=2, find σx.
20.
Does subtracting a constant change the standard deviation?