Wilcoxon

版本 2.0.0.0 (148.8 KB) 作者: Giuseppe Cardillo
non parametric Wilcoxon test for two paired samples
6.6K 次下载
更新时间 2018/3/23

Non parametric Wilcoxon test to evaluate the difference between paired (dependent) samples.
If the number of difference is less than 15, the algorithm calculate the exact ranks distribution;
else it uses a normal distribution approximation.
Now, the MatLab function SIGNRANK returns the same p-value.
Anyway, this Wilcoxon function gives a more detailed output (that is necessary for publications...)
Syntax: STATS=WILCOXON(X1,X2,PLTS)

Inputs:
X1 and X2 - data vectors.
ALPHA - significance level (default = 0.05).
PLTS - Flag to set if you don't want (0) or want (1) view the plots
Outputs:
- W value and p-value when exact ranks distribution is used.
- W value, Z value, Standard deviation (Mean=0), p-value when normal distribution is used
If STATS nargout was specified the results will be stored in the STATS
struct.

Example:

X1=[77 79 79 80 80 81 81 81 81 82 82 82 82 83 83 84 84 84 84 85 85 86 86 87 87];

X2=[82 82 83 84 84 85 85 86 86 86 86 86 86 86 86 86 87 87 87 88 88 88 89 90 90];

Calling on Matlab the function: wilcoxon(X1,X2)

Answer is:

WILCOXON TEST

Mean_of_differences Confidence_interval
___________________ ___________________

Binomial_estimator 3 3 4
Hodges_Lehmann_estimator 3.5 3 4

Sample size is good enough to use the normal distribution approximation

W Mean SD Z p_value_two_tails
___ ____ ______ ______ _________________

325 0 73.161 4.4354 9.1886e-06

Created by Giuseppe Cardillo
giuseppe.cardillo-edta@poste.it

To cite this file, this would be an appropriate format:
Cardillo G. (2006). Wilcoxon test: non parametric Wilcoxon test for paired samples.
http://www.mathworks.com/matlabcentral/fileexchange/12702

引用格式

Giuseppe Cardillo (2024). Wilcoxon (https://github.com/dnafinder/wilcoxon), GitHub. 检索时间: .

MATLAB 版本兼容性
创建方式 R2014b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Hypothesis Tests 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

无法下载基于 GitHub 默认分支的版本

版本 已发布 发行说明
2.0.0.0

inputparser; table implementation; some minor bugs correction; github link

1.10.0.0

bug correction in normal approximation p-value

1.9.0.0

the Hodges-Lehmann estimator of median of differences was added

1.8.0.0

I added the plts flag to choose to show the plots

1.7.0.0

Changes in description

1.6.0.0

Changes in help and description sections

1.5.0.0

the STATS struct nargout was added

1.4.0.0

The output and the error handling were changed

1.3.0.0

bug correction

1.2.0.0

Little correction in help section to allow a correct copy and paste of the example. Correction in exitus subroutine.

1.1.0.0

Changes in help section

1.0.0.0

Improvement in input error handling

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库