[R] glmer vs glmmadmb

Ben Bolker bbolker at gmail.com
Thu Sep 19 14:56:38 CEST 2013


kenny xu <kennyxu1983 <at> hotmail.com> writes:

> 
> Dear All
>
> I have fitted the following glmm:
> 
> cmai ~ time.f * intrv.f + (1 | nhome.f/Res_Code.f)
> 
> with poisson distribution, using both glmer and glmmadmb.
> 
> But the estimation for the fixed and random effects were different, i.e.

  This is a surprising set of differences.  I'm going to suggest
you send follow-ups to r-sig-mixed-models at r-project.org, which is
specialized for mixed models

> > summary(lmer.AGGREG.cmai.out3)
> 
> Call:
> glmmadmb(formula = cmai ~ time.f * intrv.f + (1 | nhome.f/Res_Code.f), 
>     data = beam.AGGREG.cmai.long, family = "poisson", link = "log", 
>     zeroInflation = F, admb.opts = admbControl(impSamp = 0, run = F), 
>     save.dir = "tmp")

   Is there a particular reason you're using 'run=FALSE'?  This specification
will tell glmmADMB not to run the model, but to collect the results of
a previous run from the working directory -- not necessarily wrong,
but very easy to make a mistake this way and pick up the results
from a model run with a *different* specification (which might???
be what happened here)  (Also, just as a matter of practice, it's
strongly advised to use FALSE instead of F, just in case someone
decided to assign a value to 'F' ...)

> AIC: 1032.2 
> 
> Coefficients:
>                  Estimate Std. Error z value Pr(>|z|)
> (Intercept)         0.542      3.105    0.17     0.86
> time.f2             0.104      5.177    0.02     0.98
> time.f3            -0.526      3.230   -0.16     0.87
> intrv.f1            0.929      2.712    0.34     0.73
> time.f2:intrv.f1   -0.416      5.302   -0.08     0.94
> time.f3:intrv.f1    0.177      3.261    0.05     0.96
> 
> Number of observations: total=1032, nhome.f=35, nhome.f:Res_Code.f=344 
> Random effect variance(s):
> Group=nhome.f
>             Variance StdDev
> (Intercept)   0.7118 0.8437
> Group=nhome.f:Res_Code.f
>             Variance StdDev
> (Intercept)    1.454  1.206
> Log-likelihood: -508.108 
> 
> > summary(lmer.AGGREG.cmai.out2)
> Generalized linear mixed model fit by the Laplace approximation 
> Formula: cmai ~ time.f * intrv.f + (1 | nhome.f/Res_Code.f) 
>    Data: beam.AGGREG.cmai.long 
>   AIC  BIC logLik deviance
>  1835 1874 -909.5     1819
> Random effects:
>  Groups             Name        Variance Std.Dev.
>  Res_Code.f:nhome.f (Intercept) 0.040125 0.20031 
>  nhome.f            (Intercept) 0.033702 0.18358 
> Number of obs: 1032, groups: Res_Code.f:nhome.f, 344; nhome.f, 35
> 
> Fixed effects:
>                  Estimate Std. Error z value Pr(>|z|)    
> (Intercept)       3.62040    0.04749   76.23   <2e-16 ***
> time.f2          -0.01964    0.01706   -1.15   0.2496    
> time.f3           0.01643    0.01691    0.97   0.3310    
> intrv.f1          0.07540    0.06819    1.11   0.2689    
> time.f2:intrv.f1  0.02148    0.02395    0.90   0.3698    
> time.f3:intrv.f1 -0.04835    0.02394   -2.02   0.0435 *  

  Otherwise I'm stumped.  The numbers of observations etc. etc.
seem consistent. It's hard to compare AIC/log-likelihood between
glmmADMB and glmer because (at present) they use different
additive offsets ...

   You could send me the data if it's not too sensitive.

  Ben Bolker



More information about the R-help mailing list