### You can run this ``from anywhere'' via ### source("ftp://stat.ethz.ch/U/maechler/R/mltloc-ex.R", echo = TRUE) ### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## From: Mark Lyman ## To: r-help@stat.math.ethz.ch ## Subject: [R] Bug in lmer? ## Date: Thu, 29 Sep 2005 14:44:38 -0600 ## I am relatively new to R so I am not confident enough in what I am doing ## to be certain this is a bug. I am running R 2.1.1 on a Windows XP ## machine and the lme4 package version 0.98-1. The following code fits the ## model I want using the nlme package version 3.1-60. if(FALSE) mltloc <- read.table("~/R/MM/Pkg-ex/lme4/mltloc.tab", header=TRUE) mltloc <- read.table("ftp://stat.ethz.ch/U/maechler/R/mltloc.tab", header=TRUE) ## not needed: mltloc$loc <- factor(mltloc$loc) mltloc$block <- factor(mltloc$block) mltloc$trt <- factor(mltloc$trt) str(mltloc) ## is completely 'balanced' : with(mltloc, ftable(table(block, trt, loc))) library(nlme) ; packageDescription("nlme") Mltloc <- groupedData(adg ~ trt | loc, mltloc) plot(Mltloc) plot(Mltloc, outer=~trt) m1 <- lme(adg ~ trt, random = pdBlocked(list(pdIdent(~1), pdIdent(~block-1), pdIdent(~trt-1))), data = Mltloc) summary(m1) ## The problem is that when I try fitting the model using the lmer function ## with the following code: library(lme4) ; packageDescription("lme4") ; packageDescription("Matrix") m2 <- lmer(adg ~ trt + (1|loc)+ (1|block:loc)+ (1|loc:trt),mltloc) ##- I get this message from Windows and R closes. ## >> R for Windows GUI front-end has encountered a problem and needs to ## >> close. We are sorry for the inconvenience. ##- This same code works on a Macintosh. So it doesn't seem that I have made ##- an error in my code. Also if anyone of the random effect terms is ##- removed there is no problem. Is this something that is being looked at? ##- Or I have I made a mistake somewhere? summary(m2) # shows similar things as 'm1' above