zval in signrank test
Mostrar comentarios más antiguos
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!
Respuesta aceptada
Más respuestas (2)
the cyclist
el 15 de Oct. de 2011
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
el 15 de Oct. de 2011
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.
Categorías
Más información sobre Hypothesis Tests en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!