# Confusing main effect in mixed design ANOVA

I am conducting a mixed design ANOVA test using ezANOVA. I ran two different tests as follows:

Test1: within subject variable w, between subject variables age and x1.

Test2: within subject variable w, between subject variables age and x2.

Both tests are on the same data and same dependent variable (but I built two separate models), all independent variables are categorical.

But the output shows that, in Test1, the main effect of age is not significant, but in Test2 it is significant. My question is if this can happen or I am doing something wrong? In both tests, interaction between age and x1/x2 are not significant.

• Maybe need to write down the model mathematically. Did you fit two models and perform one test on each of them, or fit one model and test two hypotheses based on the same model? Oct 10 '18 at 1:16
• I had two separate models Oct 10 '18 at 4:08
• Could you write down you two models mathematically? Oct 10 '18 at 21:46

• Adding terms uses up denominator degrees of freedom in the F test for the other terms. In your case, if x1 is a factor variable with more levels than x2, the sums of squares for Age could be the same for both models, but the F-test could be different based on the denominator degrees of freedom.
• Types of sums of squares can matter. You probably know that stats::anova uses type I sum of squares. car::Anova uses type II by default. I don't know what type ezANOVA uses by default. In any case, using these different types affects how the sums of squares are apportioned to terms, and so affects the F-tests.