How to specify a lognormal distribution in the glm family argument in R? Simple question: How to specify a lognormal distribution in the GLM family argument in R?
I could not find how this can be achieved. Why is lognormal (or exponential) not an option in the family argument?
Somewhere in the R-Archives I read that one simply has to use the log-link for the family set to gaussian in the GLM, in order to specify a lognormal. However, this is nonsense because this will fit a non-linear regression and R starts asking for starting values.
Is anybody aware how to set a lognormal (or exponential) distribution for a GLM?
 A: The gamlss package allows you to fit generalized additive models with both lognormal and exponential distributions, and a bunch of others, with some variety in link functions and using, if you wish, semi- or non-parametric models based on penalized splines.  It's got some papers published on the algorithms used and documentation and examples linked to the site I've linked to.  
A: Fitting a log-normal GLM has nothing to do with the distribution nor the link option of the glm() function. The term "log-normal" is quite confusing in this sense, but means that the response variable is normally distributed (family=gaussian), and a transformation is applied to this variable the following way:
log.glm <- glm(log(y)~x, family=gaussian, data=my.dat)

However, when comparing this log-normal glm with other glms using different distribution (e.g., gamma), the AIC() function should be corrected. 
Would anyone know an alternative to these erroneous AIC(), in this case? 
A: Lognormal is not an option because the log-normal distribution is not in the exponential family of distributions. Generalized linear models can only fit distributions from the exponential family.
I'm less clear why exponential is not an option, as the exponential distribution is in the exponential family (as you might hope). Other statistical software with which I am familiar allows fitting the exponential distribution as a GLM by treating it as a special case of the Gamma distribution with shape (aka scale or dispersion) parameter fixed at 1 rather than estimated. I can't see a way of fixing this parameter using R's glm() function, however. One alternative would be to use the survreg() function from the survival package with dist="exponential".
If you have response data $y$ that you believe follows a lognormal distribution, the usual way of fitting a regression model to it would be to log-transform it, as $\log(y)$ will have a normal distribution. The simplest case is then to fit an ordinary (i.e. not generalized) linear model. The resulting model is not quite the same model you would get if you could fit a GLM with a log link, however, as $\operatorname{E}(\log(Y)) \ne \log(\operatorname{E}(Y)).$ 
A: Regarding fitting the exponential model with glm: When using the glm function with family=Gamma one needs to also use the supporting facilities of summary.glm in order to fix the dispersion parameter to 1:
?summary.glm
fit <- glm(formula =..., family = Gamma)
summary(fit,dispersion=1) 

And as I was going to point out but jbowman beat me to it, the "gamlss" package(s) provides for log-normal fitting:
help(dLOGNO, package=gamlss.dist)

A: Try using the following command:
log.glm = glm(y ~ x, family=gaussian(link="log"), data=my.dat)

It works here and the AIC seems to be correct.
