non parametric Wilcoxon test for two paired samples

6.4K descargas

Actualizado 23 Mar 2018

De GitHub

Ver licencia en GitHub

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...)

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
- 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


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:


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

To cite this file, this would be an appropriate format:
Cardillo G. (2006). Wilcoxon test: non parametric Wilcoxon test for paired samples.

Citar como

Giuseppe Cardillo (2023). 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

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

bug correction in normal approximation p-value

the Hodges-Lehmann estimator of median of differences was added

I added the plts flag to choose to show the plots

Changes in description

Changes in help and description sections

the STATS struct nargout was added

The output and the error handling were changed

bug correction

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

Changes in help section

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.