I am use to conducting Tukey post-hoc tests in minitab. When I do, I usually get family grouping of the dependent/predictor variables.
In R, using TukeyHSD() the family grouping is not displayed (or calculated?). It only displays the relationship between each of the dependent/predictor variables. Is it possible to display the family groupings like in minitab?
Using the diamonds data set:
av <- aov(price ~ cut, data = diamonds)
tk <- TukeyHSD(av, ordered = T, which = "cut")
plot(tk)
Output:
Fit: aov(formula = price ~ cut, data = diamonds)
$cut
diff lwr upr p adj
Good-Ideal 471.32248 300.28228 642.3627 0.0000000
Very Good-Ideal 524.21792 401.33117 647.1047 0.0000000
Fair-Ideal 901.21579 621.86019 1180.5714 0.0000000
Premium-Ideal 1126.71573 1008.80880 1244.6227 0.0000000
Very Good-Good 52.89544 -130.15186 235.9427 0.9341158
Fair-Good 429.89331 119.33783 740.4488 0.0014980
Premium-Good 655.39325 475.65120 835.1353 0.0000000
Fair-Very Good 376.99787 90.13360 663.8622 0.0031094
Premium-Very Good 602.49781 467.76249 737.2331 0.0000000
Premium-Fair 225.49994 -59.26664 510.2665 0.1950425
Picture added to help clarify my response to Maruits's comment:


Here is a step-by-step example on how to reproduce minitab's table for the
ggplot2::diamondsdataset. I've included details/explanation as much as possible.Please note that as far as I can tell, results shown in minitab's table are not dependent/related to results from Tukey's post-hoc test; they are based on results from the analysis of variance. Tukey's honest significant difference (HSD) test is a post-hoc test that establishes which comparisons (of all the possible pairwise comparisons of group means) are (honestly) statistically significant, given the ANOVA results.
In order to reproduce minitabs "mean-grouping" summary table (see the first table of "Interpret the results: Step 3" of the minitab Express Support), I recommend (re-)running a linear model to extract means and confidence intervals. Note that this is exactly how
aovfits the analysis of variance model for each group.Fit a linear model
We specify a
0offset to get absolute estimates for every group (rather than estimates for the changes relative to an offset).Determine family groupings
In order to obtain something similar to minitab's "family groupings", we adopt the following approach:
We start by calculating the confidence interval and cluster the resulting distance matrix using hierarchical clustering using complete linkage.
We inspect the cluster dendrogram
We now cut the tree at a height corresponding to the standard deviation of all CIs across all parameter estimates to get the "family groupings"
Summarise results
Finally, we collate all quantities and store results in a table similar to minitab's "mean-grouping" table.
Note the near-perfect agreement of our results with those from the minitab "mean-grouping" table:
cut = Idealis by itself in group3(groupCin minitab's table), whileFair+Premiumshare group1(minitab: groupA), andGood+Very Goodshare group2(minitab: groupB).