On this version, you can find “Groups, Treatments and means” matrix on the bottom of the result table below. The value of first column of “Groups, Treatments and means” are “a,ab,b”. If two group means are the same, you will see the same letter. The second column are group number. The other column are gruop means. So the first column of group 3 and 1 are “a” and “ab”. They all have the letter “a” and indicate there is no difference between this two group means. But group 3 and group 2 are “a” and “b”, these two group means may be different. You can also see the same matrix when you run “Scheffe” analysis.
df <- anova(rst)['Df']['Residuals',]
MSerror <- anova(rst)['Mean Sq']['Residuals',]
HSD.test(dta$x, dta$grp, df, MSerror,console=TRUE)
##
## Study: dta$x ~ dta$grp
##
## HSD Test for dta$x
##
## Mean Square Error: 2
##
## dta$grp, means
##
## dta.x std r Min Max
## 1 13 1.414214 2 12 14
## 2 13 1.732051 3 11 14
## 3 17 1.000000 3 16 18
##
## alpha: 0.05 ; Df Error: 5
## Critical Value of Studentized Range: 4.601725
##
## Harmonic Mean of Cell Sizes 2.571429
## Honestly Significant Difference: 4.05834
##
## Means with the same letter are not significantly different.
##
## Groups, Treatments and means
## a 3 17
## ab 1 13
## b 2 13