1

I'm running repeated-measures ANOVAs using aov in R, and all variables are within-subjects. But R is not showing main effects. Several people have looked at my code, and no one knows why. It looks like:

test1 = aov(y ~ (a*b+c) + Error(Subject/a*b+c), mydata))

But when I run summary(test1), I only get one P value:

             Df Sum Sq Mean Sq F value Pr(>F)
a:b           4 431859  107965   2.637  0.185 

For main effects a, b, c I am only getting Df Sum Sq Mean Sq.

I also tried switching to "afex", and doing this:

test1 <- aov_ez("Subject", "y", mydata, within = c("a", "b", "c"))

But then the summary does not allow me to do a complex interaction, like a*b+c. Not all variables interact in my model. I need two to interact, but I have to control for the main effect of the other.

  • It may well be due to confounding/aliasing in your data. Can you `dput()` all or part of your input? – Limey Jun 22 '20 at 08:16
  • 1
    I am not really sure `Error(Subject / a * b + c)` makes sense. Generally, `Error(Subject / x * y)` would describe two crossed within-subject factors `x` and `y` (or more explicitly: it corresponds to a within-subject predictor `x` that is crossed with another within-subject predictor `y`). I'm not sure what `Error(Subject / x + y)` is supposed to describe in a within-subject design. I don't understand what you mean by "[n]ot all variables interact in my model". Is this an issue concerning crossed and nested predictors? – Maurits Evers Jun 22 '20 at 08:54
  • Thank you for your input, guys. Today I found out we are probably running the wrong type of ANOVA (Type II instead of I or III). Maurits, I think you're right that the error term is incorrect. I do not have enough stats training for this project. –  Jun 23 '20 at 13:37

0 Answers0