【Wilcoxon 检验】威尔科克森秩检验[非参数检验](Matlab代码实现)

👨‍🎓个人主页:研学社的博客  

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现


💥1 概述

假设数据是关于坐标原点对称,那么对称中心两侧的数据疏密程度应一致,取正值数据在绝对值样本中的秩和与取负值在绝对值样本中的秩和相近。

​ 

​ 

📚2 运行结果

​ 

​  部分代码:

function [dist, w] = wilcoxon_dist_groups(pH0, Neq0, T, strateq0)

N = Neq0 + sum(T);
w = (0:0.5:(N*(N+1)/2));  % range of possible values
dist = zeros(size(w));

ranks = Neq0+cumsum(T)-0.5*(T-1);  % ranks for non-zero groups

% handle 0's
if Neq0 > 0
  switch strateq0
    case 'Wilcoxon'
      % after Wilcoxon 1945 "Individual Comparisons by Ranking
      % Methods":
      % discard 0's and adjust remaining ranks by subtracting Neq0
      %
      % adjust the ranks
      ranks = ranks - Neq0;
      % The ranksum resulting from the Neq 0's is R = 0
      dist(1) = 1;
    case 'Pratt'
      % after Pratt 1959 "Remarks on Zeros and Ties in the Wilcoxon
      % Signed Rank Procedures":
      % discard 0's and without adjusting the remaining ranks.
      
      % The ranksum resulting from the Neq 0's is R = 0
      dist(1) = 1;
    case 'Marascuilo'
      % after Marascuilo 1977 "Nonparametric and Distribution-free
      % Methods for the Social Sciences":
      % shared rank of the 0's is accounted by one half to the ranksum
      %
      % The first Neq0 values share the rank (1 + 2 + ... + Neq0)/ Neq0
      % = (Neq0+1)/2. Their ranksum is R = Neq*(Neq0+1)/4
      Req0 = Neq0*(Neq0+1)/4;
      dist(2*Req0+1) = 1;
  end
else
  dist(1) = 1;
end

% handle remaining ranks for non-zero values
for rdx=1:length(T)
  shift = 2*ranks(rdx);
  for tdx=1:T(rdx)
    dist = pH0*dist + (1-pH0).*[zeros(1,shift),dist(1:end-shift)];
  end
end
 

🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1]林跃东.基于威尔科克森符号秩检验用能权核查数据分析[J].化学工程与装备,2021(09):187-189.DOI:10.19566/j.cnki.cn35-1285/tq.2021.09.086.

🌈4 Matlab代码实现

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荔枝科研社

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值