我正在尝试用ggpubr
's可视化显着性水平(星号) stat_compare_means()
。我遇到了以下问题:与 相比compare_means()
,您不能将分组变量添加到比较中。例子:
ggbarplot(ToothGrowth, x = "dose", y = "len", add = "mean_se", color = "supp",
fill = "supp",position = position_dodge(0.8),add.params = list(group = "supp"))+
stat_compare_means(ref.group = "0.5", group.by = "supp",label = "p.signif")
如您所见,显着性水平并未显示在所有条形上方,而仅显示在不同剂量上方,因为 ggpubr 不区分不同的 supps。
有什么方法可以与这些(子)集进行比较吗?
谢谢