RĂ¼diger Wolf
2014-Jan-21 17:56 UTC
[R] repeated measures ANOVA using Anova in car library
Dear all, I am trying to do a repeated-measures ANOVA using Anova of the car package. I have a quite basic design with 24 subjects and only 2 within-subject factors (condition (2 levels: legal an illegal) and day (1,2,3)). I found the Examples (see https://stat.ethz.ch/pipermail/r-help/2008-December/181981.html) in ?Anova, but I don't know what to do if there are only within-subject factors. What should I do with the mod.ok model object? ----------------------snip--------------------- name_test_fribbles<-read.csv('Naming_test_Fribbles.csv') # Import cond<-factor(rep(c("legal","illegal"),c(3,3)),levels=c("legal","illegal")) day<-ordered(rep(1:3,2)) idata<-data.frame(cond,day) mod.ok<-lm(cbind(legTag1,legTag2,legTag3,illegTag1,illegTag2,illegTag3) ~ THIS IS MISSING ,data=name_test_fribbles) -----------------------snip------------------------- I would be glad if anyone could help me! Thanks a lot! Rudi
You should post this instead on r-sig-mixed-models, rather than here. They are specifically concerned with such statistical issues; here the concern is primarily R programming. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." H. Gilbert Welch On Tue, Jan 21, 2014 at 9:56 AM, R?diger Wolf <r.h.wolf at gmx.net> wrote:> Dear all, > > I am trying to do a repeated-measures ANOVA using Anova of the car package. > > I have a quite basic design with 24 subjects and only 2 within-subject > factors (condition (2 levels: legal an illegal) and day (1,2,3)). > > I found the Examples (see > https://stat.ethz.ch/pipermail/r-help/2008-December/181981.html) in > ?Anova, but I don't know what to do if there are only within-subject > factors. What should I do with the mod.ok model object? > > ----------------------snip--------------------- > > name_test_fribbles<-read.csv('Naming_test_Fribbles.csv') # Import > cond<-factor(rep(c("legal","illegal"),c(3,3)),levels=c("legal","illegal")) > day<-ordered(rep(1:3,2)) > idata<-data.frame(cond,day) > mod.ok<-lm(cbind(legTag1,legTag2,legTag3,illegTag1,illegTag2,illegTag3) > ~ THIS IS MISSING > > ,data=name_test_fribbles) > > > -----------------------snip------------------------- > > I would be glad if anyone could help me! Thanks a lot! > > Rudi > > ______________________________________________ > R-help at r-project.org 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.
Dear Rudiger, See the following paper in the R Journal, which, among other things, shows how to set up a repeated-measures ANOVA or MANOVA using Anova(): <http://journal.r-project.org/archive/2013-1/fox-friendly-weisberg.pdf>. I hope this helps, John ------------------------------------------------ John Fox McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/ On Tue, 21 Jan 2014 18:56:56 +0100 R?diger Wolf <r.h.wolf at gmx.net> wrote:> Dear all, > > I am trying to do a repeated-measures ANOVA using Anova of the car package. > > I have a quite basic design with 24 subjects and only 2 within-subject > factors (condition (2 levels: legal an illegal) and day (1,2,3)). > > I found the Examples (see > https://stat.ethz.ch/pipermail/r-help/2008-December/181981.html) in > ?Anova, but I don't know what to do if there are only within-subject > factors. What should I do with the mod.ok model object? > > ----------------------snip--------------------- > > name_test_fribbles<-read.csv('Naming_test_Fribbles.csv') # Import > cond<-factor(rep(c("legal","illegal"),c(3,3)),levels=c("legal","illegal")) > day<-ordered(rep(1:3,2)) > idata<-data.frame(cond,day) > mod.ok<-lm(cbind(legTag1,legTag2,legTag3,illegTag1,illegTag2,illegTag3) > ~ THIS IS MISSING > > ,data=name_test_fribbles) > > > -----------------------snip------------------------- > > I would be glad if anyone could help me! Thanks a lot! > > Rudi > > ______________________________________________ > R-help at r-project.org 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.