Why is Matlab signrank function returns the same signed rank statistic values when flipping the signs of the data points?

5 ビュー (過去 30 日間)
Tim
Tim 2013 年 4 月 18 日
回答済み: Armando Angulo 2017 年 11 月 23 日
Why is Matlab signrank function returns the same signed rank statistic values when flipping the signs of the data points?
I have a sequence of data points stored in vector x. I use signrank(x) to do sign rank test.
Matlab says
When you use the test for one sample, then W is the sum of the ranks of positive differences between the observations and the hypothesized median value M0 (which is 0 when you use signrank(x) and m when you use signrank(x,m)).
So I think the result signrank(x) and signrank(-x) should be different. But I have experienced some examples, and I get the same sign rank statistic value for x and -x. How is the signed rank statistic defined in Matlab signrank function?
Thanks!

回答 (1 件)

Armando Angulo
Armando Angulo 2017 年 11 月 23 日
I don't Know how matlab computes signrank, but the result it should be the same for x and -x because probability is compute with the smallest values of the independent sum of negative and positive ranks. So, in case x: negative sum = 8 positive sum = 16 you take 8 as W stat for compute p value
In contrast, in case -x: negative sum = 16 positive sum = 8 you take 8 as W stat for compute p value

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by