I'm dealing with an unbalanced design/sample and originally learned aov()
. I know now that for my ANOVA tests I need to use the Type III Sum of Squares which involves using fitting using lm()
rather than using aov()
.
The problem is getting post-hoc tests (specifically Tukey's HSD) using lm()
. All the research I've done has said that using simint
in the multcomp
package would work, but now that it's updated that command seems to not be available. It also seems to rely upon going through aov()
to calculate.
Essentially all of the Tukey HSD tests I've found for R assume that you use aov()
for the comparison rather than lm()
. To get the Type III Sum of Squares I need for the unbalanced design I have to use:
mod<-lm(Snavg~StudentEthnicity*StudentGender)
Anova(mod, type="III")
How do I use a Tukey HSD test with my mod using lm()
? Or conversely, calculate my ANOVA using Type III and still be able to run a Tukey HSD test?
Thanks!
I was stuck with the same problem of the HSD.test printing out nothing. You need to put
console=TRUE
inside the function, so it prints out automatically.For example: