Skip to content

Alpha version of lme4_1.0.0 now on R-forge

6 messages · Parsons, Van L. (CDC/CCHIS/NCHS), Douglas Bates

#
I have updated the svn archive on R-forge to release 0.999375-1 of the
lme4 package.  The mcmcsamp function and the nlmer function still need
work but the lmer and glmer functions and the summaries of models fit
by these functions are stable, I think.

I would appreciate feedback and bug reports.  Please check the Bugs
tracker and the Feature Requests tracker at
http://r-forge.r-project.org/projects/lme4 to see what is currently in
the queue.

Doxygen documentation for the underlying C code is available at
http://lme4.r-forge.r-project.org/www/doxygen/
#
I should have added that you can install this alpha version with

install.packages("lme4", repos = "http://r-forge.r-project.org")

There is a Windows binary package but no Mac OS X binary.  If you are
running OS X and have installed the tools for compiling R packages
then you can specify type = "source" in the call to
install.packages().
On Jan 22, 2008 8:51 AM, Douglas Bates <bates at stat.wisc.edu> wrote:
1 day later
#
Hello,
  The lme4_0.999375-1 lmer run on a  full response (0,1) dataset
  is not consistent with the run on an equivalent, but condensed,
  (pbar,n) dataset for the binomial.  
  
  For lme4_0.99875-9, the outputs appear to be order-of-magnitude
  consistent, so the alpha version seems to have the problem.  
  ( I am focusing on the random and fixed effects output )

  Here are some sample code and outputs generated from sleepstudy
  in lme4 using 2 datasets and both new and old lme4. 
  
  Thanks, 
  Van
  
#=======================================================
# R code 
library(lme4)
library(doBy)
sessionInfo() 


 sleep1 = sleepstudy   # from lme4 pkg

     # add binary variable
 sleep1$p1 = ifelse(sleep1$Reaction < mean(sleep1$Reaction),0,1)

   # condense binary to mean and count within Subject 
   # use doBy package 
sleep1c= summaryBy(p1~Subject, data = sleep1,FUN = c(mean,length) )   
   names(sleep1c)[ c(2,3)] = c("p1", "n1")

   

 #--------------------------------------------
  # simple model

mod1  =p1~ 1 + (1| Subject)     

# lmer run   on full   data  
mfull   =  lmer(mod1, data=sleep1,  family=binomial )
summary(mfull)

# lmer run   on   condensed data  
mcond   =  lmer(mod1, data=sleep1c, weights= n1,family=binomial )
summary(mcond) 

#--------------------------------------------
#====================================================================



## 4  partial outputs  

#====================================================================

lme4_0.999375-1  full data
mfull   =  lmer(mod1, data=sleep1,  family=binomial )
   Data: sleep1 
   AIC   BIC logLik deviance
 238.5 244.9 -117.2    234.5
Random effects:
 Groups  Name        Variance Std.Dev.
 Subject (Intercept) 1.0231   1.0115  
Number of obs: 180, groups: Subject, 18

Fixed effects:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)  -0.3213     0.2887  -1.113    0.266
#====================================================================
# this next  run is not consistent with the other 3 

lme4_0.999375-1  condensed  data

mcond   =  lmer(mod1, data=sleep1c, weights= n1,family=binomial )
   Data: sleep1c 
   AIC   BIC logLik deviance
 9.622 11.40 -2.811    5.622
Random effects:
 Groups  Name        Variance Std.Dev.
 Subject (Intercept)  0        0      
Number of obs: 18, groups: Subject, 18

Fixed effects:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)  -0.2457     0.4750 -0.5173    0.605
#====================================================================
lme4_0.99875-9 full
AIC   BIC logLik deviance
 238.5 244.9 -117.2    234.5
Random effects:
 Groups  Name        Variance Std.Dev.
 Subject (Intercept) 1.0420   1.0208  
number of obs: 180, groups: Subject, 18

Estimated scale (compare to  1 )  0.9369863 

Fixed effects:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)  -0.3309     0.2906  -1.139    0.255



#====================================================================
lme4_0.99875-9 condensed 
 mcond   =  lmer(mod1, data=sleep1c, weights= n1,family=binomial )

   AIC   BIC logLik deviance
 47.88 49.66 -21.94    43.88
Random effects:
 Groups  Name        Variance Std.Dev.
 Subject (Intercept) 1.0241   1.012   
number of obs: 18, groups: Subject, 18

Estimated scale (compare to  1 )  1.012022 

Fixed effects:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)  -0.3183     0.2888  -1.102    0.270



#====================================================================
R version 2.6.1 (2007-11-26) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_United States.1252;
LC_CTYPE=English_United States.1252;
LC_MONETARY=English_United States.1252;
LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils   datasets  methods   base     

other attached packages:
[1] doBy_2.1    lme4_0.999375-1   Matrix_0.999375-4 lattice_0.17-4   

loaded via a namespace (and not attached):
[1] cluster_1.11.9 grid_2.6.1     Hmisc_3.4-3
#
Thanks for the report, Van.  I have entered it in the bug tracker list.

I had thought that I had checked such results for consistency but
apparently I didn't.
On Jan 23, 2008 2:14 PM, Parsons, Van L. (CDC/CCHIS/NCHS) <vlp1 at cdc.gov> wrote:
#
It appears that the problem is more with the handling of the weights
argument than with the binomial per se.  Look at the examples in

?cbpp

The first example runs properly but the second, which is inside a
\dontrun block, doesn't.
On Jan 23, 2008 2:30 PM, Douglas Bates <bates at stat.wisc.edu> wrote:
#
The suggestion of Prof. Bates to try the (success, failure)
representation
in lmer for the condensed Bernoulli data gave results consistent with
the full data. 

  For the example discussed, this code worked: 

  lmer( n1*cbind( p1,(1- p1))~ 1 + (1| Subject)  ,
         data=sleep1c,  family=binomial )

 Van