[R] lmer for 3-way random anova

From: Dick Beyer <dbeyer_at_u.washington.edu>
Date: Sat 10 Dec 2005 - 06:25:09 EST


I have been using lme from nlme to do a 3-way anova with all the effects treated as random. I was wondering if someone could direct me to an example of how to do this using lmer from lme4.

I have 3 main effects, tim, trt, ctr, and all the interaction effects tim*trt*ctr. The response variable is ge.

Here is my lme code:

   dat <- data.frame(ge=ge,trt=factor(trt),tim=factor(tim),ctr=factor(ctr))    dat$grp = as.factor(rep(1, nrow(dat)))

# dim(dat) = 216x5

   w <- lme(ge ~ 1,data=dat,
   random = list(

   grp = pdBlocked(list(  pdIdent(~ trt - 1)

,pdIdent(~ tim - 1)
,pdIdent(~ ctr - 1)
,pdIdent(~ trt:tim - 1)
,pdIdent(~ trt:ctr - 1)
,pdIdent(~ tim:ctr - 1)
,pdIdent(~ trt:tim:ctr - 1)
) ) ) ) I was trying the following as a starting place:

   lmer(ge~1+(1|tim)+(1|trt)+(1|ctr), data=dat)

but this causes my R session to terminate.

> sessionInfo()
R version 2.2.0, 2005-11-15, i386-pc-mingw32

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

other attached packages:

      lme4 lattice Matrix
  "0.98-1" "0.12-11" "0.99-2"

Thanks very much for any help or pointers, Dick


Richard P. Beyer, Ph.D.	University of Washington
Tel.:(206) 616 7378	Env. & Occ. Health Sci. , Box 354695
Fax: (206) 685 4696	4225 Roosevelt Way NE, # 100
 			Seattle, WA 98105-6099

http://depts.washington.edu/ceeh/ServiceCores/FC5/FC5.html http://staff.washington.edu/~dbeyer

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Dec 10 06:37:52 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:35 EST