HSD.test with group=TRUE assigned different significance letters to all three groups in the PlantGrowth dataset, but when HSD.test is run again with group=FALSE, the control group shows no significant difference from the other treatments. Why would this occur, and does this mean the letter groupings from HSD.test don’t always indicate significant differences between groups?
My code is here
Anova<-aov(PlantGrowth$weight~PlantGrowth$group)
summary.aov(Anova)
HSD.1<-HSD.test(Anova, "PlantGrowth$group", alpha = .95, group=TRUE)
HSD.1
HSD.2<-HSD.test(Anova, "PlantGrowth$group", alpha = .95, group=FALSE)
HSD.2
Results from the grouped test
HSD.1<-HSD.test(Anova, “PlantGrowth$group”, alpha = .95, group=TRUE)
HSD.1
$statistics
MSerror Df Mean CV MSD
0.3885959 27 5.073 12.28809 0.0851231
$parameters
test name.t ntr StudentizedRange alpha
Tukey PlantGrowth$group 3 0.4318156 0.95
$means
PlantGrowth$weight std r se Min Max Q25 Q50 Q75
ctrl 5.032 0.5830914 10 0.1971284 4.17 6.11 4.5500 5.155 5.2925
trt1 4.661 0.7936757 10 0.1971284 3.59 6.03 4.2075 4.550 4.8700
trt2 5.526 0.4425733 10 0.1971284 4.92 6.31 5.2675 5.435 5.7350
$comparison
NULL
$groups
PlantGrowth$weight groups
trt2 5.526 a
ctrl 5.032 b
trt1 4.661 c
attr(,”class”)
[1] “group”
Results from ungrouped test
HSD.2<-HSD.test(Anova, “PlantGrowth$group”, alpha = .95, group=FALSE)
HSD.2
$statistics
MSerror Df Mean CV MSD
0.3885959 27 5.073 12.28809 0.0851231
$parameters
test name.t ntr StudentizedRange alpha
Tukey PlantGrowth$group 3 0.4318156 0.95
$means
PlantGrowth$weight std r se Min Max Q25 Q50 Q75
ctrl 5.032 0.5830914 10 0.1971284 4.17 6.11 4.5500 5.155 5.2925
trt1 4.661 0.7936757 10 0.1971284 3.59 6.03 4.2075 4.550 4.8700
trt2 5.526 0.4425733 10 0.1971284 4.92 6.31 5.2675 5.435 5.7350
$comparison
difference pvalue signif. LCL UCL
ctrl – trt1 0.371 0.3909 0.2858769 0.4561231
ctrl – trt2 -0.494 0.1980 -0.5791231 -0.4088769
trt1 – trt2 -0.865 0.0120 * -0.9501231 -0.7798769
$groups
NULL
attr(,”class”)
[1] “group”
I would expect, based on the grouped test, for trt1 and trt2 to be significantly different from the ctrl group, but the ungrouped test shows that only trt1 and trt2 are significantly different.
jtpugs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.