pingouin.wilcoxon

pingouin.
wilcoxon
(x, y, tail='twosided')[source] Wilcoxon signedrank test. It is the nonparametric version of the paired Ttest.
 Parameters
 x, yarray_like
First and second set of observations. x and y must be related (e.g repeated measures).
 tailstring
Specify whether to return ‘onesided’ or ‘twosided’ pvalue.
 Returns
 statspandas DataFrame
Test summary
'Wval' : Wvalue 'pval' : pvalue 'RBC' : matched pairs rankbiserial correlation (effect size) 'CLES' : common language effect size
Notes
The Wilcoxon signedrank test tests the null hypothesis that two related paired samples come from the same distribution. A continuity correction is applied by default (see
scipy.stats.wilcoxon()
for details).The rank biserial correlation is the difference between the proportion of favorable evidence minus the proportion of unfavorable evidence (see Kerby 2014).
The common language effect size is the probability (from 0 to 1) that a randomly selected observation from the first sample will be greater than a randomly selected observation from the second sample.
Warning
Versions of Pingouin below 0.2.6 gave wrong twosided pvalues for the Wilcoxon test. Pvalues were accidentally squared, and therefore smaller. This issue has been resolved in Pingouin>=0.2.6. Make sure to always use the latest release.
References
 1
Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics bulletin, 1(6), 8083.
 2
Kerby, D. S. (2014). The simple difference formula: An approach to teaching nonparametric correlation. Comprehensive Psychology, 3, 11IT.
 3
McGraw, K. O., & Wong, S. P. (1992). A common language effect size statistic. Psychological bulletin, 111(2), 361.
Examples
Wilcoxon test on two related samples.
>>> import numpy as np >>> import pingouin as pg >>> x = [20, 22, 19, 20, 22, 18, 24, 20, 19, 24, 26, 13] >>> y = [38, 37, 33, 29, 14, 12, 20, 22, 17, 25, 26, 16] >>> pg.wilcoxon(x, y, tail='twosided') Wval pval RBC CLES Wilcoxon 20.5 0.285765 0.333 0.583
Compare with SciPy
>>> import scipy >>> scipy.stats.wilcoxon(x, y, correction=True) WilcoxonResult(statistic=20.5, pvalue=0.2857652190231508)