I have 3 questions (below). Background: I am teaching an introductory statistics course in which we are covering (among other things) repeated measures anova. This time around teaching it, we are using R for all of our computations. We are starting by covering the univariate approach to repeated measures anova. Doing a basic repeated measures anova (univariate approach) using aov() seems straightforward (e.g.: +> myModel<-aov(myDV~myFactor+Error(Subjects/myFactor),data=myData) +> summary(myModel) Where I am currently stuck is how best to deal with the issue of the assumption of homogeneity of treatment differences (in other words, the sphericity assumption) - both how to test it in R and how to compute corrected df for the F-test if the assumption is violated. Back when I taught this course using SPSS it was relatively straightforward - we would look at Mauchly's test of sphericity - if it was significant, then we would use one of the corrected F-tests (e.g. Greenhouse-Geisser or Huynh-Feldt) that were spat out automagically by SPSS. I gather from searching the r-help archives, searching google, and searching through various books on R, that the only way of using mauchly.test() in R is on a multivariate model object (e.g. mauchly.test cannot handle an aov() object). Question 1: how do you (if you do so), test for sphericity in a repeated measures anova using R, when using aov()? (or do you test the sphericity assumption using a different method)? Question 2: Can someone point me to an example (on the web, in a book, wherever) showing how to perform a repeated measures anova using the multivariate approach in R? Question 3: Are there any existing R functions for calculating adjusted df for Greenhouse-Geisser, Huynh-Feldt (or calculating epsilon), or is it up to me to write my own function? Thanks in advance for any suggestions, -- Paul L. Gribble, Ph.D. Associate Professor Dept. Psychology The University of Western Ontario London, Ontario Canada N6A 5C2 Tel. +1 519 661 2111 x82237 Fax. +1 519 661 3961 pgribble@uwo.ca http://gribblelab.org [[alternative HTML version deleted]]

Peter Dalgaard

2009-Mar-03 21:00 UTC

### [R] repeated measures anova, sphericity, epsilon, etc

Paul Gribble wrote:> I have 3 questions (below). > > Background: I am teaching an introductory statistics course in which we are > covering (among other things) repeated measures anova. This time around > teaching it, we are using R for all of our computations. We are starting by > covering the univariate approach to repeated measures anova. > > Doing a basic repeated measures anova (univariate approach) using aov() > seems straightforward (e.g.: > > +> myModel<-aov(myDV~myFactor+Error(Subjects/myFactor),data=myData) > +> summary(myModel) > > Where I am currently stuck is how best to deal with the issue of the > assumption of homogeneity of treatment differences (in other words, the > sphericity assumption) - both how to test it in R and how to compute > corrected df for the F-test if the assumption is violated. > > Back when I taught this course using SPSS it was relatively straightforward > - we would look at Mauchly's test of sphericity - if it was significant, > then we would use one of the corrected F-tests (e.g. Greenhouse-Geisser or > Huynh-Feldt) that were spat out automagically by SPSS. > > I gather from searching the r-help archives, searching google, and searching > through various books on R, that the only way of using mauchly.test() in R > is on a multivariate model object (e.g. mauchly.test cannot handle an aov() > object). > > Question 1: how do you (if you do so), test for sphericity in a repeated > measures anova using R, when using aov()? (or do you test the sphericity > assumption using a different method)? > > Question 2: Can someone point me to an example (on the web, in a book, > wherever) showing how to perform a repeated measures anova using the > multivariate approach in R? > > Question 3: Are there any existing R functions for calculating adjusted df > for Greenhouse-Geisser, Huynh-Feldt (or calculating epsilon), or is it up to > me to write my own function? > > Thanks in advance for any suggestions,Have a look at http://cran.r-project.org/doc/Rnews/Rnews_2007-2.pdf Last time this came up, John Fox also pointed to some of his stuff, see http://finzi.psych.upenn.edu/R/Rhelp08/archive/151282.html -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907

### Seemingly Similar Threads

- ANOVA non-sphericity test and corrections (eg, Greenhouse-Geisser)
- library(car): Anova and repeated measures without between subjects factors
- Sphericity test
- Anova in 'car': "SSPE apparently deficient rank"
- assertion failed: (mailbox_list_is_valid_existing_name(_list, name))