我知道 stats::wilcox.test 和 stats::pairwise.wilcox.test 之间的主要区别是计算 p.adjust 值。该值仅由 stats::pairwise.wilcox.test 一步计算。但是当我收到以下代码错误时,有些东西是有线的。我希望得到相同的结果,但它得到了组大小的错误?!
df <- dataframe(group = c(rep("before",5), rep("after",5)),
a = runif(1:10),
b = runif(1:10),
c = runif(1:10))
#wilcox.test withour error
df %>%
summarise_each(funs(wilcox.test(.[group == "before"], .[group == "after"],
paired = TRUE)$p.value), vars = a:c)
#pairwise.wilcox.test with error
df %>%
summarise_each(funs(pairwise.wilcox.test(.[group == "before"], .[group == "after"])),
vars = a:c)