Skip to content
Prev 324495 / 398503 Next

R: Equivalence between lm and glm

I find difficult to understand why in
lm(log(Y) ~ X)
Y is assumed lognormal.
I know that if Y ~ N then Z=exp(Y) ~ LN, and that if Y ~ LN then Z=log(Y) ~ N.
In
lm(log(Y) ~ X)
I assume Y ~ N(mu, sigma^2), and then exp(Y) would be distributed by a LN, not l
og(Y).
Where is my mistake?

Moreover, in
glm(Y ~ X, family=gaussian(link=log))
the regression is
log(mu) = beta0 + beta1*X.
In
lm(log(Y) ~ X)
the regression is
exp(mu+(1/2)*sigma^2) = beta0 + beta1*X.
Correct?

Thank you for your help
Stefano Sofia