Why Use a Family of Transformations?
A logarithm, square root, and reciprocal are different transformations, but each belongs to a broader family indexed by a power. The Box–Cox family makes that connection explicit. Instead of deciding only among a few familiar options, an analyst can estimate which power is most compatible with a specified regression model, then use that result as a guide when choosing a transformation.
That guidance has limits. A fitted power describes which transformation works best under the model and data being considered. It does not establish that a particular physical, biological, or social mechanism generated the observations. The transformation must still be assessed in context and alongside the assumptions of the regression analysis.
How the Power Connects to Familiar Transformations
Several familiar transformations arise directly, or up to a change of scale and shift, from particular values of \(\lambda\). Such changes matter when interpreting transformed values, but a constant shift or nonzero multiplication does not change the basic shape of the transformation.
| Power \(\lambda\) | Box–Cox transformation | Connection |
|---|---|---|
| 1 | \(y-1\) | A shifted version of the untransformed value \(y\) |
| 0.5 | \(2(\sqrt{y}-1)\) | A shifted and rescaled square root |
| 0 | \(\log(y)\) | The logarithm |
| -1 | \(1-y^{-1}\) | A shifted version of the negative reciprocal |
The minus one and division by \(\lambda\) in the definition are part of a useful standard convention: as \(\lambda\) tends to zero, the formula approaches the logarithm smoothly. They also mean that, for nonzero \(\lambda\), \(g_\lambda(y)\) is not simply \(y^\lambda\). When reporting a transformation, give the Box–Cox formula or its power rather than silently replacing it with a different expression.
Worked Example: Calculating Several Box–Cox Values
For the hypothetical positive measurement \(y=4\), calculate the transformation for \(\lambda=0.28\), and compare it with three familiar powers.
For \(\lambda=0.28\), substitute into the nonzero-power formula:
Rounded to four significant figures, the transformed value is \(1.694\). For comparison, at \(\lambda=0.5\), \(g_{0.5}(4)=(\sqrt{4}-1)/0.5=2\). At \(\lambda=0\), \(g_0(4)=\log(4)\approx1.386\). At \(\lambda=1\), \(g_1(4)=4-1=3\). These are different transformed values because they use different scales; their purpose here is to show how the power changes the mapping of the same positive observation.
Choosing a Power in a Regression Model
A common use of Box–Cox is to select a transformation for a positive outcome in a regression model. Let \(Y_i>0\) be the outcome for observation \(i\), and let \(\mathbf{x}_i\) denote that observation’s predictors. For each candidate \(\lambda\), fit the regression of \(g_\lambda(Y_i)\) on the same predictors. A standard likelihood-based choice assumes that, for a given \(\lambda\), the transformed outcome follows a linear regression model with independent, normally distributed errors having mean zero and a common variance:
Here the errors are assumed independent across observations, and the same regression terms are used for every candidate power. The normality and equal-variance assumptions concern the errors around the transformed-outcome mean, not the untransformed values themselves. The observations used must all have strictly positive outcomes; a zero or negative outcome cannot be transformed by this Box–Cox definition.
For each \(\lambda\), ordinary least squares gives a residual sum of squares \(RSS_\lambda\) on the transformed scale. The likelihood for the original observations must also account for how the transformation changes the scale of the data. For \(\lambda\ne0\), the derivative is \(g'_\lambda(y)=y^{\lambda-1}\); at \(\lambda=0\), the derivative of \(\log(y)\) is \(1/y\), which is the same expression with \(\lambda=0\). Thus, transforming a density back to the original outcome scale contributes \((\lambda-1)\sum_i\log(Y_i)\) to the log-likelihood.
After maximizing over the regression coefficients and error variance for each power, the profile log-likelihood, up to a constant that does not depend on \(\lambda\), is:
The fitted Box–Cox parameter \(\hat{\lambda}\) is the value that maximizes this profile log-likelihood over the powers considered. The Jacobian term is essential: simply choosing the power with the smallest transformed-scale residual sum of squares does not, by itself, compare likelihoods on the original outcome scale.
Worked Example: Reading a Fitted Power
Suppose a hypothetical analysis has 48 strictly positive outcomes and the same predictor terms are fitted for each candidate power. The analyst checks that observations are independent by design and finds no strong pattern in residual-versus-fitted plots; normal probability plots show no severe departure from approximate normality. These checks do not prove the assumptions, but they make the likelihood comparison more defensible. The reported profile log-likelihood values, with the maximum set to zero, are:
| \(\lambda\) | Relative profile log-likelihood |
|---|---|
| 0 | -2.40 |
| 0.25 | -0.30 |
| 0.28 | 0.00 |
| 0.50 | -0.50 |
| 1 | -3.00 |
The largest value is at \(\hat{\lambda}=0.28\), so \(0.28\) is the likelihood-based fitted power in this analysis. The log-likelihood difference between \(0.28\) and the square-root power \(0.50\) is \(0.50\). Their profile likelihood ratio is therefore
Thus, at these reported values, the profile likelihood at \(0.50\) is about 61% of its maximum. This ratio is not the probability that \(\lambda=0.50\) is correct, nor is it a probability that one transformation is scientifically true. It indicates that the square-root option is not overwhelmingly separated from the maximizing power by this comparison. The analyst could examine the profile more fully and assess whether a simpler familiar power is adequate, while checking the resulting model.
The estimate \(0.28\) does not establish that the scientific relationship has a power exponent of \(0.28\). It only identifies the best-fitting power for this outcome, these predictor terms, this data set, and these model assumptions. Changing the predictors or the observations could change the fitted value.
A Transformation Does Not Supply a Scientific Model
The Box–Cox parameter concerns the scale on which the regression model is fitted. Selecting a transformed outcome does not by itself specify why the outcome changes with a predictor, establish causation, or guarantee that the model will predict well. Scientific knowledge can motivate a particular form; a likelihood-based power search can instead serve as a diagnostic or exploratory aid. These are related but distinct ways of choosing a transformation.
In practice, an analyst should inspect the fitted model and ask whether the transformation improves the assumptions and serves the analysis. The outcome and predictors must be described clearly, and predictions or coefficients may require careful interpretation on the original scale. Transformation choice should not be reduced to selecting the numerically largest or most complicated optimization result without considering model adequacy and scientific meaning.
Worked Example: Recognizing the Positive-Value Requirement
Consider three hypothetical instrument readings, \(1\), \(4\), and \(9\), in the stated measurement units. They are all strictly positive, so the square-root Box–Cox transformation is defined for each:
If another recorded value were \(0\), the expression \(0^\lambda\) may be defined for some positive powers, but the Box–Cox family specified here requires strictly positive values, and the likelihood formula involving \(\log(Y_i)\) would also fail at zero. A negative value is likewise outside this family. The analyst should not insert such observations into the stated Box–Cox procedure by treating them as if they were positive; a different approach is needed when the data include zeros or negative values.
This example is only a calculation of transformed values, not a regression fit, so regression error assumptions are not being used. In an actual outcome-model analysis, the observations and residuals would need to be assessed under the regression assumptions before relying on a fitted power.
Common Mistakes and a Practical Workflow
- Using the nonzero formula at \(\lambda=0\). Direct substitution divides by zero. Use the defined limit \(g_0(y)=\log(y)\).
- Calling \(\hat{\lambda}\) a discovered scientific exponent. It is the maximizing transformation parameter conditional on the specified model, data, and assumptions; it does not identify a mechanism.
- Ignoring the likelihood’s scale adjustment. Comparing only transformed-scale residual sums of squares omits the Jacobian contribution in the profile likelihood.
- Applying the family to zero or negative observations. The Box–Cox definition here is for strictly positive values; do not proceed as though nonpositive observations satisfy that requirement.
- Assuming the fitted power must be used exactly. A fitted value guides a choice. A nearby familiar transformation may be easier to communicate, but its adequacy should be checked rather than presumed.
A practical sequence is to verify positivity, specify the regression terms and assumptions, fit the model over candidate powers, inspect the profile likelihood and regression diagnostics, and then decide whether the fitted power or a simpler nearby option is appropriate. Keep the distinction clear between what the computation optimizes and what the scientific context supports.
Check Your Understanding
Try these questions without looking back.
- Write the Box–Cox transformation at \(\lambda=0\), and explain why the nonzero-power expression cannot be substituted directly at zero.
- For \(y=9\), calculate \(g_{0.5}(y)\). How does it relate to the square root of \(y\)?
- Why does the profile log-likelihood for a transformed outcome include a term involving \(\sum_i\log(Y_i)\)?
- If a fitted value is \(\hat{\lambda}=0.28\), what does that say about the analysis, and what does it not establish about the scientific mechanism?
- Why is the stated Box–Cox likelihood procedure not directly applicable when one of the observed outcomes is zero?