depictr.group_comparison_plot#

depictr.group_comparison_plot(data, x, group, title=None)#

Group means with confidence intervals over the raw points.

The estimate-with-uncertainty alternative to a bar chart: each group shows its raw observations (jittered), the mean, and a confidence interval for the mean. Showing the spread of the data alongside the estimate guards against reading too much into a difference in means.

Parameters:
  • data (pandas.DataFrame) – The data.

  • x (str) – Name of the numeric column being compared.

  • group (str) – The grouping column on the x-axis.

  • title (str, optional) – Plot title.

Return type:

plotnine.ggplot

Notes

The interval is a normal-approximation 95% confidence interval for the mean (mean plus or minus 1.96 standard errors). It describes the precision of the mean, not the spread of the data.