gpt4 book ai didi

Python 威尔科克森 : unequal N

转载 作者:太空狗 更新时间:2023-10-30 00:54:51 25 4
gpt4 key购买 nike

Rs wilcox.test 可以采用不同的长度向量,但是 scipy.stats 中的 wilcoxon 不能:我收到 unequal N 错误消息.

from scipy.stats import wilcoxon
wilcoxon(range(10), range(12))

有没有办法在 Python 中获得 Rs 行为?

最佳答案

根据 R 文档:

Performs one- and two-sample Wilcoxon tests on vectors of data; the latter is also known as ‘Mann-Whitney’ test.

所以就用

from scipy.stats import mannwhitneyu
mannwhitneyu(range(10), range(12))
# (50.0, 0.26494055917435472)

关于Python 威尔科克森 : unequal N,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33890367/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com