| Statistics Toolbox | Search  Help Desk |
| ranksum | Examples See Also |
Wilcoxon rank sum test that two populations are identical.
Syntax
p = ranksum(x,y,alpha)[p,h] = ranksum(x,y,alpha)
Description
p = ranksum(x,y,alpha) returns the significance probability that the populations generating two independent samples, x and y, are identical. x and y are vectors but can have different lengths; if they are unequal in length, x must be smaller than y. alpha is the desired level of significance and must be a scalar between zero and one.
[p,h] = ranksum(x,y,alpha) also returns the result of the hypothesis test, h. h is zero if the populations of x and y are not significantly different. h is one if the two populations are significantly different.
p is the probability of observing a result equally or more extreme than the one using the data (x and y) if the null hypothesis is true. If p is near zero, this casts doubt on this hypothesis.
Example
This example tests the hypothesis of equality of means for two samples generated withpoissrnd.
x = poissrnd(5,10,1);
y = poissrnd(2,20,1);
[p,h] = ranksum(x,y,0.05)
p =
0.0028
h =
1
See Also
signrank, signtest, ttest2