Instant PDF download, name-and-email checkout. Complete Book Bundle: every Economics, Statistics, Mathematics, Econometrics and Research Methods book
Statistics

Linear Transformations of Data: What Adding and Multiplying Do to Mean and SD

How adding or multiplying by a constant changes the mean, median, SD, IQR and variance, with °C to °F, pay-rise and Cambridge coded data worked examples.

In 30 seconds
  • A linear transformation changes every value in the same way: \(y = a + bx\). Unit conversions, pay rises and exam coding are all linear transformations.
  • Adding a constant \(a\) shifts the centre (mean, median, quartiles) by \(a\) but leaves the spread (standard deviation, IQR, range, variance) unchanged.
  • Multiplying by a constant \(b\) multiplies the centre by \(b\) and the standard deviation, IQR and range by \(|b|\). The variance is multiplied by \(b^2\).
  • Cambridge “coded data” questions give you \(\Sigma(x-a)\) and \(\Sigma(x-a)^2\). Find the mean and standard deviation of the coded values, then add \(a\) back to the mean only.
  • The shape of the distribution does not change when \(b > 0\), and neither do z-scores. That is why converting units never changes how unusual a value is.

The problem: the same week, two different numbers

A school weather club records the midday temperature for 15 days, in degrees Celsius. A partner school in the United States wants the summary in degrees Fahrenheit. The club secretary has the mean (19.7 °C) and the standard deviation (3.27 °C). Does she have to convert all 15 readings and start again?

No. Converting Celsius to Fahrenheit uses the rule \(F = 1.8C + 32\). Every reading is multiplied by 1.8 and then has 32 added. Because every value is treated in exactly the same way, the summary statistics change in a predictable way too. Once you know the rules, you can convert a whole summary in a few seconds.

The same idea appears when a teacher adds 5 marks to every script, a firm gives a 3% pay rise, or an exam question “codes” data by subtracting 150 from every mass. This guide gives the rules, shows why they work and works through three examples, including a Cambridge-style coded data question.

What is a linear transformation?

Key termLinear transformation: a change to a data set in which every value \(x\) is replaced by \(y = a + bx\), where \(a\) and \(b\) are constants. Adding \(a\) is a shift (or translation). Multiplying by \(b\) is a rescale (or change of scale).

A graph of \(y\) against \(x\) is a straight line, hence “linear”. Common examples:

SituationRule\(a\) (shift)\(b\) (scale)
Celsius to Fahrenheit\(F = 32 + 1.8C\)321.8
Fahrenheit to Celsius\(C = \tfrac{5}{9}(F – 32)\)\(-\tfrac{160}{9}\)\(\tfrac{5}{9}\)
Centimetres to inches\(y = x \div 2.54\)0\(\tfrac{1}{2.54}\)
Add 5 marks to every test\(y = x + 5\)51
A 4% pay rise\(y = 1.04x\)01.04
Cambridge coding\(y = x – 150\)\(-150\)1

Logs, squares and rounding are not linear, so the rules below do not apply to them.

The rules for centre and spread

Suppose the original data have mean \(\bar{x}\), median \(M_x\), standard deviation \(s_x\), interquartile range \(\text{IQR}_x\) and variance \(s_x^2\). After the transformation \(y = a + bx\):

\[ \bar{y} = a + b\bar{x} \qquad M_y = a + bM_x \qquad Q_{1,y} = a + bQ_{1,x} \]
\[ s_y = |b|\,s_x \qquad \text{IQR}_y = |b|\,\text{IQR}_x \qquad \text{range}_y = |b|\,\text{range}_x \qquad s_y^2 = b^2 s_x^2 \]

In words: measures of centre and position follow the full rule (multiply, then add). Measures of spread ignore the added constant and are multiplied by the size of \(b\). The variance is a squared quantity, so it is multiplied by \(b^2\).

Statistics Made Simple textbook coverStatistics Made Simple explains transformations, coded data and every measure of spread with worked examples, diagrams and tables.Get the textbook · $12

Why adding a constant does not change the spread

Imagine five friends standing in a line, a few metres apart. They all take one step forward. The whole group has moved, so the position of its middle has moved. But the gaps between the friends are exactly the same. Spread is about gaps, and adding a constant does not change any gap.

