比较ggpubr中的_平均值是否给出了不正确的p值?

比较ggpubr中的_平均值是否给出了不正确的p值?,r,ggpubr,R,Ggpubr,我正在用ggpubr中的ggboxplot创建一个箱线图。然而,compare\u给出的p值意味着(0.08,如下代码所示)与我手工计算的值(0.1)不同。我使用这个函数有什么问题吗?为什么会出现这种差异 library(data.table) library(ggpubr) compare_means(ratio ~ type, data = plt2, method = 'wilcox.test') # # A tibble: 1 x 8 # .y. group1 group2

我正在用
ggpubr
中的
ggboxplot
创建一个箱线图。然而,
compare\u给出的p值意味着
(0.08,如下代码所示)与我手工计算的值(0.1)不同。我使用这个函数有什么问题吗?为什么会出现这种差异

library(data.table)
library(ggpubr)

compare_means(ratio ~ type, data = plt2, method = 'wilcox.test')
# # A tibble: 1 x 8
#     .y. group1 group2         p     p.adj p.format p.signif   method
#   <chr>  <chr>  <chr>     <dbl>     <dbl>    <chr>    <chr>    <chr>
# 1 ratio    Mut     WT 0.0808556 0.0808556    0.081       ns Wilcoxon

wilcox.test(plt2[type == 'WT', ratio], plt2[type == 'Mut', ratio])
#
#   Wilcoxon rank sum test
#
# data:  plt2[type == "WT", ratio] and plt2[type == "Mut", ratio]
# W = 0, p-value = 0.1
# alternative hypothesis: true location shift is not equal to 0
编辑 正如Jimbou所评论的,
ggpubr
set
exact=FALSE
when do
wilcox.text
。这导致了上述差异。

Try
wilcox.test(d[type=='WT',ratio],d[type=='Mut',ratio],exact=F)
Try
wilcox.test(d[type=='WT',ratio],d[type=='Mut',ratio],exact=F)
>dput(plt2)
structure(list(type = c("Mut", "WT", "Mut", "WT", "Mut", "WT"
), rep.bio = c("v1", "v1", "v2", "v2", "v3", "v3"), ratio = c(1.22480885484374,
1.01644732404719, 1.37027369557587, 1.16227329691363, 1.20888766223709,
1.08816776516)), row.names = c(NA, -6L), class = c("data.table",
"data.frame"), .Names = c("type", "rep.bio", "ratio"))

#    type rep.bio    ratio
# 1:  Mut      v1 1.224809
# 2:   WT      v1 1.016447
# 3:  Mut      v2 1.370274
# 4:   WT      v2 1.162273
# 5:  Mut      v3 1.208888
# 6:   WT      v3 1.088168