필터 지우기
필터 지우기

Wilcoxon rank sum test

조회 수: 11 (최근 30일)
Mohsen  Davarynejad
Mohsen Davarynejad 2012년 5월 22일
I would like to check if my data is smaller than zero or not. Assume the following example.
A = -1*ones(15,1);
[p, h, Stats] = ranksum(A, zeros(15,1))
z-value < 1.96, So A is statistically smaller than zero. But if change the test like the following:
[p, h, Stats] = ranksum(A, zeros(14,1))
the z-value goes positive. Why is that?
  댓글 수: 1
Oleg Komarov
Oleg Komarov 2012년 5월 22일
MATLAB's ranksum is a two-sided test thus you're not testing for something smaller than zero but different from zero.

댓글을 달려면 로그인하십시오.

채택된 답변

the cyclist
the cyclist 2012년 5월 23일
The reason you get a positive z-score for
ranksum(A, zeros(14,1))
is that the z-score is based on ranks of the smaller sample relative to the larger sample. So, it is the ranks of zeros relative to A , and you get higher ranks.
The reason you get a negative z-score for
ranksum(A, zeros(15,1))
is that when the two input vectors have equal sample size, MATLAB arbitrarily bases the z-score on first input (A) relative to the second (zeros), so you get the negative z-score
You can see all this in action if you set a breakpoint inside the ranksum() function. [Lines 70-78 in R2012a.]
  댓글 수: 1
Mohsen  Davarynejad
Mohsen Davarynejad 2012년 5월 23일
Ahhh, Yes, Thanks Cyclist!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by