Written and maintained by CASRAI Editorial Board
Last updated
A data transformation applies a mathematical function — most often the logarithm, but also the square root, the reciprocal, or a data-driven family like Box-Cox — to every value of a variable before analysis. Researchers reach for a transformation when raw data is right-skewed, when variance changes systematically across the range of the data, or when a parametric test’s normality assumption is not met. The choice is not free: a transformation changes the scale on which results are interpreted, and often changes what hypothesis is actually being tested. This guide covers why transformations are used, the common types, the interpretation cost of working on a transformed scale, the zero/negative-value problem that trips up log transformations specifically, and when not to transform at all.
Why researchers transform data
Three overlapping problems motivate a transformation, and it helps to keep them separate because the fix for one is not automatically the fix for another.
- Correcting right-skew. Many real variables — income, reaction times, gene expression counts, viral load, time-to-event data — are bounded at zero and can extend far to the right, producing a long right tail. See skewness: left-skewed vs. right-skewed distributions for how to recognize and quantify this. A transformation that compresses large values more than small ones can pull a skewed distribution closer to symmetric.
- Stabilizing variance (homoscedasticity). Parametric tests such as the t-test, ANOVA, and linear regression assume the spread of the outcome does not systematically change with its level or with the predictors — see how to read a residual plot for homoscedasticity. When variance grows with the mean, as it often does for counts, rates, and monetary amounts, an untransformed analysis understates uncertainty at the high end and overstates it at the low end. A variance-stabilizing transformation is chosen specifically to flatten that relationship, which is a distinct goal from correcting skew, even though the same transformation often does both.
- Meeting the normality assumption of a parametric test. Classical parametric tests assume normally distributed residuals (not necessarily a normally distributed raw outcome — see normality of distribution for that distinction). Transforming the outcome before fitting the model is one way to bring the residuals closer to normal; it is not the only way, and section 5 below covers when a different fix is more honest than forcing this one.
The common transformations
These sit on what is informally called a “ladder of powers” — each one pulls large values in more aggressively than the last.
- Log transformation (natural log, or log base 10). Compresses right-skewed, strictly positive data whose spread grows roughly in proportion to its level — the classic case for income, drug concentrations, population counts, and other quantities that behave multiplicatively rather than additively. It is the most commonly used transformation because that multiplicative pattern is common and because, as covered below, its results have a specific, well-defined interpretation once back-transformed.
- Square root transformation. A milder pull than the log, often used for count data where variance is roughly proportional to the mean (the Poisson-like pattern — see Poisson distribution). It handles zero values without modification, which the plain log does not.
- Reciprocal transformation (1/x). A stronger pull than the log, appropriate for ratios and rates with severe skew, but it also reverses the order of values (large x becomes small 1/x), which makes result interpretation less intuitive and is worth weighing before using it.
- Box-Cox transformation. Rather than picking a transformation by eye, the Box-Cox family (introduced by George Box and David Cox in “An Analysis of Transformations,” Journal of the Royal Statistical Society: Series B, 1964) estimates a single power parameter, lambda, that best normalizes the data and stabilizes its variance simultaneously, chosen by maximum likelihood. The log transformation is the special case lambda = 0; the reciprocal is lambda = −1; no transformation at all is lambda = 1. Box-Cox is data-driven rather than guessed, but it still requires strictly positive data, and the coefficient-interpretation cost below still applies to whatever transformation it selects. The Yeo-Johnson extension modifies the method to also accept zero and negative values.
The interpretation cost: what a log-transformed coefficient actually means
This is the part most often mishandled. Fitting a model on a log-transformed outcome does not produce results in the original units — it produces results on the log scale, and a coefficient there does not mean what the same coefficient would mean in an untransformed model.
In a model where only the outcome is logged (log-linear), a coefficient of b on a predictor means that a one-unit increase in that predictor is associated with a (eb − 1) × 100% change in the outcome — a multiplicative, percentage effect, not an additive, original-units effect. For small b this is approximately b × 100%, but that approximation breaks down as b grows, which is a common source of misstated effect sizes in results sections. In a log-log model (both outcome and predictor logged), the coefficient is an elasticity: the percentage change in the outcome per 1% change in the predictor, read directly without exponentiating.
Reporting a coefficient from a log-transformed model as if it were in the original units of the outcome is a real and common error. Back-transformation itself has a further subtlety: exponentiating a predicted mean on the log scale does not recover the arithmetic mean on the original scale — it recovers something closer to the geometric mean, because of Jensen’s inequality (the expectation of a nonlinear function is not the function of the expectation). Naively exponentiated predictions from a log-linear model are systematically biased low as an estimate of the arithmetic mean; retransformation methods such as Duan’s smearing estimator exist specifically to correct for this when the original-scale mean, not the median, is the actual quantity of interest.
The zero/negative-value problem
The log of zero is undefined, and the log of a negative number is undefined in the real numbers, which is a genuine obstacle for any variable that legitimately contains zeros — zero spending, zero citations, zero adverse events in a given period.
The common workaround is log(x + 1), sometimes written log1p, which shifts every value up by one before logging so that zero maps to log(1) = 0. It is convenient, but it is not a neutral fix: the added constant is arbitrary, it distorts the transformation disproportionately for small values close to zero (where the shift is large relative to the value itself), and different choices of added constant can materially change estimated effect sizes for a variable that has many near-zero observations, which is a real risk when zeros are common rather than rare. An increasingly used alternative is the inverse hyperbolic sine (asinh) transformation, which behaves almost identically to the log for large values but is defined at zero and for negative values without needing an arbitrary shift constant.
Whichever workaround is used, it belongs in the methods section explicitly — silently logging x + 1 without saying so, and without checking how many observations are actually zero, is easy to do and easy for a reviewer to catch.
When not to transform
A transformation is not a free way to make a parametric test’s assumptions come true. It changes what is actually being tested: a t-test on log-transformed data is closer to a test of the geometric mean (or, informally, the median) than of the arithmetic mean, and that shift matters if the arithmetic mean is what the research question or the audience actually cares about — total cost, total emissions, total drug exposure, and similar summed quantities are usually about the arithmetic mean specifically, and a result reported on the log scale can quietly answer a different question than the one that was asked.
Two more honest alternatives are worth considering before transforming:
- A non-parametric test, which makes no distributional assumption about the outcome at all and works directly on the original scale — see parametric vs. non-parametric tests: how to choose, and worked examples in the Mann-Whitney U test and the Wilcoxon signed-rank test.
- A generalized linear model (GLM) with an appropriate link function, which models the outcome on its natural scale while still handling non-normal variance directly — Poisson or negative binomial regression for count data (see Poisson and negative binomial regression), or gamma regression for skewed, strictly positive continuous data. A GLM’s coefficients still require the same care in interpretation as a transformed linear model’s do — they are on the link function’s scale, not automatically the original units — but the model is built for the outcome’s actual distribution rather than retrofitting normality onto it.
The practical rule: transform when the goal is genuinely to satisfy a parametric test’s assumptions and the resulting percentage/multiplicative interpretation is acceptable for the research question; reach for a non-parametric test or an appropriately specified GLM when the original scale itself is what needs to be reported, or when the sample has enough zeros or negative values that no transformation handles cleanly. See regression analysis: assumptions, interpretation, and how to report it for how these choices fit into a full modeling write-up, and the research methods hub for the surrounding topics in quantitative analysis.
Does log-transforming my data make it normal?
Not automatically. A log transformation corrects right-skew and can stabilize variance, both of which often move a distribution closer to normal, but neither is a guarantee. Check the transformed variable (or, for a regression model, the transformed model’s residuals) with the same diagnostics used on untransformed data — see normality of distribution and skewness — rather than assuming the transformation did its job.
How do I explain a log-transformed coefficient in plain terms?
For a log-linear model, exponentiate the coefficient, subtract 1, and multiply by 100 to get the approximate percentage change in the outcome per one-unit increase in the predictor: (eb − 1) × 100%. State it as a percentage or multiplicative effect explicitly — never present it as if it were measured in the outcome’s original units.
What should I do when my data has zeros?
The common fix is log(x + 1), but report that you used it and how many observations were actually zero, since the added constant distorts results more when zeros are common. The inverse hyperbolic sine transformation is a defensible alternative that avoids the arbitrary constant. If zeros make up a large share of the data, a GLM built for that pattern (e.g., a hurdle or zero-inflated count model) is often a more honest fit than any transformation.
Is Box-Cox better than picking log or square root myself?
It removes the guesswork by estimating the power parameter that best normalizes the data and stabilizes variance simultaneously, and it includes log and reciprocal as special cases. It does not remove the interpretation cost, however — a Box-Cox-transformed coefficient still needs to be back-transformed and explained on whatever scale lambda selects, and standard Box-Cox still requires strictly positive data (use the Yeo-Johnson extension if the variable contains zeros or negative values).
Should I transform back to the original scale before running the test?
No — the test itself runs on the transformed scale, because that is what satisfies the assumption the transformation was chosen to address. Back-transformation belongs in reporting and interpretation afterward, not in the test itself, and even then needs the correction described above (e.g., Duan’s smearing estimator) if the arithmetic-scale mean, rather than the median or geometric mean, is the quantity being reported.
Related reading: Regression analysis — assumptions, interpretation, and how to report a full regression model, including the residual normality and homoscedasticity assumptions a transformation is often used to address.
See also: Parametric vs. non-parametric tests — how to choose between transforming data to fit a parametric test and switching to a test that makes no distributional assumption at all.








