kassambara / rstatix

Pipe-friendly Framework for Basic Statistical Tests in R
https://rpkgs.datanovia.com/rstatix/
440 stars 50 forks source link

wilcox_test `p.adjust.method = "none"` option doesn't work and padj column missing #194

Open Rohit-Satyam opened 1 year ago

Rohit-Satyam commented 1 year ago

Dear @kassambara. Thanks for developing this package. It's easy to perform statistical test on multiple sample. But I have an observation (possibly a bug). When running the wilcox_test with p.adjust.method = "none", I expected the p values to be similar to wilcox.test function. However, your function returns adjusted p-values all the time. Also, the column is labeled as p not padj. Can you tell what's wrong ?

> rstatix::wilcox_test(perc ~ sample, data=df_rifin)
# A tibble: 1 × 7
  .y.   group1 group2    n1    n2 statistic        p
* <chr> <chr>  <chr>  <int> <int>     <dbl>    <dbl>
1 perc  16D    16R     3992  2747  6942812. 7.80e-83
> wilcox.test(perc ~ sample, data=df_rifin)

    Wilcoxon rank sum test with continuity correction

data:  perc by sample
W = 6942812, p-value < 2.2e-16
alternative hypothesis: true location shift is not equal to 0

> rstatix::wilcox_test(perc ~ sample, data=df_rifin, p.adjust.method = "none")
# A tibble: 1 × 7
  .y.   group1 group2    n1    n2 statistic        p
* <chr> <chr>  <chr>  <int> <int>     <dbl>    <dbl>
1 perc  16D    16R     3992  2747  6942812. 7.80e-83
> res<-wilcox.test(perc ~ sample, data=df_rifin)
> p.adjust(res$p.value)
[1] 7.796744e-83

Using rstatix_0.7.2 and R version 4.3.1