In symbols, each deviation becomes \((x_i + a) – (\bar{x} + a) = x_i – \bar{x}\). Nothing changes, so neither does the standard deviation.

Why multiplying changes everything

Now the friends stand twice as far apart. Every gap doubles, so the range, IQR and standard deviation double, and the mean doubles too. Each squared deviation becomes four times as big, which is why the variance is multiplied by \(b^2\), not \(b\).

What about a negative multiplier?

If \(b\) is negative, the data are flipped. Record “marks lost” on a test out of 50, \(y = 50 – x\), so \(b = -1\). The mean is \(50 – \bar{x}\) and the SD is \(|-1| \times s_x = s_x\), because spread is never negative. The quartiles swap: \(Q_{1,y} = 50 – Q_{3,x}\). Left skew becomes right skew.

What does not change at all

When \(b > 0\), the shape of the distribution is unchanged. A histogram of Fahrenheit temperatures looks exactly like a histogram of Celsius temperatures, with new numbers on the axis. Skewness, the number of peaks and the presence of outliers all stay the same. The z-score of each value is also unchanged:

\[ z = \frac{y – \bar{y}}{s_y} = \frac{(a + bx) – (a + b\bar{x})}{b\,s_x} = \frac{x – \bar{x}}{s_x} \]

A hot day is equally unusual in Celsius or Fahrenheit. For a refresher, see our guide to z-scores and the normal distribution.

StatisticAdd \(a\)Multiply by \(b\)Both: \(y = a + bx\)
Mean, median, mode\(+a\)\(\times b\)\(a + b(\ldots)\)
Quartiles, percentiles, min, max\(+a\)\(\times b\)\(a + b(\ldots)\)
Standard deviation, IQR, rangeno change\(\times |b|\)\(\times |b|\)
Varianceno change\(\times b^2\)\(\times b^2\)
Shape, z-scores (for \(b > 0\))no changeno changeno change

Worked examples

Worked example

1. Celsius to Fahrenheit. The weather club’s 15 midday temperatures (°C) are: 14, 16, 17, 17, 18, 19, 19, 19, 20, 20, 21, 22, 22, 24, 27. Find the mean, median, standard deviation, IQR and variance in °C, then in °F, using \(F = 1.8C + 32\). (The figures are illustrative.)

Step 1Summarise the Celsius data. The total is 295, so the mean is \(295 \div 15 = 19.67\) °C. With 15 values in order, the median is the 8th value: 19 °C.
Step 2Find the quartiles. Take the median of each half, leaving out the median itself. The lower half (14 to 19) has median 17. The upper half (20 to 27) has median 22. So \(Q_1 = 17\), \(Q_3 = 22\) and \(\text{IQR} = 5\) °C.
Step 3Find the spread. The sample standard deviation is \(s = 3.27\) °C and the variance is \(s^2 = 10.67\) °C².
Step 4Apply the centre rule (multiply, then add). Mean: \(1.8 \times 19.67 + 32 = 67.4\) °F. Median: \(1.8 \times 19 + 32 = 66.2\) °F.
Step 5Apply the spread rule (multiply only). SD: \(1.8 \times 3.27 = 5.88\) °F. IQR: \(1.8 \times 5 = 9\) °F. Variance: \(1.8^2 \times 10.67 = 3.24 \times 10.67 = 34.56\) °F².
Step 6Check one value. Converting all 15 readings and using a calculator gives a mean of 67.4 °F and a standard deviation of 5.88 °F, so the shortcut agrees.

The +32 moved the centre only. The ×1.8 stretched the spread.

Figure 1 shows both dot plots on one number line. The Fahrenheit dots sit further right and cover a wider stretch of the axis, but the pattern is identical.

The same 15 days in °C and °F degrees
Recorded in °CConverted to °FMean and one SD each side
10 20 30 40 50 60 70 80 Temperature (°C for the top row, °F for the bottom row) mean 19.7, SD 3.27 mean 67.4, SD 5.88 Recorded in °C Same days converted to °F (F = 1.8C + 32)
Figure 1. Converting °C to °F moves every value right and stretches the gaps by 1.8. The shape is unchanged, the mean moves from 19.7 to 67.4 and the SD grows from 3.27 to 5.88 (=1.8 × 3.27). The figures are illustrative.
Worked example

