What is a Logarithmic Transformation?
A logarithmic transformation, or log transform, applies the natural log (ln) to a variable in your dataset. It changes the scale of the data by compressing large values more than small ones.
For example, suppose a data point has a value of 100. If you apply the natural log, you get:
![]()
It’s this transformed value, 4.605, that the analysis uses. The transformation compresses the scale, especially for large values, helping reduce skew and stabilize variation.
Analysts often use logarithmic transformation in linear regression as a last resort when residuals violate key assumptions, such as homoscedasticity or normality. Before transforming a variable, it’s often better to consider more advanced, flexible methods that can address these issues directly, such as generalized linear models or models with non-constant variance structures. However, when those approaches are inadequate or fail to resolve the problem, a log transformation can help by reducing skew, stabilizing variance, or linearizing relationships. It’s especially useful when the effect of a predictor diminishes as its value increases.
Consider log-transforming the dependent variable (outcome) when it’s skewed or when you’re modeling percent changes rather than absolute ones. Log-transforming an independent variable (predictor) is helpful when you expect diminishing effects. Those are cases where the first few units matter more than later ones. In some models, logging both variables improves linearity or makes coefficients easier to interpret on a relative scale. However, you should only apply log transformations to variables with strictly positive values.
Learn more about Independent vs. Dependent Variables.
Interpreting Log Transformations
While it has its advantages, a logarithmic transformation changes how you interpret the results. In regression, when a variable has been logged, coefficients no longer reflect simple unit changes. The interpretation depends on which variable you transform:
- Outcome: The coefficients indicate percent changes in the outcome for a one-unit increase in the predictor.
- Predictor: The coefficient shows the change in the outcome (in natural units) for a proportional increase (e.g., 1% or 10%) in that predictor.
Additionally, if you use the model to predict values, you must back-transform the predicted values to return to the original scale.
Example
For example, a model predicting income might use the natural log of income as the outcome because income tends to be right-skewed. If the coefficient for education is 0.08, then each additional year of education corresponds to roughly an 8% increase in income.
« Back to Glossary Index