The P value returned by scipy.stats.wilcoxon has nothing to do with the distribution of x or y , and also the difference between them. It is determined by Wilcoxon statistics (W like this at http://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test , or T like scipy ), which is supposed to follow the normal distribution. If you check the source (in ~ python_directory \ site-packages \ scipy \ stats \ morestats.py), you will find the last few lines of def wilcoxon() :
se = sqrt(se / 24) z = (T - mn) / se prob = 2. * distributions.norm.sf(abs(z)) return T, prob
and
mn = count*(count + 1.) * 0.25 se = count*(count + 1.) * (2. * count + 1.)
Where count is the number of nonzero differences between x and y .
So, to get a one-way p value, you just need prob/2. or 1-prob/2.
Examples: In Python :
>>> y1=[125,115,130,140,140,115,140,125,140,135] >>> y2=[110,122,125,120,140,124,123,137,135,145] >>> ss.wilcoxon(y1, y2) (18.0, 0.5936305914425295)
In R :
> wilcox.test(y1, y2, paired=TRUE, exact=FALSE, correct=FALSE) Wilcoxon signed rank test data: y1 and y2 V = 27, p-value = 0.5936 alternative hypothesis: true location shift is not equal to 0 > wilcox.test(y1, y2, paired=TRUE, exact=FALSE, correct=FALSE, alt='greater') Wilcoxon signed rank test data: y1 and y2 V = 27, p-value = 0.2968 alternative hypothesis: true location shift is greater than 0