zval in signrank test

8 ビュー (過去 30 日間)
Jie Ning
Jie Ning 2011 年 10 月 13 日
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!

採用された回答

Jie Ning
Jie Ning 2011 年 10 月 16 日
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.
  1 件のコメント
the cyclist
the cyclist 2011 年 10 月 16 日
I think you are mistaken that this is a bug. It is true that the order of the input arguments does not affect the sign of the z-statistic. But, as I outlined in my own answer, that is to be expected.

サインインしてコメントする。

その他の回答 (2 件)

the cyclist
the cyclist 2011 年 10 月 15 日
You can see the exact calculation of zval by typing
>> edit signrank
The comments at the top of that file list references for the calculation.
I don't have experience using the test, but searching around the web a bit, I've found a few places that quoted negative values for the z-statistic, so I think that may be conventional. Here is one such site: http://www.unistat.com/guide/nonparametric-tests/paired-samples
I got curious, and did a bit more digging. If you look at the "Test procedure" section of the Wikipedia page on this test:
you'll see that Step 6 in the procedure is to take the smaller of the two rank sums: S = min(W+,W-). I'm guessing that this use of the minimum guarantees that the z-statistic will be negative, as it will be less than the expected value for the null hypothesis (as Walter alludes to).
You can see this test procedure reflected in the MATLAB code.

Walter Roberson
Walter Roberson 2011 年 10 月 15 日
The z value would be negative if the statistic is below the Expected Value.
This is the same, but approached a different way, as is stated outright at http://en.wikipedia.org/wiki/Standard_score#Calculation_from_raw_score, which says,
The quantity z represents the distance between the raw score and the population mean in units of the standard deviation. z is negative when the raw score is below the mean, positive when above.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by