Re: [R] Help with problem - multilevel model?

From: Doran, Harold <HDoran_at_air.org>
Date: Thu 18 Jan 2007 - 15:27:29 GMT


Aov is not the right function for this problem. Lmer is designed for multilevel modeling. There are a lot of resources, but start with the following vignette

Library(lme4)
vignette("MlmRevSoft")

And then turn to Pinhiero and Bates

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of
> Richard M. Heiberger
> Sent: Thursday, January 18, 2007 10:22 AM
> To: Crabb, David; r-help@stat.math.ethz.ch
> Subject: Re: [R] Help with problem - multilevel model?
>
> 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)

>
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.
>



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 and provide commented, minimal, self-contained, reproducible code. Received on Fri Jan 19 02:47:50 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 18 Jan 2007 - 16:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.