首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pairwise.wilcox.test给出(我认为)错误的结果

pairwise.wilcox.test给出(我认为)错误的结果
EN

Stack Overflow用户
提问于 2014-04-16 10:49:54
回答 1查看 5.9K关注 0票数 3

我想做一个简单的配对wilcox测试与一个简单(但糟糕)的数据集。我有8个组和每个组的5个值(见下面的数据)。组位于"id“列中,而感兴趣的变量,在这种情况下,权重是”权重“。我试过的是:

代码语言:javascript
复制
pairwise.wilcox.test(dat$weight,dat$id, p.adj = "bonf")

这给了我以下的结果:

代码语言:javascript
复制
        286x306 286x339 286x574 547x286 574x519 574x542 574x547 587x210 589x286
286x339 0.36    -       -       -       -       -       -       -       -      
286x574 1.00    1.00    -       -       -       -       -       -       -      
547x286 0.36    1.00    0.36    -       -       -       -       -       -      
574x519 0.36    0.36    0.36    0.72    -       -       -       -       -      
574x542 0.36    0.36    0.36    0.36    0.36    -       -       -       -      
574x547 0.36    0.36    0.36    1.00    0.36    0.36    -       -       -      
587x210 1.00    1.00    1.00    0.36    0.36    1.00    0.36    -       -      
589x286 1.00    0.36    1.00    0.36    0.36    0.36    0.36    1.00    -      
WC      0.36    0.36    0.36    1.00    0.36    0.36    1.00    0.36    0.36  

我不明白-我相信我应该得到的是p值?我不认为小组之间没有任何差异,因为图表清楚地显示了它们。有人知道我做错了什么吗?我将非常感谢您的每一个帮助!

代码语言:javascript
复制
    id  weight  V3
1   286x306 110 1
2   286x306 126 1
3   286x306 121 1
4   286x306 115 1
5   286x306 105 1
6   286x339 194 2
7   286x339 181 2
8   286x339 200 2
9   286x339 140 2
10  286x339 142 2
11  286x574 143 3
12  286x574 136 3
13  286x574 118 3
14  286x574 151 3
15  286x574 124 3
16  547x286 280 4
17  547x286 225 4
18  547x286 192 4
19  547x286 273 4
20  547x286 221 4
21  574x519 331 5
22  574x519 332 5
23  574x519 301 5
24  574x519 320 5
25  574x519 280 5
26  574x542 81  6
27  574x542 89  6
28  574x542 103 6
29  574x542 94  6
30  574x542 93  6
31  574x547 222 7
32  574x547 203 7
33  574x547 243 7
34  574x547 223 7
35  574x547 227 7
36  587x210 140 8
37  587x210 145 8
38  587x210 103 8
39  587x210 137 8
40  587x210 95  8
41  589x286 125 9
42  589x286 120 9
43  589x286 108 9
44  589x286 126 9
45  589x286 119 9
46  WC  227 10
47  WC  228 10
48  WC  232 10
49  WC  221 10
50  WC  229 10
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-16 11:10:56

这是由于邦费罗尼校正,它调整p-值为您进行的测试数量。示例:

代码语言:javascript
复制
airquality$Month <- factor(airquality$Month, labels = month.abb[5:9])

#test without correction for multiple testing
res0 <- pairwise.wilcox.test(airquality$Ozone,airquality$Month, p.adj = "none")
#    May     Jun     Jul     Aug    
#Jun 0.19250 -       -       -      
#Jul 3e-05   0.01414 -       -      
#Aug 0.00012 0.02591 0.86195 -      
#Sep 0.11859 0.95887 0.00074 0.00325
#
#P value adjustment method: none 

#manual correction
m <- length(na.omit(c(res0$p.value)))
matrix(pmin(1, res0$p.value*m), ncol=ncol(res0$p.value))
#            [,1]      [,2]        [,3]       [,4]
#[1,] 1.000000000        NA          NA         NA
#[2,] 0.000299639 0.1413625          NA         NA
#[3,] 0.001208078 0.2590776 1.000000000         NA
#[4,] 1.000000000 1.0000000 0.007442604 0.03247955

#this gives the same
pairwise.wilcox.test(airquality$Ozone, airquality$Month, p.adj = "bonf")
#    May    Jun    Jul    Aug   
#Jun 1.0000 -      -      -     
#Jul 0.0003 0.1414 -      -     
#Aug 0.0012 0.2591 1.0000 -     
#Sep 1.0000 1.0000 0.0074 0.0325
#
#P value adjustment method: bonferroni 

您可能希望使用不太保守的更正(请参阅help("p.adjust")中的其他选项)。也许你可以调整错误发现率?

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23107297

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档