[R] (REPOST) Simple main effects in 2-way repeated measure ANOVA

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Aug 8 23:20:37 CEST 2004

Why has this been REPOSTed?  It was delivered last Thursday.

On Sun, 8 Aug 2004, Giuseppe Pagnoni wrote:

> I am running a 2-way repeated measure anova with 1 between-subjects 
> factor (Group=treatment, control), and 1 within-subject factor (Time of 
> measurement: time1, time2).  I extract the results of the anova with:
> summary(aov(effect ~ Group*Time + Error=Subj/Time, data=mydata))

That's not valid syntax for an R formula. Did you mean Error(Subj/Time)?

> Now, this must be clearly a dumb question, but how can I quickly 
> extract in R all the post-hoc t-tests for the simple main effects?

I very much hope you cannot, as you have specified an interaction, and
you should not want t-tests for main effects in the presence of an 
interaction, and certainly not with the default R coding.

Did you mean Group + Time?

> Also, while I am at it, how do I enter in the model a counfounding 
> covariate (e.g., Age)?
> And on a different matter, is there a way to receive interactive user 
> input in an R script? Something like "Enter the name of  the factor:  
> ", or even more simply "Press <Enter> to see the result of the next 
> analysis"....

?readline, or cat + scan or ... using connections.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list