Why Back-Transformation Needs Care
A regression model for a logarithm of the response can be useful when the relationship is more nearly linear on the log scale than on the original scale. But a fitted value on the log scale is not yet a prediction in the response's original units. Exponentiating converts the scale; it does not automatically answer every prediction question. In particular, the exponentiated fitted value and the arithmetic mean response at a given predictor value are generally different.
The distinction matters whenever a prediction is used as an expected number of events, an expected cost, or another arithmetic average. It also matters for intervals: exponentiating their endpoints is a valid scale conversion, but the resulting interval concerns the parameter or outcome represented by the original interval, not a different target.
The Log-Response Model and Direct Conversion
Suppose the response \(Y\) is positive and a model is fitted to its natural logarithm. At predictor value \(x\), write the model as
where \(\eta(x)\) is the fitted systematic part on the log scale and \(\varepsilon\) is the error on that scale. Assume the model is appropriate for the predictor range being used and that the errors have conditional mean zero, \(E(\varepsilon\mid x)=0\). A fitted log-scale value is denoted \(\hat{\eta}(x)\).
The geometric mean is obtained by averaging logarithms and then exponentiating. If \(E(\ln Y\mid x)=\eta(x)\), the conditional geometric mean is \(\exp(\eta(x))\). If the conditional distribution of \(\ln Y\) is normal, its mean and median coincide, so \(\exp(\eta(x))\) is also the conditional median of \(Y\). The arithmetic mean, \(E(Y\mid x)\), averages values on the original scale and is more affected by large responses.
These interpretations depend on the model and its assumptions. In particular, the median interpretation requires the conditional median error on the log scale to be zero; the normal-error model ensures this. The geometric-mean interpretation follows from the conditional mean of \(\ln Y\) being \(\eta(x)\). To interpret a transformed fitted value as an arithmetic mean requires an additional correction.
Worked Example: Converting a Fitted Value and Interval
Suppose a hypothetical fitted model gives \(\hat{\eta}(10)=2.00\), where \(Y\) is measured in response units. A 95% confidence interval for the model's conditional mean log response at \(x=10\) is \([1.75,2.25]\). Assume the log-response model is appropriate and its conditional errors are normal with mean zero.
The direct back-transformation of the fitted value is
Under the stated normal-error assumption, this is the estimated conditional median and geometric mean response: about 7.389 response units. It is not yet the estimated conditional arithmetic mean.
Because exponentiation is increasing, exponentiate each endpoint of the log-scale confidence interval:
This is a 95% confidence interval for the exponentiated conditional mean log response, which is the conditional geometric mean and, under normal errors, the conditional median. It is not automatically a 95% confidence interval for the arithmetic mean response.
When the Arithmetic Mean Is the Target
To see why a correction is needed, start from the model and exponentiate both sides: \(Y=\exp(\eta(x))\exp(\varepsilon)\). Taking a conditional expectation gives
The extra factor \(E\{\exp(\varepsilon)\mid x\}\) is generally greater than one when the error has mean zero and is variable. This follows from the convexity of the exponential function: averaging exponentials does not generally equal exponentiating the average. Thus \(\exp(\hat{\eta}(x))\) will tend to be below the arithmetic mean when used as though it were an arithmetic-mean prediction.
A common model-based correction assumes that the conditional log-scale errors are normal with constant variance \(\sigma^2\), so that \(\varepsilon\mid x\sim N(0,\sigma^2)\). For a normal variable, \(E\{\exp(\varepsilon)\mid x\}=\exp(\sigma^2/2)\). The arithmetic-mean prediction is then
where \(\hat{\sigma}^{\,2}\) estimates the conditional variance on the log scale. The correction is not optional if the target is the arithmetic mean and the normal log-error model is being used. Its size grows with the log-scale error variance.
Worked Example: Applying the Log-Normal Mean Correction
Suppose a hypothetical model gives \(\hat{\eta}(x)=2.00\), and the estimated standard deviation of its normal log-scale errors is \(\hat{\sigma}=0.30\). Assume errors have mean zero, are conditionally normal, and have the same variance at this predictor value.
The direct back-transformation is \(\exp(2.00)=7.389\) response units. This estimates the conditional median and geometric mean. For the arithmetic mean, first square the estimated standard deviation: \(\hat{\sigma}^{\,2}=0.30^2=0.09\). The corrected prediction is
The estimated conditional arithmetic mean is therefore about 7.729 response units, larger than the estimated median of 7.389. The difference results from variability in the log-scale errors, not from a change in the fitted value \(\hat{\eta}(x)\).
Smearing When Normal Errors Are Not Assumed
The normal correction uses a specific error distribution. An alternative is to estimate the factor \(E\{\exp(\varepsilon)\mid x\}\) from residuals. For fitted log-response residuals \(e_i=\ln(y_i)-\hat{\eta}(x_i)\), a basic smearing estimate is the average of their exponentials:
The resulting arithmetic-mean prediction is \(\exp(\hat{\eta}(x))\hat{S}\). This method does not require normally distributed errors. It does require the observed residuals to represent the conditional log-error distribution relevant to the prediction. In particular, a single pooled factor is most defensible when that distribution is approximately stable across predictor values. If the variability or shape of the errors changes with \(x\), one pooled factor may not estimate the needed conditional factor well.
Worked Example: Estimating a Smearing Factor
In a hypothetical training data set, four fitted residuals on the log scale are \(-0.20\), \(0.00\), \(0.10\), and \(0.30\). For a new case, suppose the fitted log-scale value is \(\hat{\eta}(x)=1.20\). Assume these residuals are reasonably representative of the conditional error distribution for the new case.
Calculate the smearing factor using the unrounded exponentials:
The direct back-transformation is \(\exp(1.20)=3.320\) response units. Applying the estimated smearing correction gives
Thus the estimated arithmetic mean is about 3.547 response units under the representativeness assumption, while 3.320 response units is the direct back-transformation. The four residuals are only a small illustration: with so few residuals, the smearing factor may be imprecise.
Back-Transforming Intervals
An interval's endpoints can be exponentiated because the exponential function preserves order. What the transformed interval means depends on what the original interval was constructed to cover.
- Confidence interval for a fitted log-scale location: Exponentiating both endpoints gives an interval for the exponentiated location, such as the conditional geometric mean. Under normal log-scale errors, it is also an interval for the conditional median.
- Prediction interval for an individual log response: If the prediction interval is valid under the log-scale model, exponentiating both endpoints gives a prediction interval for an individual response on the original scale. It remains asymmetric in general, and its coverage is preserved by the one-to-one transformation.
- Interval for an arithmetic mean: A confidence interval for the log-scale location is not automatically an interval for the arithmetic mean. The mean includes a variance or smearing factor, and uncertainty in that factor may also need to be included in the interval procedure.
For example, if a log-scale prediction interval is \([1.40,2.60]\), its response-scale version is \([\exp(1.40),\exp(2.60)]=[4.055,13.464]\) response units. It predicts an individual response, not the conditional average response. An interval for the fitted location and a prediction interval for an individual outcome have different purposes and usually different widths.
Why the Distinction Matters
The target should determine the back-transformation. A geometric mean or median describes a typical location in a multiplicative distribution. An arithmetic mean is appropriate when the question concerns the average total response per individual, such as expected use, cost, or count of a positive outcome. Reporting one as the other can materially understate an average, especially when log-scale variability is substantial.
Decide whether the question asks for a conditional median or geometric mean, an arithmetic mean, or an individual outcome.
Exponentiate the fitted log-scale value or both interval endpoints, preserving the meaning of the original scale-scale quantity.
Use a log-normal correction when normal, constant-variance log errors are justified, or a suitable smearing factor when its representativeness assumptions are reasonable.
A common mistake is to say, “The fitted log value is 2, so the predicted average response is \(\exp(2)\).” The reasoning overlooks the factor \(E\{\exp(\varepsilon)\mid x\}\). The correction is to state the target precisely: \(\exp(2)\) is the exponentiated log-scale location, and under normal errors it estimates the median and geometric mean; an arithmetic-mean prediction also accounts for log-scale error variation.
Check Your Understanding
Answer each question by identifying the target and stating any assumption needed.
- A fitted log-scale value is 1.50. What quantity does \(\exp(1.50)\) estimate under a normal, mean-zero log-error model?
- Why is exponentiating a confidence interval for the mean log response not automatically a confidence interval for the arithmetic mean response?
- A log-normal model has estimated log-scale error standard deviation \(0.40\). Write the correction factor for an arithmetic-mean prediction.
- What assumptions make one pooled smearing factor plausible for predictions across predictor values?
- A log-scale prediction interval is \([0.5,1.5]\). What operation returns its endpoints to the response scale, and what does the resulting interval predict?