Transformations in regression
Taking logs (or other transformations) of y or x can straighten curved relationships and stabilise variance, and changes how coefficients are read.
- slope on the log scale; for small |b₁|, 100·b₁ % is a good approximation
- multiplicative effect on (the median of) y
- change in y when x is multiplied by e (≈ 2.718)
- elasticity
When to use
- Right-skewed positive responses (prices, incomes, counts of sales), growth processes, residual funnels that widen with the fitted value, or curved scatter plots.
- Logs need strictly positive values.
How to interpret
- Log y: effects are multiplicative (percentages). Back-transforming a prediction, , estimates the median of y (not the mean) when log-errors are symmetric.
- Choose the transformation from the residual plot and subject knowledge, then re-check the residuals.
Common mistakes
- Reading a log-scale slope as a change in units of y.
- Comparing between a model for y and a model for ln y — they explain different quantities.
- Using 100·b as the percentage when b is large (b = 0.5 means +65%, not +50%).
- Adding an arbitrary constant before logging zeros without saying so.
Example
y = 10, 12, 15, 18, 22, 27 at x = 0…5. A straight line leaves U-shaped residuals; regressing ln y on x gives (, residuals patternless).
- Each step in x multiplies y by : a 22.0% increase (the 100·b shortcut says 19.9%).
- Predicted y at x = 0: .