Skip to main content

Data transformation and linearisation (QCE General Mathematics Unit 3 extension)

Syllabus dot point

“Apply a square, logarithmic or reciprocal transformation to one variable to linearise a non-linear association, fit a least-squares line to the transformed data, use the transformed equation to predict, and choose the transformation that best straightens the scatter”

15 min read

Quick answer

When a residual plot shows a clear pattern, a straight line does not suit the raw data. Linearise by transforming one variable with a square, logarithm or reciprocal chosen from the shape of the scatter, fit a least-squares line to the transformed data, and keep the transformation with the most random residual plot and highest r2r^2. To predict, transform the input, substitute, and reverse any transformation of yy. In the QCAA 2025 syllabus this is extension: the required skill is using the residual plot to judge whether a linear model is appropriate.

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Exam-style questions
  4. Practice questions

What this dot point is asking

Some bivariate data are clearly curved. Stopping distance grows faster than speed, app downloads grow by a percentage each month, and the time to finish a job drops quickly then levels off as more workers join. A least-squares line fitted to data like these gives biased predictions, and its residual plot shows a pattern. Data transformation is the standard fix: change the scale of one variable (square it, take its logarithm, or take its reciprocal) so that the scatter becomes straight, then fit and use a least-squares line on the new scale.

Note

Data transformation (square, log and reciprocal) is not listed in the subject matter of the QCAA General Mathematics 2025 syllabus, which is assessed from 2026. What the syllabus does require is that you use a residual plot to decide whether a linear model is appropriate (see residual analysis). Treat this page as extension: it is useful in the problem-solving and modelling task (IA1) when your own data are curved, and it deepens your understanding of residuals, but the external assessment does not require you to carry it out.

The answer

Step zero: recognise that the data are curved

You only transform when a straight line is the wrong model. The evidence comes from two places:

  • The scatterplot: the points bend, rather than scattering evenly about a straight line.
  • The residual plot: after fitting a least-squares line to the raw data, the residuals show a clear pattern, such as positive at both ends and negative in the middle (a U shape), or the reverse. A random scatter of residuals about zero supports a linear model; a pattern rejects it.

A high correlation coefficient does not settle the question. Curved data often have rr above 0.95. The stopping-distance data below have r2=0.988r^2 = 0.988 on the raw scale, yet the residual plot shows that a straight line systematically underestimates at both ends and overestimates in the middle.

The three transformations

Each transformation changes the spacing of values. Applied to either the explanatory variable xx or the response variable yy:

Transformation Effect on large values Typical use
Squared: x2x^2 or y2y^2 Stretches them apart Undo a curve that bends the other way
Logarithmic: log⁡10x\log_{10} x or log⁡10y\log_{10} y Compresses them Growth or decay by a constant percentage; data spanning several orders of magnitude
Reciprocal: 1x\dfrac{1}{x} or 1y\dfrac{1}{y} Compresses them strongly (and reverses order) Values that fall quickly and then level off towards a limit

Logarithms and reciprocals need positive values, and the reciprocal of a variable reverses its order (the largest xx has the smallest 1x\frac{1}{x}), so the slope of the fitted line can change sign.

Choosing which transformation to try

Match the transformation to the shape of the scatter. A useful rule: stretch the side that is too short, or compress the side that is too long.

Shape of the scatter Try on xx Try on yy
Increasing, and steeper and steeper (curving up) x2x^2 log⁡y\log y or 1y\dfrac{1}{y}
Increasing, but flattening (curving down) log⁡x\log x or 1x\dfrac{1}{x} y2y^2
Decreasing, and flattening (curving up) log⁡x\log x or 1x\dfrac{1}{x} log⁡y\log y or 1y\dfrac{1}{y}
Decreasing, and steeper and steeper (curving down) x2x^2 y2y^2

Then test. Fit a least-squares line to each candidate, look at each residual plot, and choose the transformation that gives the most random residuals and the highest r2r^2. Transform one variable at a time: changing both is rarely needed and makes the model harder to interpret.

