[R-sig-ME] Considerable discrepancies between fixed and random effect estimates of lme4 (glmer) and glmmADMB

Adam Smith raptorbio at hotmail.com
Sun Feb 12 20:35:11 CET 2012


I hope I'm not overlooking something elementary here, but estimated fixed and random effects are considerably different from the following Poisson model in lme4 and glmmADMB.  The fixed effects seem to differ most considerably...  Thanks for any thoughts...

Adam Smith

> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-pc-mingw32/x64 (64-bit)

(SNIP)

other attached packages:
[1] glmmADMB_0.7.2.5   lme4_0.999375-42   Matrix_1.0-3       bbmle_1.0.4.1      numDeriv_2010.11-1
[6] lattice_0.20-0     R2admb_0.7.5       MASS_7.3-16       

> str(cons09) # The dataset
'data.frame':   394 obs. of  15 variables:
 $ plot       : Factor w/ 16 levels "n_10","n_2","n_3",..: 2 2 2 2 2 2 2 2 2 2 ...
 $ plot_trt   : Factor w/ 32 levels "cont_n_10","cont_n_2",..: 2 2 2 2 2 2 2 2 2 2 ...
 $ geog       : Factor w/ 2 levels "n","s": 1 1 1 1 1 1 1 1 1 1 ...
 $ trt        : Factor w/ 2 levels "cont","trt": 1 1 1 1 1 1 1 1 1 1 ...
 $ count      : Factor w/ 14 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ total      : int  341 326 257 244 185 141 128 121 115 84 ...
 $ cons       : int  12 52 8 57 36 8 0 1 20 27 ...
 $ dt         : int  4 3 3 3 3 3 3 3 3 3 ...
 $ obs        : Factor w/ 394 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ logtotal   : num  5.83 5.79 5.55 5.5 5.22 ...
 $ logdt      : num  1.39 1.1 1.1 1.1 1.1 ...

# The models
> Poiss <- glmmadmb(cons ~ count + geog + trt + count:trt + count:geog + trt:geog + offset(logtotal) +
        offset(logdt) + (1|plot) + (1|plot_trt), zeroInflation=FALSE, family="poisson", data=cons09)

> P_glmer <- glmer(cons ~ count + geog + trt + count:trt + count:geog + trt:geog + offset(log(total)) +
      offset(log(dt)) + (1|plot) + (1|plot_trt), family="poisson", data=cons09)

> fixef(Poiss)
   (Intercept)         count2         count3         count4         count5         count6         count7         count8         count9        count10        count11        count12 
       0.77333        0.58885       -0.21547        0.79101        0.24924       -0.02565        0.36004       -0.94852        0.39442        0.29032        0.13658       -0.39564 
       count13        count14          geogs         trttrt  count2:trttrt  count3:trttrt  count4:trttrt  count5:trttrt  count6:trttrt  count7:trttrt  count8:trttrt  count9:trttrt 
      -1.37470       -0.88496       -0.53259       -0.25434       -0.41033        1.18840        0.25678        0.69734        0.59823        1.11430       -0.17330       -0.15364 
count10:trttrt count11:trttrt count12:trttrt count13:trttrt count14:trttrt   count2:geogs   count3:geogs   count4:geogs   count5:geogs   count6:geogs   count7:geogs   count8:geogs 
       0.98442        0.51533       -0.99431       -1.63920       -0.40455       -1.55670        0.15891        0.35378        0.45748        0.92293        0.78373        1.05440 
  count9:geogs  count10:geogs  count11:geogs  count12:geogs  count13:geogs  count14:geogs   geogs:trttrt 
       0.39598        0.32019        1.41600        0.86656        2.45790        1.07350       -0.31149 

# After detaching glmmADMB and lme4, then re-requiring lme4 to avoid masking of lme4's fixef function
> fixef(P_glmer)
   (Intercept)         count2         count3         count4         count5         count6         count7         count8         count9        count10        count11        count12 
   -5.00326871     0.69554781     0.17105622     1.29467717     0.97268949     0.87707266     1.39399967     0.22923370     1.61829807     1.84546906     1.99506279     1.37859852 
       count13        count14          geogs         trttrt  count2:trttrt  count3:trttrt  count4:trttrt  count5:trttrt  count6:trttrt  count7:trttrt  count8:trttrt  count9:trttrt 
    0.53987085     1.13282524    -0.12901214     0.07021103    -0.52669841     0.87378323     0.05397134     0.46901053     0.39863837     0.94486828    -0.18146287    -0.20340655 
