[R-sig-ME] HPD intervals for fixed parameters in model

Ben Bolker bbolker at gmail.com
Tue Jun 5 09:38:38 CEST 2012


 <John.Morrongiello at ...> writes:

>  Log transforming the Age variable prior to putting it in the model
> solved the problem of a random slope in glmmADMB.

[snip]
> Are the following lmer,
> MCMCglmm and glmmADMB roughly comparable?

> *Variation in fish intercepts, variation in Age slopes, correlation between
intercept and slope:
> 
> M1lmer<-lmer(log(Increment)~logAge+temp+(logAge|FishID)+(1|fYear),
>        data,REML=T)
> M1mcmc<-MCMCglmm(log(Increment)~logAge+temp,
          random=~us(1+logAge):FishID + fYear,rcov= ~units,
          data=data, prior=prior)
> ##us allows for intercept and slope covariance

I believe the glmmadmb syntax here would be

M1glmmadmb <- glmmadmb(log(Increment)~logAge+temp+(logAge|FishID)+(1|fYear),
        data,corStruct="full",family="gaussian")

A couple of notes:

* glmmadmb() uses _Poisson_ family by default (it was originally
designed for GLMMs, not LMMs)
* I believe that neither MCMCglmm nor glmmadmb is doing REML here
 (although technically MCMCglmm isn't doing likelihood estimation
  in any case, and at the moment I can't think about the correspondence
 between marginal posterior means and REML estimates of variances ...)

 
> * Variation in fish intercepts and age slopes, but no correlation
> between intercept and slope:
 
> M2lmer<-lmer(log(Increment)~logAge+temp+(1+FishID)+(0+logAge|FishID)+
> (1|Year),data,REML=F)

> ##REML= FALSE is equivalent to glmmADMB?

  I think so.

> M2mcmc<-MCMCglmm(log(Increment)~logAge+temp,
      random=~idh(1+logAge):FishID + fYear,rcov=~units, 
     data=data, prior=prior)
 ##idh sets covariance between intercept and slope to zero (also could
##  use idh(logAge):FishID+FishID)

 M2glmmADMB<-glmmadmb(log(Increment)~logAge+temp+(logAge|FishID)+(1|fYear),
  NSWtiger,family='gaussian')

  I think that's all right.

  You know, the easiest way to check these correspondences is just
to try them (especially on simple simulated data where you know
what the true answer should be).



More information about the R-sig-mixed-models mailing list