👨🎓个人主页:研学社的博客
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥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.