# Is this mixed ANOVA correctly specified in R?

I am trying to test some results I have for significance. It has been recommended that I use R and I am completely new to this.

### Set-up:

• Groups: two groups of 8 subjects (16 total)
• Two conditions: alert and passive
• Measurements: responses for three different stimuli (A, B, and C) measured in each condition

### Experiment: Testing the order of conditions

• Group one: Alert A, B and C followed by Passive A, B, and C
• Group two: Passive A, B, and C followed by Alert A, B, and C

Stimuli A, B and C are randomly interleaved in the experiment, does this matter in my ANOVA?

I am interested in making a between and within group comparison of responses to A, B, and C

### Here is what I am doing:

My data is arranged in the following way

Group Subject Condition Stimulus  Response
One      S1    Passive        A    _Value_
One      S1    Passive        B    _Value_
One      S1    Passive        C    _Value_
...

...


This is the code I used:

My_anova = aov(Response ~ Condition * Stimulus * Group +
Error(Subject/Condition * Stimulus ), data=My_Data)


### Question

• Is this model correctly specified in R?
-
 Welcome to the site. I've edited your question to remove the ANCOVA component as it seems quite distinct. I suggest you ask a second question regarding the ANCOVA component and provide a link to the current question in your ANCOVA question. – Jeromy Anglim Oct 7 '11 at 4:26 Thanks for the help Jeromy! – Nick GH Oct 7 '11 at 12:55

My_anova = aov( Response ~ Condition * Stimulus * Group +