2. Two kinds of pay rise. A small firm has seven workers whose monthly pay (in dollars) is 2,400, 2,600, 2,800, 3,000, 3,200, 3,400 and 4,300. The mean is $3,100, the median is $3,000 and the standard deviation is $629.81. The owner offers either (A) $200 more for everyone or (B) a 5% rise for everyone. Compare the mean, median and SD under each option. Then find the effect of (C) a 3% rise plus $100. (The figures are illustrative.)

Step 1Option A is \(y = x + 200\), a pure shift. Mean \(= 3{,}100 + 200 = \$3{,}300\). Median \(= \$3{,}200\). SD is unchanged at $629.81.
Step 2Option B is \(y = 1.05x\), a pure rescale. Mean \(= 1.05 \times 3{,}100 = \$3{,}255\). Median \(= 1.05 \times 3{,}000 = \$3{,}150\). SD \(= 1.05 \times 629.81 = \$661.31\).
Step 3Option C is \(y = 100 + 1.03x\). Mean \(= 100 + 1.03 \times 3{,}100 = \$3{,}293\). Median \(= 100 + 1.03 \times 3{,}000 = \$3{,}190\). SD \(= 1.03 \times 629.81 = \$648.71\).
Step 4Interpret. Option A raises the mean the most and keeps the gap between the best and worst paid exactly the same. Option B widens the gap in dollars, because the highest earner gets $215 while the lowest gets $120.

A flat rise keeps the dollar spread the same; a percentage rise scales it.

Coded data: the Cambridge 9709 S1 version

The Cambridge International AS & A Level Mathematics syllabus (9709) asks students to calculate the mean and standard deviation from given totals, including coded totals of the form \(\Sigma(x-a)\) and \(\Sigma(x-a)^2\) [3]. These questions are just linear transformations in disguise. The code is \(y = x – a\), so \(b = 1\): the mean shifts by \(a\) and the standard deviation does not change.

Key termCoded data: values that have been transformed, usually by subtracting a convenient constant \(a\) (and sometimes dividing by a constant \(b\)), to make totals smaller and easier to work with. You work out statistics for the coded values and then “decode” them.

Cambridge uses the population form of the variance, dividing by \(n\). With \(y = x – a\):

\[ \bar{x} = a + \frac{\Sigma(x-a)}{n} \qquad \sigma^2 = \frac{\Sigma(x-a)^2}{n} – \left(\frac{\Sigma(x-a)}{n}\right)^2 \]

Notice that the variance formula has no \(a\) left in it at the end. That is the “adding a constant does not change the spread” rule at work.

If the code also divides by a constant, \(y = \dfrac{x-a}{b}\), then \(x = a + by\), so \(\bar{x} = a + b\bar{y}\) and \(\sigma_x = b\,\sigma_y\).

Sometimes you need the raw totals \(\Sigma x\) and \(\Sigma x^2\), for example to combine two data sets. Expand the brackets:

\[ \Sigma x = \Sigma(x-a) + na \qquad \Sigma x^2 = \Sigma(x-a)^2 + 2a\,\Sigma(x-a) + na^2 \]
Worked example

3. A coded data question. The masses, \(x\) grams, of 20 apples are summarised by \(\Sigma(x-150) = -34\) and \(\Sigma(x-150)^2 = 1286\). (a) Find the mean and standard deviation of the masses. (b) Find \(\Sigma x\) and \(\Sigma x^2\). (The figures are illustrative.)

Step 1Mean of the coded values: \(\bar{y} = -34 \div 20 = -1.7\). Decode by adding 150 back: \(\bar{x} = 150 + (-1.7) = 148.3\) g.
Step 2Variance of the coded values: \(\sigma^2 = \dfrac{1286}{20} – (-1.7)^2 = 64.3 – 2.89 = 61.41\).
Step 3Standard deviation: \(\sigma = \sqrt{61.41} = 7.84\) g. Do not add 150 to this. The shift does not affect spread.
Step 4Raw totals: \(\Sigma x = -34 + 20 \times 150 = 2{,}966\). \(\Sigma x^2 = 1286 + 2 \times 150 \times (-34) + 20 \times 150^2 = 1286 – 10{,}200 + 450{,}000 = 441{,}086\).
Step 5Check: \(\dfrac{441{,}086}{20} – 148.3^2 = 22{,}054.3 – 21{,}992.89 = 61.41\). The variance matches.

