# Why does my repeated measures ANOVA analysis vary when I organize my data differently?

In my study there were 63 types of stimuli (63 levels of the IV) and all types had 8 different examples (8 trials per level of IV) which were all categorized by each participant. Accuracy of categorization was the dependent variable.

I originally arranged my data for R such that all 8 responses for a stimulus type were averaged into a single accuracy score by participant. Simplified example follows:

I assumed, incorrectly, that I would get the same results in a repeated measures ANOVA by arranging my data such that each stimulus example of a stimulus type constituted its own row (I am now analyzing my results with this arrangement instead of the old one). Simplified example follows:

When I ran my repeated measures ANOVA in R I got different F scores as well as different results from paired comparisons for each way I organized the data. I know that there must be a difference in how variability is calculated between the two data arrangements, but I don't understand why. Can someone give me some more insight in to why the results differ?

• What is your factor ? And what model do you apply to the averaged data ? – Stéphane Laurent Oct 3 '14 at 18:50
• It would be helpful to see the code that you used to fit the model in R. You should be using the latter setup. The model you should be using is a GLMM or a GEE logistic regression. But I wonder if you were using OLS (ie lm()). – gung - Reinstate Monica Oct 3 '14 at 19:00
• My factor in the above examples is stimulus type (emotion). I did a repeated measures ANOVA of the data (not sure if that answers your question about what model I used) Here is the code I used in R: aov.ex <- aov(data$Accuracy ~ data$Stimulus_Type + Error(factor(data\$Participant))) – phisher Oct 5 '14 at 20:14