# 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 – tristan Jun 7 '15 at 7:58
• How do you know your response is lognormal? – Glen_b Jun 7 '15 at 9:01

## 2 Answers

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). – James King Oct 12 '15 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.. – usεr11852 Oct 12 '15 at 21:18
• @JamesKing: isn't that what a lognormal distribution is? What would you recommend instead? – antoine-sac Nov 13 '18 at 17:16

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. – Mike Hunter Jun 7 '15 at 11:06