RStudio 向箱线图中添加更多 p 值在组内,两个不同的时间

问题描述

我有这个箱线图,其中计算了一些 p 值。我想添加手动显示的其他计算 p 值(在组内,两个不同的时间) 我不需要所有的 p 值,只需要所示的那些。

Boxplot

这是代码

stat.test1 <- Test %>%
group_by(Time) %>%
t_test(value ~ group) %>%
adjust_pvalue(method = "none") %>%
add_significance("p.adj")

Test.Boxplot <- ggBoxplot(
Test,x = "Time",y = "value",color = "group",palette = c("#00AFBB","#E7B800")
)

stat.test1 <- stat.test1 %>%
add_xy_position(x = "Time",dodge = 0.8)

Test.Boxplot + 
stat_pvalue_manual(
stat.test1,label = "{p.adj}{p.adj.signif}",tip.length = 0,hide.ns = FALSE
)

这是我的数据:

structure(list(group = c("Experimentalgruppe","Kontrollgruppe","Experimentalgruppe","Kontrollgruppe"),value = c(2.1,1.3,0.8,2.3,1.6,1.4,1.7,1.2,2,2.2,1.9,2.1,9.3,10.7,9.1,8.3,4.9,6.5,5.6,10.4,7.4,4.2,14.9,7.2,7.9,8.6,8.5,11.4,1,1.8,1.5,2.4,2.7,3,12.8,10.8,11.5,8.8,9,7.8,10.3,12.5,11.7,9.7,5.3,12.6,7.7,9.6,13.3,3.2,2.6,1.1,2.9,3.1,7.3,7.6,9.9,6.4,10.5,5.2,12.3,8.7,6.2,12.2
),Time = structure(c(1L,1L,2L,3L,4L,5L,6L,6L),.Label = c("t0 pre","t0 post","t1 pre","t1 post","t2 pre","t2 post"),class = "factor")),row.names = c(NA,-108L
),class = "data.frame"

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)