I created this boxplot but need different stats method p values
使用此代码,即函数stat_compare_means,但我想使用mannwhitney/非参数p值,因为数据不是正态分布的。
还有,我怎么能看到有哪些统计方法的选项可以使用?(帮助说明在Stat_compare_means中使用“method”-我希望能够看到将来可以用于不同测试的不同方法的列表
my_comparisons <- list (c("AA/AG","GG"))
df <- GDFSNP1_for_R
df %>%
drop_na(Genotype) %>%
pivot_longer(starts_with("GDF")) %>%
mutate(name = factor(name, c("GDFb", "GDFt6", "GDFt12"))) %>%
ggplot(. , aes(y = value, x = Genotype, group = Genotype, fill=Genotype)) +
facet_grid(~name, labeller = as_labeller(GDF_label)) +
geom_violin(width=0.9) +
geom_boxplot(width=0.1, alpha=0.2) +
stat_compare_means(comparisons = my_comparisons)
1条答案
按热度按时间4nkexdtk1#
不知道它在哪里被记录下来,但是如果你源代码
ggpubr:::.method_info
,你可以看看可用的方法。看起来非参数方法的选项是
"wilcox.test"
和"kruskal.test"
。我相信威尔科克斯和曼-惠特尼是一回事。