I'm attempting a two way ANOVA in R using the Anova function from the car package (so I can specify that it is a type II ANOVA).
For example
model <- lm(formula = response ~ treatment * species, data = data)
model2 <- car::Anova(model, type = 2)
Example data:
data1 <- data.frame(species = c("1","1","1","1","1","1","1","1","1","1","2","2","2","2","2","2","2","2","2","2"),
treatment = c("a","b","c","a","b","c","a","b","c","a","b","c","a","b","c","a","b","c","a","b"),
response = c(6,5,7,8,9,4,3,5,6,9,3,6,6,7,8,9,5,6,7,8))
I then would like to run a post-hoc test on model2 to determine which pairs are significantly different from each other. I'd like to get the p values for all combinations of treatments and species (ex. treatment a/species 1 compared to treatment b/species 1 and treatment b/species 2 and so on) and also the connecting letter report.
None of the functions/packages I've tried (HSD.test, TukeyHSD) seem to work on a car::Anova object. Furthermore, HSD.test requires that you choose one of the factors for the Tukey's test and will not run on interacting factors.
Is there a package anyone can recommend that will both work with car::Anova and run on multiple factors, that gives you the connecting letter report?
Thanks!
I've tried HSD.test and TukeyHSD.