Wilcoxon-Mann-Whitney秩和检验ranksumtest(或testU)

更新时间:2023-08-02 19:41:25 阅读: 评论:0

Wilcoxon-Mann-Whitney秩和检验ranksumtest(或testU)
⽐较两个独⽴样本群组的平均值,这⾥不需要假设总体为Gaussian类型分布;这也称作Mann-Whitney U-test
抹茶千层蛋糕你想要看看两个⾜球队在⼀年进球数均值是否⼀样。以下为每个队在⼀年6场⽐赛中的进球数:
一级期刊Team A: 6, 8, 2, 4, 4, 5
Team B: 7, 10, 4, 3, 5, 6
Wilcoxon-Matt-Whitney test (or Wilcoxon rank sum test, orMann-Whitney U-test) ⽤于⽐较两个并不满⾜正态分布群组的均值⽐较:这是⼀个⾮参数检验(non-parametrical test)。其与应⽤于独⽴样本的t-test相当。光大水墨风景
让我们看看如何在R中解决这个我问题:
a = c(6, 8, 2, 4, 4, 5)
b = c(7, 10, 4, 3, 5, 6)
Wilcoxon rank sum test
data: a and b
径字组词
W = 14, p-value = 0.5174
alternative hypothesis: true location shift is not equal to 0
p-value⼤于0.05,因此我们可接受null hypothesis H0,即两个群组的均值统计相等。如果你运⾏ st(b, a, correct = FALSE),p-value在逻辑上将会是⼀样的:
a = c(6, 8, 2, 4, 4, 5)
b = c(7, 10, 4, 3, 5, 6)
Wilcoxon rank sum test
data: b and a
鲍鱼怎么做最简便最好吃呢W = 22, p-value = 0.5174
alternative hypothesis: true location shift is not equal to 0
⽽值W的计算如下:
sum.rank.a = sum(rank(c(a,b))[1:6]) #sum of ranks assigned to the group a
W = sum.rank.a – (length(a)*(length(a)+1)) / 2
W
[1] 14
sum.rank.b = sum(rank(c(a,b))[7:12]) #sum of ranks assigned to the group b
W = sum.rank.b – (length(b)*(length(b)+1)) / 2
W
[1] 22
最后我们⽐较对独⽴样本Wilcoxon的表上查表得到的区间。对两个6个样本群组查表得到的区间是(26,52),⽽我们样本的区间为:秋处露秋寒霜降是指哪六个节气
sum(rank(c(a,b))[1:6]) #sum of ranks assigned to the group a
[1] 35
sum(rank(c(a,b))[7:12]) #sum of ranks assigned to the group b
[1] 43
因为计算的区间(35, 43)包含在查表区间(26,52),我们论断接受null hypothesis H0,即均值相等
过年日记100字=========================================================
在使⽤函数st,以下的输⼊参数形式才是使⽤了rank sum检验⽅法:
Wilcoxon rank sum test with continuity correction
data:  a and b
W = 14, p-value = 0.5711
alternative hypothesis: true location shift is not equal to 0
#------------------------------------------
Wilcoxon rank sum test with continuity correction
data:  b and a
甜蜜暴君W = 22, p-value = 0.5711
alternative hypothesis: true location shift is not equal to 0
这⾥求得的两个W值分别是低尾部值和⾼尾部值,我们可以⽤以下函数获得接受区间:
qwilcox(0.025, length(a), length(b), lower.tail=T)
[1] 6
qwilcox(0.025, length(a), length(b), lower.tail=F)
[1] 30
之前计算的W值区间(14, 22)在[6,30]范围内,所以我们接受null hypothesis,即a和b的均值显著相等。

本文发布于:2023-08-02 19:41:25,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/1126981.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:区间   群组   均值   查表   总体
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图