Mean 148.3 g, standard deviation 7.84 g (3 s.f.). The Step 5 check catches most slips.

Statistics Made Simple Practice Questions coverMake transformations and coded data automatic with the Practice Questions book: 1,569 questions, all fully worked.Get 1,569 questions · $9
Common mistakeAdding the constant to the standard deviation. If every mark goes up by 5, the standard deviation does not go up by 5. Adding moves the data; it does not spread them out. The same goes for the IQR and the range. In coded data questions, add \(a\) back to the mean only.
Common mistakeMultiplying the variance by \(b\) instead of \(b^2\). If prices are converted at 1.27 dollars per pound, the standard deviation is multiplied by 1.27 but the variance is multiplied by \(1.27^2 = 1.6129\). Transform the SD first, then square it.

How linear transformations appear in exams

The idea turns up in several syllabuses, in slightly different clothes.

  • AP Statistics. Describing and comparing one-variable data is a core part of the course [4]. Questions give a summary in one unit and ask for it in another. The same rules reappear later for random variables: if \(Y = a + bX\), then \(\mu_Y = a + b\mu_X\) and \(\sigma_Y = |b|\sigma_X\). Standard AP texts such as Starnes and Tabor treat the two ideas together [2]. For the random-variable version, see combining random variables.
  • Cambridge 9709 Probability & Statistics 1. Expect coded totals, often with a second part that combines two groups. The syllabus lists using totals for problems involving up to two data sets [3].
  • IB Mathematics and first-year university. Expect “each value is multiplied by 3 and then 2 is subtracted” questions, and routine unit changes in data work. Introductory texts such as OpenStax Introductory Statistics cover the measures of centre and spread these rules act on [1].
Exam tipBefore you calculate anything, write the transformation in the form \(y = a + bx\) and label \(a\) and \(b\). Then write two short lines: “centre: \(a + b \times\) old” and “spread: \(|b| \times\) old”. For a rule like \(C = \tfrac{5}{9}(F – 32)\), work in two steps: subtract 32 (spread unchanged), then multiply by \(\tfrac{5}{9}\) (spread scaled).

Want the full chapter on describing data, with every calculation shown? The Statistics Made Simple textbook covers centre, spread, transformations and z-scores, and the Statistics Made Simple Practice Questions book gives you drills and exam-style questions with fully worked answers.

Statistics Made Simple bundle coverMaster describing data, from summaries to z-scores, with both Statistics Made Simple books for $16.Both books · $16

Practice questions

EasyQ1. A class test has mean 62 and standard deviation 8. The teacher adds 5 marks to every script. Find the new mean and standard deviation. Show worked answer
This is \(y = x + 5\), a pure shift.
New mean \(= 62 + 5 = 67\).
New standard deviation \(= 8\) (adding a constant does not change spread).
EasyQ2. Book prices in pounds have mean £40, median £38, standard deviation £6 and IQR £9. They are converted to dollars at $1.27 per pound. Find the four statistics in dollars, and the new variance. (The exchange rate is illustrative.) Show worked answer
This is \(y = 1.27x\), so \(a = 0\), \(b = 1.27\).
Mean \(= 1.27 \times 40 = \$50.80\). Median \(= 1.27 \times 38 = \$48.26\).
SD \(= 1.27 \times 6 = \$7.62\). IQR \(= 1.27 \times 9 = \$11.43\).
Variance \(= 1.27^2 \times 36 = 1.6129 \times 36 = 58.06\) (dollars squared).
MediumQ3. Daily maximum temperatures in a city have mean 77 °F and standard deviation 9 °F. Find the mean and standard deviation in °C, using \(C = \tfrac{5}{9}(F – 32)\). Show worked answer
Step 1, subtract 32: mean \(77 – 32 = 45\); SD stays 9.
Step 2, multiply by \(\tfrac{5}{9}\): mean \(= \tfrac{5}{9} \times 45 = 25\) °C; SD \(= \tfrac{5}{9} \times 9 = 5\) °C.
MediumQ4. Ten values of \(x\) are coded using \(y = \dfrac{x – 200}{10}\). The coded totals are \(\Sigma y = 12\) and \(\Sigma y^2 = 86\). Find the mean and standard deviation of \(x\). Show worked answer
\(\bar{y} = 12 \div 10 = 1.2\).
\(\sigma_y^2 = 86 \div 10 – 1.2^2 = 8.6 – 1.44 = 7.16\), so \(\sigma_y = 2.676\).
Decode with \(x = 200 + 10y\): \(\bar{x} = 200 + 10 \times 1.2 = 212\).
\(\sigma_x = 10 \times 2.676 = 26.8\) (3 s.f.). The 200 does not affect the SD; the 10 does.
ExamQ5. The times, \(x\) minutes, taken by two groups of runners are summarised below. Group A: \(n = 12\), \(\Sigma(x-30) = 18\), \(\Sigma(x-30)^2 = 240\). Group B: \(n = 8\), \(\Sigma(x-30) = -6\), \(\Sigma(x-30)^2 = 150\). (a) Find the mean and standard deviation of Group A. [3] (b) Find the mean and standard deviation of all 20 times. [4] Show worked answer
(a) \(\bar{x}_A = 30 + 18 \div 12 = 31.5\) minutes. M1 A1
\(\sigma_A^2 = 240 \div 12 – 1.5^2 = 20 – 2.25 = 17.75\), so \(\sigma_A = 4.21\) minutes. A1
(b) Combine the coded totals (same \(a = 30\)): \(\Sigma(x-30) = 18 + (-6) = 12\) and \(\Sigma(x-30)^2 = 240 + 150 = 390\). M1
Mean \(= 30 + 12 \div 20 = 30.6\) minutes. A1
\(\sigma^2 = 390 \div 20 – 0.6^2 = 19.5 – 0.36 = 19.14\). M1
\(\sigma = \sqrt{19.14} = 4.37\) minutes. A1
Note: you can add the coded totals directly only because both groups use the same code, \(x – 30\). (The figures are illustrative.)

