ranksum
Wilcoxon rank sum test for equal medians. This test is equivalent to a Mann-Whitney U-test.
p = ranksum (x, y)
returns the p-value of a
two-sided Wilcoxon rank sum test. It tests the null hypothesis that two
independent samples, in the vectors X and Y, come from continuous
distributions with equal medians, against the alternative hypothesis that
they are not. x and y can have different lengths and the test
assumes that they are independent.
ranksum
treats NaN in x, y as missing values.
The two-sided p-value is computed by doubling the most significant one-sided
value.
[p, h] = ranksum (x, y)
also returns the
result of the hypothesis test with h = 1
indicating a rejection
of the null hypothesis at the default alpha = 0.05 significance level, and
h = 0
indicating a failure to reject the null hypothesis at the
same significance level.
[p, h, stats] = ranksum (x, y)
also
returns the structure stats with information about the test statistic.
It contains the field ranksum
with the value of the rank sum test
statistic and if computed with the "approximate" method it also contains the
value of the z-statistic in the field zval
.
[…] = ranksum (x, y, alpha)
or alternatively
[…] = ranksum (x, y, "alpha", alpha)
returns
the result of the hypothesis test performed at the significance level ALPHA.
[…] = ranksum (x, y, "method", M)
defines the
computation method of the p-value specified in M, which can be "exact",
"approximate", or "oldexact". M must be a single string. When "method"
is unspecified, the default is: "exact" when
min (length (x), length (y)) < 10
and
length (x) + length (y) < 10
, otherwise the "approximate"
method is used.
[…] = ranksum (x, y, "tail", tail)
defines the
type of test, which can be "both", "right", or "left". tail must be a
single string.
Note: the rank sum statistic is based on the smaller sample of vectors x and y.
Source Code: ranksum