Skip to content
Prev 4001 / 20628 Next

different aic and LL in glmer(lme4) and glimmix(SAS)?

On Thu, Jul 1, 2010 at 11:24 AM, Douglas Bates <bates at stat.wisc.edu> wrote:
I enclose the example I promised.
-------------- next part --------------

R version 2.11.1 (2010-05-31)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
Loading required package: Matrix
Loading required package: lattice

Attaching package: 'Matrix'

The following object(s) are masked from 'package:base':

    det

Loading required package: minqa
Loading required package: Rcpp

Attaching package: 'lme4a'

The following object(s) are masked from 'package:stats':

    AIC
+     stopifnot(is(fr, "data.frame"),
+               is(mm <- fr[[1]], "matrix"),
+               ncol(mm) == 2,
+               is.numeric(mm),
+               all(mm >= 0))
+     nr <- nrow(mm)
+     within(fr[, -1][rep.int(seq_len(nr), rowSums(mm)), ],
+            y. <- rep.int(rep.int(c(1,0), nr), as.vector(t(mm))))
+ }
'data.frame':	56 obs. of  4 variables:
 $ herd     : Factor w/ 15 levels "1","2","3","4",..: 1 1 1 1 2 2 2 3 3 3 ...
 $ incidence: num  2 3 4 0 3 1 1 8 2 0 ...
 $ size     : num  14 12 9 5 22 18 21 22 16 16 ...
 $ period   : Factor w/ 4 levels "1","2","3","4": 1 2 3 4 1 2 3 1 2 3 ...
+               (1|herd), cbpp, binomial, verbose=1L))
npt = 3 , n =  1 
rhobeg =  0.2 , rhoend =  2e-07 
   0.020:   4:      100.209;0.600000 
  0.0020:   7:      100.154;0.649390 
 0.00020:  10:      100.152;0.641932 
 2.0e-05:  12:      100.152;0.641823 
 2.0e-06:  13:      100.152;0.641823 
 2.0e-07:  15:      100.152;0.641815 
At return
 18:     100.15189: 0.641815
npt = 11 , n =  5 
rhobeg =  0.5840305 , rhoend =  5.840305e-07 
   0.058:  11:      100.152;0.641815 -1.36047 -2.33665 -2.47155 -2.92015 
  0.0058:  18:      100.108;0.653041 -1.38121 -2.38874 -2.52675 -2.97967 
 0.00058:  31:      100.095;0.642982 -1.39633 -2.38831 -2.52555 -2.97656 
 5.8e-05:  48:      100.095;0.642327 -1.39893 -2.39134 -2.52748 -2.97945 
 5.8e-06:  57:      100.095;0.642392 -1.39894 -2.39126 -2.52758 -2.97924 
 5.8e-07:  66:      100.095;0.642393 -1.39894 -2.39125 -2.52758 -2.97924 
At return
 78:     100.09497: 0.642392 -1.39894 -2.39125 -2.52758 -2.97924
Generalized linear mixed model fit by maximum likelihood ['merMod']
 Family: binomial 
Formula: cbind(incidence, size - incidence) ~ 0 + period + (1 | herd) 
   Data: cbpp 
     AIC      BIC   logLik deviance 
110.0950 120.2217 -50.0475 100.0950 

Random effects:
 Groups Name        Variance Std.Dev.
 herd   (Intercept) 0.4127   0.6424  
Number of obs: 56, groups: herd, 15

Fixed effects:
        Estimate Std. Error z value
period1  -1.3989     0.2279  -6.138
period2  -2.3912     0.3103  -7.705
period3  -2.5276     0.3308  -7.641
period4  -2.9792     0.4327  -6.885

Correlation of Fixed Effects:
        perid1 perid2 perid3
period2 0.389               
period3 0.365  0.289        
period4 0.280  0.220  0.205
'data.frame':	842 obs. of  3 variables:
 $ period: Factor w/ 4 levels "1","2","3","4": 1 1 1 1 1 1 1 1 1 1 ...
 $ herd  : Factor w/ 15 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ y.    : num  1 1 0 0 0 0 0 0 0 0 ...
+                verbose=1L))
npt = 3 , n =  1 
rhobeg =  0.2 , rhoend =  2e-07 
   0.020:   4:      555.118;0.600000 
  0.0020:   7:      555.062;0.649390 
 0.00020:  10:      555.060;0.641932 
 2.0e-05:  12:      555.060;0.641823 
 2.0e-06:  13:      555.060;0.641823 
 2.0e-07:  15:      555.060;0.641815 
At return
 17:     555.05991: 0.641815
npt = 11 , n =  5 
rhobeg =  0.5840305 , rhoend =  5.840305e-07 
   0.058:  11:      555.060;0.641815 -1.36047 -2.33665 -2.47155 -2.92015 
  0.0058:  18:      555.016;0.653041 -1.38121 -2.38874 -2.52675 -2.97967 
 0.00058:  31:      555.003;0.642982 -1.39633 -2.38831 -2.52555 -2.97656 
 5.8e-05:  48:      555.003;0.642327 -1.39893 -2.39134 -2.52748 -2.97945 
 5.8e-06:  57:      555.003;0.642392 -1.39894 -2.39126 -2.52758 -2.97924 
 5.8e-07:  66:      555.003;0.642393 -1.39894 -2.39125 -2.52758 -2.97924 
At return
 76:     555.00300: 0.642392 -1.39894 -2.39125 -2.52758 -2.97924
Generalized linear mixed model fit by maximum likelihood ['merMod']
 Family: binomial 
Formula: y. ~ 0 + period + (1 | herd) 
   Data: cbpp1 
      AIC       BIC    logLik  deviance 
 565.0030  588.6819 -277.5015  555.0030 

Random effects:
 Groups Name        Variance Std.Dev.
 herd   (Intercept) 0.4127   0.6424  
Number of obs: 842, groups: herd, 15

Fixed effects:
        Estimate Std. Error z value
period1  -1.3989     0.2279  -6.138
period2  -2.3912     0.3103  -7.705
period3  -2.5276     0.3308  -7.641
period4  -2.9792     0.4327  -6.885

Correlation of Fixed Effects:
        perid1 perid2 perid3
period2 0.389               
period3 0.365  0.289        
period4 0.280  0.220  0.205
user  system elapsed 
  6.140   0.130   6.405