[R] Help with problem - multilevel model?

Richard M. Heiberger rmh at temple.edu
Thu Jan 18 16:22:27 CET 2007


This should get you started


tmp <- data.frame(y1=rnorm(62*5),
                  y2=rnorm(62*5),
                  time=rep(1:5, 62),
                  id=factor(rep(1:62, each=5))
                  )

xyplot(y1 ~ y2 | id, data=tmp, group=time, pch=as.character(1:5))

tmp.aov <- aov(y1 ~ y2*factor(time) + Error(id), data=tmp)
summary(tmp.aov)



More information about the R-help mailing list