Giuseppe Pagnoni
2004-Aug-08 21:00 UTC
[R] (REPOST) Simple main effects in 2-way repeated measure ANOVA
Hi all
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))
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?
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"....
thanks in advance for any suggestions!
giuseppe
Giuseppe Pagnoni
Dept. Psychiatry and Behavioral Sciences
Emory University
1639 Pierce Drive, Suite 4000
Atlanta, GA, 30322
tel: 404.712.8431
fax: 404.727.3233
Prof Brian Ripley
2004-Aug-08 21:20 UTC
[R] (REPOST) Simple main effects in 2-way repeated measure ANOVA
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