Key fact

Transform only when the raw residual plot shows a pattern. Choose among x2x^2, log⁡\log and reciprocal by the shape of the scatter, then compare residual plots and r2r^2. The fitted equation is in terms of the transformed variable, so substitute the transformed input, and if yy was transformed, reverse that transformation at the end.

Fitting and predicting on the transformed scale

Once the new variable is calculated (a spreadsheet column such as =B2^2 or =LOG10(C2)), treat it exactly like ordinary data and fit the least-squares line with technology. The equation is written in terms of the transformed variable, for example

y^=a+bx2,y^=a+blog⁡10x,y^=a+bx,log⁡10y^=a+bx.\hat{y} = a + b x^2, \qquad \hat{y} = a + b\log_{10} x, \qquad \hat{y} = a + \frac{b}{x}, \qquad \widehat{\log_{10} y} = a + bx.

To predict:

  1. Transform the input if xx was transformed (square it, log it or take its reciprocal).
  2. Substitute and evaluate.
  3. Back-transform if yy was transformed: y=10answery = 10^{\text{answer}} for log⁡10y\log_{10} y, y=1answery = \frac{1}{\text{answer}} for 1y\frac{1}{y}, and y=answery = \sqrt{\text{answer}} for y2y^2.

Interpolation and extrapolation work exactly as for raw data: a prediction outside the range of the original xx values is an extrapolation and is less reliable, however good the transformed fit.

Case study 1: stopping distance (squaring xx)

Speed ss (km/h) 40 50 60 70 80 90 100
Stopping distance dd (m) 19 27 36 47 59 73 88

Raw fit. d^=−30.64+1.15s\hat{d} = -30.64 + 1.15s, r=0.994r = 0.994, r2=0.988r^2 = 0.988. Residuals, in order: 3.64,0.14,−2.36,−2.86,−2.36,0.14,3.643.64, 0.14, -2.36, -2.86, -2.36, 0.14, 3.64. The pattern (positive, negative, positive) shows the association is curved, and the negative intercept makes no physical sense.

Transformed fit (s2s^2). d^=6.39+0.00820s2\hat{d} = 6.39 + 0.00820s^2, r2=0.9998r^2 = 0.9998. Residuals: −0.51,0.11,0.09,0.42,0.12,0.18,−0.41-0.51, 0.11, 0.09, 0.42, 0.12, 0.18, -0.41, small and without a clear pattern.

Residual plots before and after squaring speedTwo residual plots on the same vertical scale, residuals in metres from minus 4 to plus 4. Left panel, raw model distance against speed: residuals 3.64, 0.14, minus 2.36, minus 2.86, minus 2.36, 0.14, 3.64 for speeds 40 to 100 kilometres per hour, forming a clear U shape. Right panel, model using speed squared: residuals minus 0.51, 0.11, 0.09, 0.42, 0.12, 0.18, minus 0.41, all close to zero with no clear pattern.40-440-4speed 40 to 100 km/hspeed 40 to 100 km/hRaw model: U-shapedSquared speed: randomresidual (m) against speed, same vertical scale in both panels

The residual plot on the right has no pattern, so the squared model is appropriate. Predicting at 75 km/h: 752=562575^2 = 5625 and d^=6.39+0.00820×5625=52.515\hat{d} = 6.39 + 0.00820 \times 5625 = 52.515, about 52.5 m. This matches the physics: braking distance depends on the square of speed.

Case study 2: app users (logging yy)

Month tt 0 1 2 3 4 5 6
Users uu (thousands) 12 17 25 36 51 74 106

Each value is roughly 1.44 times the one before: growth by a constant percentage, which is geometric growth like the sequences topic. The raw line u^=0.64+15.07t\hat{u} = 0.64 + 15.07t has r=0.957r = 0.957 but residuals 11.36,1.29,−5.79,−9.86,−9.93,−2.00,14.9311.36, 1.29, -5.79, -9.86, -9.93, -2.00, 14.93, a strong U shape.

