Obtaining an estimator for z given an estimator for log z

As per gung's advice in Getting the equation from R's lm when using a product, I am starting a new thread for this question.

I have a model $\widehat{\log z} = a + bx + cy + dxy$ for random variables $x,y,z$ and coefficients $a,b,c,d$.

I now want a model for $z$ instead of $\log z$. I was going to simply do $\hat{z} = \exp(a + bx + cy + dxy)$ but I have been cautioned against this. Why is this incorrect, and what is the correct way to proceed (if there is one)?

• Alternatively, you could use a GLM with a log-link and gaussian errors. Relevant posts include this and this one and this. – COOLSerdash Jul 10 '14 at 21:13
• I answered this question in the first half of my answer here: stats.stackexchange.com/questions/55692/… – Bill Jul 10 '14 at 21:39
• @Bill, the crucial equation in your answer, $\hat{Y}_i = \exp(\widehat{\ln{Y}}_i) \cdot \frac{1}{N}\sum \exp(e_i)$, is confusing because of the double appearance of "$i$" and the ambiguous summation shorthand (in which no index is explicitly named). Could you edit that answer to clarify this? – whuber Jul 10 '14 at 22:20

I don't necessarily have a problem with you exponentiating your predicted values. You just need to realize that if the former was an expectation, the result is no longer an expectiation. Specifically, a regression model is intended to give the expected value of $Y$ at each point in $X$ ($E(Y|X=x_i)$). An expected value is the weighted average of all possible $Y$ values, where the weights are the likelihoods. In simpler terms, it is the conditional mean. Because the logarithm / exponentiation of a variable is a non-linear transformation, if you input a mean you don't get a mean as your output.

Often, people use the log transform to normalize the residual distribution and/or stabilize the variance. That is perfectly fine. But if the resulting distribution is normal(ish) with (sufficiently) constant variance, the original distribution necessarily wasn't. When you back transform, you get the conditional median instead of the conditional mean. If you understand that (and what it implies), and you want that, you will be fine.

Consider:

x   = c(2, 3, 1, 9, 3, 5, 9, 3)
lx  = log(x)
mlx = mean(lx)
mlx
#  1.249109
exp(mlx)
#  3.487234
mean(x)
#  4.375

• If you really do need the mean after back transformation, there are methods for this. See a post on Rob Hyndman's blog – Tony Ladson Jul 17 '14 at 22:25