Salam Academy
Data presentation and interpretation · Subtopic 4 of 6

Coded and Combined Data

Shifting every value moves the mean but leaves the spread alone; scaling every value scales both. Knowing this, you can work with simpler "coded" numbers and translate back, and you can merge two groups using their totals.

Cambridge 9709 Paper 5Edexcel YMA01 WST01Edexcel 9MA0 Paper 3AQA 7357 Paper 3≈ 30 minRevision 5 · updated 2026-10-27
Section 1 of 14

Learning objectives

  • Find the mean and standard deviation from Σ(x−a)\Sigma(x-a) and Σ(x−a)2\Sigma(x-a)^2.
  • Know the effect of y=ax+by=ax+b on the mean and standard deviation.
  • Recover Σx\Sigma x and Σx2\Sigma x^2 from a mean and standard deviation.
  • Combine two data sets into one mean and standard deviation.
Pause and think

Every student's test mark is increased by 55. What happens to the mean? What happens to the standard deviation?

Section 2 of 14

Core idea

Start hereMake the numbers small

Heights of adults are all around 170170 cm. Squaring numbers like 172172, 168168, 175175 for a variance is tedious. Subtract 170170 first: 2,−2,52,-2,5. The spread is unchanged and the arithmetic is easy. This is coding.

The big idea

If y=x−aby=\frac{x-a}b: yˉ=xˉ−ab\bar y=\frac{\bar x-a}b and σy=σxb\sigma_y=\frac{\sigma_x}b. Equivalently xˉ=byˉ+a\bar x=b\bar y+a, σx=bσy\sigma_x=b\sigma_y. Adding/subtracting shifts the mean only; multiplying scales both.

1. Shifting and scaling

Adding a constant slides the whole shape along
−4−22468100.10.20.30.40.50valueoriginalevery value + a
The mean moves by aa; the width of the shape (the standard deviation) does not change at all.
Effect of y=x−ay=x-a
  1. yˉ=∑(x−a)n=∑x−nan=xˉ−a\bar y=\frac{\sum(x-a)}n=\frac{\sum x-na}n=\bar x-a
    Mean shifts.
  2. y−yˉ=(x−a)−(xˉ−a)=x−xˉy-\bar y=(x-a)-(\bar x-a)=x-\bar x
    Deviations unchanged.
  3. σy=σx\sigma_y=\sigma_x
    So the spread is unchanged.
Dividing by bb divides every deviation by bb, so the SD is divided by bb (variance by b2b^2).

2. Summary statistics in coded form

Worked examplen=20n=20, ∑(x−50)=120\sum(x-50)=120, ∑(x−50)2=2000\sum(x-50)^2=2000

Find the mean and SD of xx, then ∑x\sum x and ∑x2\sum x^2.

Goal
Four values.
Strategy
Work with y=x−50y=x-50.
  1. yˉ=6⇒xˉ=56\bar y=6\Rightarrow\bar x=56
    Add 5050 back.
  2. σy2=200020−62=64⇒σx=8\sigma_y^2=\tfrac{2000}{20}-6^2=64\Rightarrow\sigma_x=8
    SD unchanged.
  3. ∑x=∑(x−50)+20×50=1120\sum x=\sum(x-50)+20\times50=1120
    Undo the coding.
  4. ∑x2=20(σ2+xˉ2)=20(64+3136)=64000\sum x^2=20(\sigma^2+\bar x^2)=20(64+3136)=64000
    Rearrange σ2=∑x2n−xˉ2\sigma^2=\frac{\sum x^2}n-\bar x^2.
Answerxˉ=56\bar x=56, σ=8\sigma=8, ∑x=1120\sum x=1120, ∑x2=64000\sum x^2=64000.
✓ Check6400020−562=3200−3136=64\frac{64000}{20}-56^2=3200-3136=64 ✓.
Common misconceptionShifting the SD Subtracting 5050 does not change the SD.
Pause and think

°C has mean 20, SD 5. In °F (F=1.8C+32F=1.8C+32)?

Summary

  • Shift: mean only.
  • Scale by bb: mean and SD × bb.
Key words
Coding
Linear transformation of data.
HistoryCoding before calculators. Until the 1970s, statistics was done by hand or with mechanical calculators. Squaring numbers like 10471047 hundreds of times was slow and error-prone, so statisticians subtracted a convenient value first (coding) and worked with small numbers like −3-3 and 77. Exam questions on coding preserve this clever shortcut.
Fun factCelsius to Fahrenheit is coding. F=1.8C+32F=1.8C+32 is a linear code. If a week's temperatures have mean 20∘20^\circC and standard deviation 5∘5^\circC, in Fahrenheit the mean is 1.8(20)+32=68∘1.8(20)+32=68^\circF, but the standard deviation is just 1.8×5=9∘1.8\times5=9^\circF: the +32+32 never touches the spread.
Keep reading for free

Create a free account to read the rest of this lesson: key formulae, worked examples, explore the graph, common mistakes, exam tip, guided practice and more. Your answers are checked and your progress is saved.