Taking log⁡10u\log_{10} u gives 1.0792,1.2304,1.3979,1.5563,1.7076,1.8692,2.02531.0792, 1.2304, 1.3979, 1.5563, 1.7076, 1.8692, 2.0253, which rise by about 0.16 each month. The least-squares line is log⁡10u^=1.078+0.158t\widehat{\log_{10} u} = 1.078 + 0.158t with r2=0.9999r^2 = 0.9999. The slope 0.158 means uu is multiplied by 100.158≈1.4410^{0.158} \approx 1.44 each month, about 44% growth per month.

Case study 3: workers and time (reciprocal of xx)

Workers ww 1 2 3 4 5 6 8
Hours hh 48 25 17 13 11 9 7

The raw line has r=−0.836r = -0.836 and a strongly patterned residual plot. Using 1w\frac{1}{w} as the explanatory variable gives h^=1.37+46.75×1w\hat{h} = 1.37 + 46.75 \times \frac{1}{w} with r2=0.9998r^2 = 0.9998. The intercept 1.37 is the time the job approaches as the team becomes very large, because 1w\frac{1}{w} approaches 0.

Worked examples: predicting from transformed models

Example 1: squared explanatory variable

A curved scatter is straightened by squaring xx, and the least-squares line is y^=4+0.5x2\hat{y} = 4 + 0.5x^2. Predict yy when x=6x = 6.

Transform the input
x2=62=36x^2 = 6^2 = 36.
Substitute
y^=4+0.5×36=4+18=22\hat{y} = 4 + 0.5 \times 36 = 4 + 18 = 22.
Back-transform
Only xx was transformed, so the equation already predicts yy. Final answer: y^=22\hat{y} = 22.

Marker's note: the most common error is substituting x=6x = 6 instead of x2=36x^2 = 36, which gives 7.

Example 2: logarithm of the response variable

Using log⁡10u^=1.078+0.158t\widehat{\log_{10} u} = 1.078 + 0.158t from case study 2, predict the number of users at t=7t = 7.

Substitute
log⁡10u^=1.078+0.158×7=1.078+1.106=2.184\widehat{\log_{10} u} = 1.078 + 0.158 \times 7 = 1.078 + 1.106 = 2.184.
Back-transform
u=102.184≈152.8u = 10^{2.184} \approx 152.8, so about 153 thousand users.
Comment
t=7t = 7 is one month beyond the data, a short extrapolation. Percentage growth rarely continues indefinitely, so longer-range predictions are unreliable.

Marker's note: leaving the answer as 2.184 answers the wrong question; the model predicts log⁡10u\log_{10} u, not uu.

Example 3: reciprocal of the explanatory variable

Using h^=1.37+46.75×1w\hat{h} = 1.37 + 46.75 \times \frac{1}{w} from case study 3, predict the time for 7 workers.

Transform the input
17≈0.142857\frac{1}{7} \approx 0.142857.
Substitute
h^=1.37+46.75×0.142857≈1.37+6.679=8.049\hat{h} = 1.37 + 46.75 \times 0.142857 \approx 1.37 + 6.679 = 8.049, about 8.0 hours.
Comment
7 workers lies inside the data range (1 to 8), so this is an interpolation and is reliable given the random residual plot.

Marker's note: keep the unrounded value of 17\frac{1}{7} in the calculator until the end to avoid rounding error.

Why transformation is extension, and what the syllabus does require

The QCAA syllabus stops at the diagnosis: you must fit a least-squares line, calculate and plot residuals, and use the residual plot to decide whether a linear model is appropriate. If the residual plot shows a pattern, the correct syllabus response is to say that a linear model is not appropriate and that predictions from it are unreliable. Transformations are the next step that statisticians take, which is why they are worth knowing for a modelling task. If you use one in IA1, explain your reasoning: show the raw residual plot, state the transformation you tried and why, show the new residual plot, and interpret the model in the original units.

