Wilcoxon

non parametric Wilcoxon test for two paired samples
6.5K descargas
Actualizado 23 Mar 2018

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

Citar como

Giuseppe Cardillo (2024). Wilcoxon (https://github.com/dnafinder/wilcoxon), GitHub. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2014b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!

No se pueden descargar versiones que utilicen la rama predeterminada de GitHub

Versión Publicado Notas de la versión
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

Para consultar o notificar algún problema sobre este complemento de GitHub, visite el repositorio de GitHub.
Para consultar o notificar algún problema sobre este complemento de GitHub, visite el repositorio de GitHub.