Skip to content
Prev 284817 / 398502 Next

Tukey HSD

On Feb 9, 2012, at 20:28 , jlpugh wrote:

            
Quite likely, this could all be done more elegantly (lapply springs to mind), and there could be something in there that won't work at all, but to point out the glaring obvious: If the grouping factor is in column 1, then shouldn't you have var2~var1 in the aov() call?
and, by the way, you _really_ do not want to go via capture.output to get at the p value. It is accessible from the summary(fm1) directly. For aov objects, it's like:

summary(fm1)[[1]]$"Pr(>F)"[1]

(for "lm" objects, try anova(fm)$"Pr(>F)"[1])