Common traps
Forgetting to transform the input before predicting
With y^=4+0.5x2\hat{y} = 4 + 0.5x^2 you must square the value of xx first.
Not reversing a transformation on yy
If the response was logged, the equation predicts log⁡y\log y. Raise 10 to that power to get yy in its original units.
Trusting r2r^2 instead of the residual plot
Curved data can have r2r^2 above 0.98. The residual plot decides whether a linear model fits.
Choosing the transformation by guesswork
Use the shape of the scatter to shortlist candidates, then compare residual plots and r2r^2.
Taking logs or reciprocals of zero or negative values
Both are undefined; if the data contain zeros, these transformations cannot be used directly.
Interpreting the slope in the wrong units
In log⁡10y^=a+bx\widehat{\log_{10} y} = a + bx, the slope is the change in log⁡10y\log_{10} y per unit of xx, which means yy is multiplied by 10b10^{b} for each unit increase in xx.
Forgetting that extrapolation is still extrapolation
A near-perfect fit on transformed data does not make predictions far outside the data reliable.
Exam and IA technique

Set out every transformed prediction in three labelled lines: "transform the input", "substitute", "back-transform". In a modelling report, place the raw and transformed residual plots side by side and write one sentence comparing them, as in the figure above. Always give your final answer in the original units and context (metres, thousands of users, hours).

Note

Imagine trying to lay a straight ruler along a bent line of dots. It will not fit, however you tilt it. Transforming the data is like redrawing the graph paper so the bend disappears: you stretch or squash one of the axes (by squaring the numbers, taking their logs or flipping them upside down) until the dots line up, then lay the ruler along them. To make a prediction, you read off the ruler on the stretched paper and then convert back to ordinary numbers.

Exam-style questions

Questions in the style of QCAA exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.

Original4 marks
A curved association between yy and xx is straightened by squaring the explanatory variable. The least-squares line fitted to the transformed data is y^=12+0.8x2\hat{y} = 12 + 0.8x^2. (a) Determine the predicted value of yy when x=5x = 5. (b) State why a log⁡y\log y transformation might be chosen instead for a different data set.
Show worked answer →

A 4 mark technique question: apply the transformation, substitute, evaluate, and give the reasoning.

(a) Transform the input first: x2=52=25x^2 = 5^2 = 25. Substitute into the fitted line: y^=12+0.8×25=12+20=32\hat{y} = 12 + 0.8 \times 25 = 12 + 20 = 32. The predicted value of yy is 3232.

(b) A log⁡y\log y transformation compresses large yy values, so it straightens data that grows by a roughly constant percentage (multiplicative growth), where the values rise faster and faster. It is also useful when the spread of yy grows as yy grows. The squared transformation of xx can straighten a similar upward curve, so test both and compare the residual plots.

Markers reward squaring the input before substituting, the correct prediction, and a transformation choice tied to the shape of the data.

Original6 marks
Researchers model bacterial count NN (thousands) against time tt (hours). A log⁡10N\log_{10} N transformation straightens the scatter, and the least-squares line is log⁡10N^=0.6+0.25t\widehat{\log_{10} N} = 0.6 + 0.25t. (a) Determine the predicted count when t=8t = 8 hours, giving your answer to the nearest thousand. (b) Justify why the residual plot for the transformed data is examined before trusting this prediction.
Show worked answer →

A 6 mark extended question needing back-transformation and an interpretation.

(a) Substitute t=8t = 8: log⁡10N^=0.6+0.25×8=0.6+2=2.6\widehat{\log_{10} N} = 0.6 + 0.25 \times 8 = 0.6 + 2 = 2.6. The equation predicts log⁡10N\log_{10} N, so reverse the transformation by raising 1010 to that power: N=102.6≈398.1N = 10^{2.6} \approx 398.1. Since NN is in thousands, the count is about 398.1×1000≈398 000398.1 \times 1000 \approx 398\,000 bacteria to the nearest thousand.