Frequently asked questions

Does adding a constant change the variance?

No. Adding (or subtracting) a constant moves every value and the mean by the same amount, so every deviation from the mean is unchanged. The variance, standard deviation, IQR and range all stay the same.

Why is the variance multiplied by b squared?

The variance is the average of squared deviations. Multiplying every value by \(b\) multiplies every deviation by \(b\), so every squared deviation is multiplied by \(b^2\). The standard deviation is the square root of the variance, so it is multiplied by \(|b|\).

Do the rules work for the sample and population standard deviation?

Yes. The rules come from the deviations, not from whether you divide by \(n\) or \(n – 1\). Either way, the SD is multiplied by \(|b|\) and is unaffected by \(a\).

Does a linear transformation change the shape of a histogram?

Not when \(b > 0\). The bars keep the same relative heights and the same pattern; only the axis labels change. If \(b < 0\) the histogram is mirrored, so a right-skewed distribution becomes left-skewed. See our guide to histograms and the shape of a distribution for more on shape.

References

  1. Illowsky, B. and Dean, S. (2023). Introductory Statistics 2e. Houston, TX: OpenStax, Rice University. Chapter 2, Descriptive Statistics. https://openstax.org/details/books/introductory-statistics-2e
  2. Starnes, D. S. and Tabor, J. (2024). The Practice of Statistics for the AP Course, 7th edition. BFW High School Publishers (Macmillan Learning). ISBN 9781319409340. https://store.bfwpub.com/hs/us/product/The-Practice-of-Statistics-for-the-AP-Course-7th-Edition/p/1319409342
  3. Cambridge University Press & Assessment (2023). Cambridge International AS & A Level Mathematics 9709: Syllabus for examination in 2026 and 2027, Version 5. Section 5.1, Representation of data. https://www.cambridgeinternational.org/Images/697427-2026-2027-syllabus.pdf
  4. College Board (2026). AP Statistics Course and Exam Description, effective fall 2026. New York: College Board. https://apcentral.collegeboard.org/media/pdf/ap-statistics-course-and-exam-description-effective-fall-2026.pdf
Statistics Made Simple Complete Bundle cover showing both the textbook and practice book
This topic has a full chapter in Statistics Made Simple, with 1,569 worked practice questions in the bundle.Statistics Made Simple Complete Bundle — Textbook + 1,569 Practice Questions
Get it for $19
E

The EconTutorials team writes clear, exam-focused lessons in economics and statistics for A-Level, IB, AP and university students, with more than 13 years of classroom teaching behind every guide and book in the Made Simple series.