Lognormal Regression?

I'm trying to model a lognormal response variable. I want to take the log of the response variable and do a least-squares regression line over my predictive variable. However, I'm worried about this. Is this an okay thing to do? I know that for my original variable, variance grows with the mean, but would taking logs adjust for this appropriately?

• If the standard deviation is proportional to the mean (ie, constant coefficient of variation) then log transform is fine I think. Try a scatter plot with logarithmic y axis Commented Jun 7, 2015 at 7:58
• How do you know your response is lognormal? Commented Jun 7, 2015 at 9:01

I would suggest using a generalised linear model (GLM) with a log-link function instead of directly log-transforming your variables; in R you can simply use glm with family= gaussian(link='log') to begin with.

I say this because modelling the mean of the log-transformed variable (as you would do by simply taking the logarithms of your dependent variable) is not always the same as modelling the log of the variable's mean. The user @Corone made a very informative post about this issue here. In short, if the logarithm transformation is not perfectly appropriate it will give suboptimal results in comparison with a GLM.

A very good initial point is the paper by Lindsey & Jones on "Choosing among generalized linear models applied to medical data". (It is easily found online for free if you google/bing the title...)

• glm with family=gaussian(link=log) does not seem appropriate for a lognormally distributed response variable; this models with a family of Gaussians with means = exp(linear predictor). Commented Oct 12, 2015 at 18:55
• @JamesKing: I partially agree; one makes the assumption of constant variance when using a Gaussian model. I specifically said "modelling the mean of the log-transformed variable is not always the same as modelling the log of the variable's mean.. Commented Oct 12, 2015 at 21:18
• @JamesKing: isn't that what a lognormal distribution is? What would you recommend instead?
– asac
Commented Nov 13, 2018 at 17:16
• Using a log link function will result in fitting an unbiased estimator in log space, which when transformed back to real space will result in a biased estimator. This means that all the estimates you get from your model will come out higher than what they were supposed to be. Commented Aug 9, 2021 at 20:47

I want to take the log of the response variable and do a least-squares regression line over my predictive variable.

If I expected the relationship to be linear on the log scale, that's where I'd probably start.

Is this an okay thing to do?

It can be; it depends on what else is going on.

I know that for my original variable, variance grows with the mean, but would taking logs adjust for this appropriately?

It might, or it might not. It depends on exactly how the variance is related to the mean. If the standard deviation is a constant multiple of the mean (variance proportional to mean squared), then you should end up with constant variance on the log scale. Otherwise you won't.

• One point not otherwise mentioned is the tractability of multiplicative, log-log models (both the response and predictor are natural log transforms) and the intuition that, in regression, the coefficient of the predictor amounts to an elasticity (e.g., for a % change (typically 1%) in X, what's the corresponding % change in Y?), which may or may not be a desirable economic quantity. That said, my personal preference is not to do much in the way of transforming response variables in regression because it can open up a can of worms wrt the retransformation bias of the predictions. Commented Jun 7, 2015 at 11:06
• Indeed that's an issue when the aim is prediction of the mean (prediction intervals are okay, though). One advantage of modelling with (say) a gamma GLM with log link (a fairly similar model the lognormal regression in the question) is that the predictions are directly of the mean. Commented Dec 6, 2019 at 2:08