[R] Possible bug in lmer nested analysis with factors

Yan Wong h.y.wong at leeds.ac.uk
Fri Sep 16 17:57:54 CEST 2005


Hello,

Is this a bug in the lmer routine?

 > library(lme4)
 > ### test case based on rats data from Crawley
 > a<-rnorm(36);b<-rep(1:3,each=12);c<-rep(1:2,each=6,3);d<-rep 
(1:3,each=2,6)
 >
 > ### mixed model works when c & d are numeric, lmer assumes they  
are factors
 > m <- lmer(a ~ b + (1|c/d))
 >
 > ### but bails out when they are actually specified as factors
 > c<-factor(c); d<-factor(d)
 > m <- lmer(a ~ b + (1| c / d))

Error in lmer(a ~ b + (1 | c/d)) : entry 0 in matrix[0,0] has row  
2147483647 and column 2147483647
In addition: Warning message:
/ not meaningful for factors in: Ops.factor(c, d)


Cheers

Yan




More information about the R-help mailing list