(b) The residual plot for the transformed data should show random scatter about zero. If it shows a remaining pattern, the chosen transformation has not fully straightened the relationship, so predictions, especially extrapolated ones, would be biased. A random residual plot and a high r2r^2 justify trusting the linear fit on the transformed scale.

Markers reward the substitution, raising 1010 to the power to undo the log, the rounded count, and linking the residual plot to the validity of prediction.

Practice questions

Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.

foundation2 marks
A least-squares line fitted after squaring the explanatory variable is y^=3+0.2x2\hat{y} = 3 + 0.2x^2. Predict yy when x=9x = 9.
Show worked solution →

Transform the input first (1 mark): x2=92=81x^2 = 9^2 = 81.

Substitute and evaluate (1 mark): y^=3+0.2×81=3+16.2=19.2\hat{y} = 3 + 0.2 \times 81 = 3 + 16.2 = 19.2.

Marker's note: substituting x=9x = 9 directly gives 4.84.8, a common wrong answer.

foundation2 marks
For each shape of scatterplot, name one transformation that could straighten it. (a) yy increases, and increases more and more steeply as xx increases. (b) yy decreases steeply at first, then levels off towards a horizontal asymptote.
Show worked solution →

(a) The graph is increasing and curving upward. Stretch the top of xx with x2x^2, or compress the top of yy with log⁡y\log y (or 1/y1/y). (1 mark)

(b) The graph is decreasing and flattening. Compress large xx values with 1/x1/x (or log⁡x\log x), or use log⁡y\log y. (1 mark)

Marker's note: any one suitable transformation earns the mark, but you should still test it by checking the residual plot.

foundation2 marks
A least-squares line on transformed data is log⁡10y^=0.5+0.3x\widehat{\log_{10} y} = 0.5 + 0.3x. Predict yy when x=5x = 5, correct to one decimal place.
Show worked solution →

Substitute (1 mark): log⁡10y^=0.5+0.3×5=2\widehat{\log_{10} y} = 0.5 + 0.3 \times 5 = 2.

Back-transform (1 mark): y=102=100y = 10^{2} = 100, so y^=100.0\hat{y} = 100.0.

Marker's note: the equation predicts log⁡10y\log_{10} y, not yy. Stopping at 2 loses the second mark.

core3 marks
The time hh hours for a team of ww workers to finish a job is modelled with a reciprocal transformation: h^=1.37+46.75×1w\hat{h} = 1.37 + 46.75 \times \dfrac{1}{w}. (a) Predict the time for 10 workers. (b) Interpret the value 1.37 in context. (c) Explain why this prediction is an extrapolation if the data used ww from 1 to 8.
Show worked solution →

(a) 110=0.1\frac{1}{10} = 0.1, so h^=1.37+46.75×0.1=1.37+4.675=6.045\hat{h} = 1.37 + 46.75 \times 0.1 = 1.37 + 4.675 = 6.045, about 6.06.0 hours. (1 mark)

(b) As ww becomes very large, 1w\frac{1}{w} approaches 0, so 1.37 hours is the time the model says the job approaches however many workers are added (a lower limit, the part of the job that cannot be shared). (1 mark)

(c) 10 workers lies outside the range of the data (1 to 8 workers), so the prediction relies on the pattern continuing beyond what was observed. (1 mark)

core4 marks
Stopping distance dd (m) against speed ss (km/h) gives the raw least-squares line d^=−30.64+1.15s\hat{d} = -30.64 + 1.15s with r2=0.988r^2 = 0.988, and a residual plot that is clearly U-shaped. After squaring the speed, d^=6.39+0.00820s2\hat{d} = 6.39 + 0.00820s^2 with r2=0.9998r^2 = 0.9998 and randomly scattered residuals. (a) Which model is more appropriate? Justify. (b) Use it to predict the stopping distance at 75 km/h, to one decimal place.
Show worked solution →

