I have tried in vain to find the answer to this question in the other two way ANOVA discussions I have found, so I hope this isn't a repeat.
I have a balanced design (5 observations in each of 4 groups). To my understanding, this means that performing a two-way ANOVA using type I, II, or III sums of squares should all give the same results for the main effects and/or interaction.
My linear model is as such:
mod <- lm(X2HG ~ Genotype * Diet, data = df)
When I run typeII in R using:
Anova(mod, type=2)
Anova Table (Type II tests)
Response: X2HG
Sum Sq Df F value Pr(>F)
Genotype 2.9033e+11 1 4.5914 0.047854 *
Diet 8.4475e+11 1 13.3594 0.002136 **
Genotype:Diet 5.5728e+11 1 8.8132 0.009051 **
Residuals 1.0117e+12 16
The F and p-values are VERY different to typeIII:
Anova(mod, type=3)
Anova Table (Type III tests)
Response: X2HG
Sum Sq Df F value Pr(>F)
(Intercept) 1.5182e+12 1 24.0103 0.0001602 ***
Genotype 2.1568e+10 1 0.3411 0.5673422
Diet 1.4894e+10 1 0.2355 0.6340278
Genotype:Diet 5.5728e+11 1 8.8132 0.0090510 **
Residuals 1.0117e+12 16
Can anyone explain why the difference? Am I wrong in thinking they should be the same?
EDIT: For further clarity, I get the same output using type 2 and type 3 anova from the bioinfokit package in python so this isn't specific to the car package in R.