Wilcoxon signed-ranks test with R vs by hand、Multiple Wilcoxon Signed Rank test in R和Wilcoxon signed rank test for heavily tied data。
我有两个数据集,我正在根据通过亲和矩阵和简单比率指数计算的特定权重创建物种之间的成对关联。我想测试测试组之间的重量是否不同。这是我尝试过的,但我没有得到实际的输出。任何建议都非常感谢!
数据集1
dat1 <- structure(list(5, FALSE, c(1, 3, 4, 2, 3, 4, 3, 4, 4), c(0, 0,
0, 1, 1, 1, 2, 2, 3), c(0, 3, 1, 4, 6, 2, 5, 7, 8), c(0, 1, 2,
3, 4, 5, 6, 7, 8), c(0, 0, 1, 2, 5, 9), c(0, 3, 6, 8, 9, 9),
list(c(1, 0, 1), structure(list(), names = character(0)),
list(name = c("BABO", "BW", "MANG", "RC", "SKS"), n_obs = c(219L,
1377L, 197L, 1881L, 1232L), n_grps = c(34L, 535L, 61L,
665L, 339L)), list(weight = c(0.227890554864407, 0.291851490123247,
0.222986891666136, 0.273019105913787, 0.270047304490458,
0.308713136488867, 0.31127336565632, 0.313224653422152,
0.270579464114338))), <environment>), class = c("tbl_graph",
"igraph"), active = "nodes")
数据集2
dat2 <- structure(list(5, FALSE, c(4, 3, 3, 4, 4), c(0, 1, 2, 2, 3),
c(1, 2, 0, 3, 4), c(0, 1, 2, 3, 4), c(0, 0, 0, 0, 2, 5),
c(0, 1, 2, 4, 5, 5), list(c(1, 0, 1), structure(list(), names = character(0)),
list(name = c("BABO", "BW", "MANG", "RC", "SKS"), n_obs = c(23L,
8L, 117L, 29L, 668L), n_grps = c(2L, 6L, 21L, 10L, 25L
)), list(weight = c(0.282369461120595, 0.321658527239868,
0.307638016777122, 0.322400613641658, 0.342550960146532
))), <environment>), class = c("tbl_graph", "igraph"), active = "nodes")
pairwise.wilcox.test(dat1$weight, dat2$weight) -> wilcox.test
我的代码运行,但没有输出。
1条答案
按热度按时间rryofs0p1#
示例中的数据采用igraph / tbl_graph格式。这个数据结构很复杂,但是你可以提取权重来比较它们,例如:
创建于2023-05-12带有reprex v2.0.2