(a) The squared model (1 mark). The raw model's residual plot shows a U-shaped pattern, so a straight line is not appropriate for the raw data even though r2r^2 is high. The transformed model has random residuals and a higher r2r^2 (0.9998 against 0.988). (1 mark)

(b) s2=752=5625s^2 = 75^2 = 5625 (1 mark). d^=6.39+0.00820×5625=6.39+46.125=52.515\hat{d} = 6.39 + 0.00820 \times 5625 = 6.39 + 46.125 = 52.515, about 52.552.5 m. (1 mark)

core3 marks
A model is fitted with y2y^2 as the response: y2^=4+2.5x\widehat{y^2} = 4 + 2.5x. Predict yy when x=10x = 10, correct to two decimal places, given yy is positive.
Show worked solution →

Substitute (1 mark): y2^=4+2.5×10=29\widehat{y^2} = 4 + 2.5 \times 10 = 29.

Back-transform (1 mark): take the positive square root, y^=29\hat{y} = \sqrt{29}.

Evaluate (1 mark): y^≈5.39\hat{y} \approx 5.39.

exam5 marks
The number of users uu (thousands) of an app tt months after launch was: t=0,1,2,3,4,5,6t = 0, 1, 2, 3, 4, 5, 6 and u=12,17,25,36,51,74,106u = 12, 17, 25, 36, 51, 74, 106. A least-squares line of uu on tt gives u^=0.64+15.07t\hat{u} = 0.64 + 15.07t (r=0.957r = 0.957) with residuals 11.36,1.29,−5.79,−9.86,−9.93,−2.00,14.9311.36, 1.29, -5.79, -9.86, -9.93, -2.00, 14.93. A least-squares line of log⁡10u\log_{10} u on tt gives log⁡10u^=1.078+0.158t\widehat{\log_{10} u} = 1.078 + 0.158t (r2=0.9999r^2 = 0.9999) with residuals all within 0.0060.006 of zero and no pattern. (a) Describe the residual plot for the raw model and state what it shows. (b) Use the log model to predict the number of users at t=7t = 7. (c) Explain why the prediction in (b) should be treated with caution.
Show worked solution →

(a) The raw residuals are positive, then negative, then positive again (a U shape), so the association is non-linear and the raw linear model is not appropriate. (2 marks: pattern described, conclusion)

(b) log⁡10u^=1.078+0.158×7=1.078+1.106=2.184\widehat{\log_{10} u} = 1.078 + 0.158 \times 7 = 1.078 + 1.106 = 2.184 (1 mark). Back-transform: u=102.184≈152.8u = 10^{2.184} \approx 152.8, so about 153 thousand users (1 mark).

(c) t=7t = 7 is outside the data (tt from 0 to 6), so it is an extrapolation. It assumes growth by the same percentage each month continues, which rarely lasts: the market eventually saturates. (1 mark)

exam4 marks
A student fits y^=5+12log⁡10x\hat{y} = 5 + 12\log_{10} x to curved data that increases at a decreasing rate. (a) Predict yy when x=100x = 100 and when x=50x = 50 (to two decimal places). (b) The student says "doubling xx from 50 to 100 doubles the increase in yy". Evaluate this claim using your answers.
Show worked solution →

(a) x=100x = 100: log⁡10100=2\log_{10} 100 = 2, so y^=5+24=29\hat{y} = 5 + 24 = 29 (1 mark). x=50x = 50: log⁡1050≈1.69897\log_{10} 50 \approx 1.69897, so y^=5+12×1.69897≈25.39\hat{y} = 5 + 12 \times 1.69897 \approx 25.39 (1 mark).

(b) Doubling xx from 50 to 100 increases y^\hat{y} by only 29−25.39=3.6129 - 25.39 = 3.61. In a log model, every doubling of xx adds the same amount, 12log⁡102≈3.6112\log_{10} 2 \approx 3.61, so equal multiplications of xx give equal additions to yy. The claim is wrong (2 marks: calculation of the increase, correct reasoning).

Practise this

Sources & how we know this

ExamExplained