python 中Wilcoxon rank-sum 和 R 中的 wilcox.test
来源:互联网 发布:mac word 首选项 编辑:程序博客网 时间:2024/05/20 18:54
参考网页:http://stackoverflow.com/questions/12797658/pythons-scipy-stats-ranksums-vs-rs-wilcox-test
python scipy 中的 ranksums(x,y) 相当于
R中的 wilcox.text(x,y,exact=FALSE,correct=FALSE)
#### python code
x=[57.07168,46.95301,31.86423,38.27486,77.89309,76.78879,33.29809,58.61569,18.26473,62.92256,50.46951,19.14473,22.58552,24.14309]
y=[8.319966,2.569211,1.306941,8.450002,1.624244,1.887139,1.376355,2.521150,5.940253,1.458392,3.257468,1.574528,2.338976]
scipy.stats.ranksums(x, y)
(4.415880433163923, 1.0059968254463979e-05)
#### r code
x=c(57.07168,46.95301,31.86423,38.27486,77.89309,76.78879,33.29809,58.61569,18.26473,62.92256,50.46951,19.14473,22.58552,24.14309)
y=c(8.319966,2.569211,1.306941,8.450002,1.624244,1.887139,1.376355,2.521150,5.940253,1.458392,3.257468,1.574528,2.338976)
wilcox.test(x, y, exact=FALSE, correct=FALSE)
Wilcoxon rank sum test
data: x and y
W = 182, p-value = 1.006e-05
alternative hypothesis: true location shift is not equal to 0
Compute the Wilcoxon rank-sum statistic for two samples.
The Wilcoxon rank-sum test tests the null hypothesis that two sets of measurements are drawn from the same distribution. The alternative hypothesis is that values in one sample are more likely to be larger than the values in the other sample.
This test should be used to compare two samples from continuous distributions. It does not handle ties between measurements in x and y. For tie-handling and an optional continuity correction see scipy.stats.mannwhitneyu.
转载自:http://blog.sciencenet.cn/blog-468005-1022320.html
- python 中Wilcoxon rank-sum 和 R 中的 wilcox.test
- Wilcoxon-Mann-Whitney秩和检验/rank sum test(或test U)
- Wilcoxon signed-rank test(Wilcoxon符号秩检验)
- Wilcoxon符号秩检验/signed rank test
- R语言wilcoxon秩和检验及wilcoxon符号秩检验
- R语言笔记1:t检验和Wilcoxon检验
- R语言和Python中sort(),rank()和order()的各自区别(默认都是升序)
- R中rank函数使用
- Python中的rank()理解
- python中%s和%r
- R软件中排序:sort(),rank(),order()
- python 中的r+和w+注意细节
- python中的tile函数和sum函数
- python中%r和%s的区别
- python 中 u 和 r 加字符
- python中%s和%r的区别
- python中%r和%s的区别
- python中%r和%s的区别
- windows下的appium配置
- MRP List
- 问题汇总
- 获取安卓系统时间
- 数组,栈,队列,链表比较
- python 中Wilcoxon rank-sum 和 R 中的 wilcox.test
- 操作系统页面置换算法之FIFO,LRU
- vrrp原理
- 内存泄露如何调试
- 详解数据挖掘与机器学习的区别与联系
- Super product attributes configuration 可配置商品如何设置子商品的库存
- 课上认真听讲,课后马上忘记怎么办?
- 程序中的this
- 解决IDEA中输入法迟钝、选词框不出现