Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

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    Alert          A    _Value_
One      S1    Alert          B    _Value_
One      S1    Alert          C    _Value_
One      S1    Passive        A    _Value_
One      S1    Passive        B    _Value_
One      S1    Passive        C    _Value_
One      S2    Alert          A    _Value_
...

Two      S9    Alert          A     _Value_
Two      S9    Alert          B     _Value_
Two      S9    Alert          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?
share|improve this question
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

1 Answer

It's very close.

My_anova = aov( Response ~ Condition * Stimulus * Group + 
           Error( Subject/(Condition * Stimulus) ), data = My_Data )
share|improve this answer
Thank you very much! From what I can tell, parenthesis have been added. What does this change in terms of grouping/the ANOVA model? – Nick GH Oct 7 '11 at 12:55
1  
Run both commands and you'll find out. You're not going to break anything trying stuff out. – John Oct 7 '11 at 14:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.