df <- read.table(header=TRUE, text='
presence Var3 Var1 Var2
N 7.9 12.3 10.7
N 6.3 10.6 11.1
N 9.5 13.1 13.8
Y 33.2 13.4 12.9
Y 6.3 11.6 11.1
Y 14.5 13.8 12.9
')我运行一个wilcox.test,用于数据访问的多列。
test_pw<- lapply(2:4, function(x) pairwise.wilcox.test(df[[x]], df$presence, mu=0))我只能看到pvalue,但是我想获得更多关于测试的信息,比如V (W)
Pairwise comparisons using Wilcoxon rank sum test
data: df[[x]] and df$presence
H
N 0.31
P value adjustment method: holm 类似这样的东西
Wilcoxon signed rank test
data: df$Var1 by df$presence
V = 21, p-value = 0.03125
alternative hypothesis: true location shift is not equal to 0当我跑的时候
lapply(test_pw, summary)每个变量都是这样的:
[[3]]
Length Class Mode
method 1 -none- character
data.name 1 -none- character
p.value 1 -none- numeric
p.adjust.method 1 -none- character发布于 2017-03-27 21:33:59
我认为只需在函数中添加summary()就可以了。
test_pw<- lapply(3:5, function(x) summary(pairwise.wilcox.test(df[[x]], df$presence, mu=0)))https://stackoverflow.com/questions/43056780
复制相似问题