Plot a universal confidence interval of each group mean
Visiualize significant differences in a plot with one confidence interval per group instead of all pairwise confidence intervals.
comparison_name : string, optional
ax : matplotlib axis, optional
figsize : tuple, optional
xlabel : string, optional
ylabel : string, optional
fig : Matplotlib Figure object
Multiple comparison tests are nice, but lack a good way to be visualized. If you have, say, 6 groups, showing a graph of the means between each group will require 15 confidence intervals. Instead, we can visualize inter-group differences with a single interval for each group mean. Hochberg et al.  first proposed this idea and used Tukey’s Q critical value to compute the interval widths. Unlike plotting the differences in the means and their respective confidence intervals, any two pairs can be compared for significance by looking for overlap.
|[R18]||Hochberg, Y., and A. C. Tamhane. Multiple Comparison Procedures. Hoboken, NJ: John Wiley & Sons, 1987.|
>>> from statsmodels.examples.try_tukey_hsd import cylinders, cyl_labels >>> from statsmodels.stats.multicomp import MultiComparison >>> cardata = MultiComparison(cylinders, cyl_labels) >>> results = cardata.tukeyhsd() >>> results.plot_simultaneous() <matplotlib.figure.Figure at 0x...>
This example shows an example plot comparing significant differences in group means. Significant differences at the alpha=0.05 level can be identified by intervals that do not overlap (i.e. USA vs Japan, USA vs Germany).
>>> results.plot_simultaneous(comparison_name="USA") <matplotlib.figure.Figure at 0x...>
Optionally provide one of the group names to color code the plot to highlight group means different from comparison_name.