count10:trttrt count11:trttrt count12:trttrt count13:trttrt count14:trttrt   count2:geogs   count3:geogs   count4:geogs   count5:geogs   count6:geogs   count7:geogs   count8:geogs 
    0.77866847     0.49935778    -0.65101999    -1.05381279    -0.05290984    -1.54103716    -0.03887633     0.04570463     0.02076874     0.47883964     0.23057821     0.49408747 
  count9:geogs  count10:geogs  count11:geogs  count12:geogs  count13:geogs  count14:geogs   geogs:trttrt 
   -0.15116087    -0.32683907     0.50098187     0.14670125     1.63961096     0.40944384    -0.22555478 

I juxtapose ranef() estimates here for comparison's sake...

> ranef(Poiss)$plot
       (Intercept)
n_10 -0.0943733643
n_2   0.1849966635
n_3   0.1925622397
n_4  -0.1873429084
n_5  -0.0522031304
n_6  -0.2297389315
n_7   0.1648785136
n_8   0.0944159043
n_9  -0.0556750492
s_1  -0.3023318134
s_2   0.0970108446
s_3  -0.2753679950
s_5   0.0909701639
s_6   0.4699361596
s_7  -0.0634075132
s_8   0.0007413087

> ranef(P_glmer)$plot

     (Intercept)

n_10 -0.39846683

n_2   0.04002750

n_3   0.61876383

n_4  -0.15421355

n_5  -0.46932629

n_6  -0.40931865

n_7   0.97591378

n_8   0.10866846

n_9  -0.28021810

s_1  -0.17423214

s_2  -0.19732599

s_3  -0.85567064

s_5   0.12795497

s_6   1.34047871

s_7  -0.27174719

s_8   0.06440244

>ranef(Poiss)$plot_trt
          (Intercept)
cont_n_10 -0.35187629
cont_n_2   0.59527239
cont_n_3   0.85766093
cont_n_4  -0.53814502
cont_n_5  -0.66935729
cont_n_6  -0.26606817
cont_n_7   0.80261648
cont_n_8   0.02233052
cont_n_9  -0.41806768
cont_s_1  -0.23483630
cont_s_2  -0.02224468
cont_s_3  -0.17660444
cont_s_5  -0.58505585
cont_s_6   1.49490396
cont_s_7   0.07621585
cont_s_8  -0.52568948
trt_n_10   0.03431004
trt_n_2    0.02722629
trt_n_3   -0.20972715
trt_n_4   -0.09225497
trt_n_5    0.49368927
trt_n_6   -0.50699118
trt_n_7   -0.24780806
trt_n_8    0.29537319
trt_n_9    0.23071847
trt_s_1   -0.78250755
trt_s_2    0.34867686
trt_s_3   -0.74997310
trt_s_5    0.89115581
trt_s_6    0.08645040
trt_s_7   -0.28957461
trt_s_8    0.52818059

> ranef(P_glmer)$plot_trt
            (Intercept)
cont_n_10 -0.4813895272
cont_n_2   0.6307028124
cont_n_3   0.5442036884
cont_n_4  -0.5256622000
cont_n_5  -0.6562034135
cont_n_6   0.1186249885
cont_n_7   1.0098808410
cont_n_8  -0.2196620296
cont_n_9  -0.3985906214
cont_s_1  -0.1821209263
cont_s_2  -0.5517396588
cont_s_3   0.1368254894
cont_s_5  -0.1701340605
cont_s_6   1.8066871045
cont_s_7  -0.5317778373
cont_s_8  -0.4961046022
trt_n_10   0.0668058960
trt_n_2   -0.5890563232
trt_n_3    0.0995873106
trt_n_4    0.3652111668
trt_n_5    0.1678942605
trt_n_6   -0.5444993690
trt_n_7    0.0055057682
trt_n_8    0.3327258112
trt_n_9    0.1070385259
trt_s_1    0.0008416109
trt_s_2    0.3464324210
trt_s_3   -1.0271054737
trt_s_5    0.3032644345
trt_s_6   -0.4119899922
trt_s_7    0.2490392783
trt_s_8    0.5631119264

 		 	   		  



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