Departures from Linearity and Transformations
When a scatterplot curves instead of running straight, a log transformation can straighten it so least-squares regression applies again; you then back-transform predictions to return to the original units.
A straight-line model only makes sense if the data actually follow a straight line. Residual plots are the giveaway: if they show a clear curve instead of random scatter, the linear model missed something systematic. A common culprit is exponential growth or decay, where y changes by a constant percentage rather than a constant amount for each step in x. Plotted raw, that produces a curve that bends sharply. Taking the logarithm of y compresses the fast-growing values and stretches the small ones, turning multiplicative growth into additive growth, which is exactly what a straight line describes.
To transform exponential data, compute log(y) for every point, then fit the least-squares line to x and log(y) instead of x and y. The fitted equation looks like log(y) = a + bx. To predict an actual y-value, plug in x, get log(y), then back-transform by raising 10 to that power (or using e if natural log was used): y = 10a+bx. Skipping this last step and reporting log(y) as if it were y is the single most common error here.
This topic is the payoff of everything else in the regression unit: scatterplots and residuals diagnose the problem, and transformation is the fix. After transforming, you still check the new residual plot for randomness, still interpret slope and intercept, but now in log-scale units. It connects forward to any situation where growth or decay data needs a model that captures percentage change rather than constant change.
Key terms
- transformation
- Applying a function like log to one or both variables to make a curved relationship linear.
- back-transform
- Reversing the transformation, such as raising 10 to a power, to convert a prediction back to original units.
- residual plot
- A graph of residuals versus x used to check whether a linear model fits well or shows leftover curvature.
- exponential growth model
- A model of the form y = a times bx, where y changes by a constant percentage for each unit increase in x.
Watch it explained
Check yourself
End of topic.