我做了单向方差分析和 Tukey 测试。我尝试将 Tukey 测试中的 p 值添加到箱线图,但箱线图上的值不同。我使用了以下包和代码:`library(ggplot2) library(ggpubr) library(rstatix)
CR.anova <- aov( CR ~ Group, data = df)
summary(CR.anova)
tukey_hsd(CR.anova)
term group1 group2 estimate conf.low conf.high p.adj p.adj.signif
* <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr>
1 Group K02 K12 -1.90 -3.14 -0.660 0.00105 **
2 Group K02 BASELINE 0.153 -1.06 1.37 0.987 ns
3 Group K02 PLACEBO 0.239 -1.00 1.48 0.955 ns
4 Group K12 BASELINE 2.05 0.838 3.27 0.000286 ***
5 Group K12 PLACEBO 2.14 0.898 3.38 0.000215 ***
6 Group BASELINE PLACEBO 0.0861 -1.13 1.30 0.998 ns `
箱线图上的结果如下:
ggboxplot ( Metabolite.data, x= "Group", y= "CRP",color = "black", title = "CRP" ,ylab = "Normalized value", rug = TRUE,
legend = "right", font.label = list(size = 40, face = "bold"), linetype = "solid", size = 1.1,
palette = c("#cc3300","#E7B800","#99ccff", "#003366"),fill= "Group", order = c("BASELINE", "PLACEBO", "K02","K12"),
bxp.errorbar= TRUE , alpha= 0.6) + border(color = "black", size= 2)+
geom_jitter(aes(fill= Group),shape = 21, size = 4,color = "black", stroke= 1, position = position_jitter()) +
theme (plot.title = element_text(hjust=0.5 , face = "bold", size = 20 ),axis.text = element_text(face = "bold"))+
theme (axis.title.x=element_blank())+
theme (axis.title.y = element_text(face = "bold", size= 16 ))+
theme(legend.position = "none")+ stat_boxplot(geom ="errorbar",size= 1.1, width= 0.4)+
stat_compare_means(comparisons = CRP_comparisons)
如何可视化出现在箱线图上 tukey 测试中的相同 p 值? 在此处输入图像描述