MATLAB: Zval in signrank test

signrankzval

Hi,
I am using signrank function and got confused on the zval in "stats" output. Isn't it the value of the z-statistic in the Wilcoxon test? But if we do
[p,h,stats]=signrank(1:50)
Shouldn't zval be positive? But what you'll get is -6.15. Moreover,
[p,h,stats]=signrank(1:50,3:52)
[p,h,stats]=signrank(3:52,1:50)
gives the same zval. Does anyone know how exactly is the zval computed and if its sign has a meaning?
Thank you!

Best Answer

Thank you for the responses. I do think there is a bug in computing the zval in signrank. It always gives negative values. Walter, you are right about the sign of z-values. But in matlab, it gives the same zvals even when I compute
[p,h,stats]=signrank(1:50,3:52)
[p,h,stats]=signrank(3:52,1:50),
which should definitely result in positive and negative z-val... But I checked several examples and found out that the absolute values of Matlab's zvals are correct. So only the sign is off.