Skip to content

Log-normal MCMCglmm

8 messages · Jörg Albrecht, Paul Johnson, Daniel Sol +1 more

#
Hi everybody,

I have trouble finding how to implement a MCMCglmm with log-normal error. I
know some people just log-transform the response variable, but this is not
the same.

Many thanks in advance,

Dani
2 days later
#
Hi Dani,

you could try specifying 

family = "poisson".

Best,

J?rg

?
J?rg Albrecht, PhD
Postdoctoral researcher
Institute of Nature Conservation
Polish Academy of Sciences
Mickiewicza 33
31-120 Krakow, Poland
www.carpathianbear.pl <http://www.carpathianbear.pl/>
www.globeproject.pl <http://www.globeproject.pl/>
www.iop.krakow.pl <http://www.iop.krakow.pl/>

  
  
#
Hi J?rg,

Thanks a lot for the suggestion. I actually have tried to use a Poisson
error, but it looks like my data best fit a log-normal distribution.

Best,

Dani

2015-07-28 10:40 GMT+02:00 J?rg Albrecht <albrechj at staff.uni-marburg.de>:

  
    
#
Hi Dani,

Can you explain with a formula what you mean by the difference between a model with log-normal errors and a model with normal errors where the response is log-transformed? As the errors are log-normal, i.e. strictly positive, they presumably can?t be additive. Are they multiplicative? If they are then logging the predictor will result in an additive model with normal errors.

E.g. a multiplicative model with lognormal errors:
Y = Yhat * exp(epsilon), where epsilon ~ exp(N(0, sigma^2))

Log it:
log(Y) = log(Yhat) + log(epsilon)
which is an additive model with normal errors with the response log-transformed.

Best wishes,
Paul
On 28 Jul 2015, at 09:47, Daniel Sol <dsolrueda at gmail.com> wrote:

            
#
Hi Dani,

I'm not sure why logging the response is not equivalent? Is it because  
you wish the residuals to be log normal, but the distribution of other  
random effects to be normal? If so, then MCMCglmm is not able to  
handle this: all random effects, including residuals, must be  
(multivariate) normal on some link scale.

Cheers,

Jarrod




Quoting Daniel Sol <dsolrueda at gmail.com> on Tue, 28 Jul 2015 10:47:29 +0200:

  
    
#
Dear Paul and Jarrod,

Thanks a lot for your responses. I read somewhere that in GLM
log-transforming the response variable and using a log-link is not exactly
the same, but I did not really know the implications. Based on your
clarifications, I'm gonna log-transform the response variable. Many thanks
for your help, I really appreciate it.

Best wishes,

Dani








2015-07-28 12:41 GMT+02:00 Jarrod Hadfield <j.hadfield at ed.ac.uk>:

  
    
#
Hi Dani,

You are right. In a glm the link function is concerning the mean:

log(E[y]) = a linear model

this is not generally the same as:

E[log(y)] = a linear model

If y is log-normal

log(E[y]) = E[log(y)]+VAR[log(y)]/2

Implying that you would need to modify you're location effects by the  
variance to recover the location effects under a Gaussian glm with  
log-link.

Cheers,

Jarrod




Quoting Daniel Sol <dsolrueda at gmail.com> on Tue, 28 Jul 2015 13:03:15 +0200:

  
    
#
PS I should have written:
not
Paul
On 28 Jul 2015, at 11:33, Paul Johnson <Paul.Johnson at glasgow.ac.uk> wrote: