Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Wilcoxon rank sum test

`p = ranksum(x,y)`

```
[p,h] =
ranksum(x,y)
```

```
[p,h,stats]
= ranksum(x,y)
```

`[___] = ranksum(x,y,Name,Value)`

returns
the `p`

= ranksum(`x`

,`y`

)* p*-value of a two-sided Wilcoxon rank sum test.

`ranksum`

tests
the null hypothesis that data in `x`

and `y`

are
samples from continuous distributions with equal medians, against
the alternative that they are not. The test assumes that the two samples
are independent. `x`

and `y`

can
have different lengths. `[___] = ranksum(`

returns
any of the output arguments in the previous syntaxes, for a rank sum
test with additional options specified by one or more `x`

,`y`

,`Name,Value`

)`Name`

,`Value`

pair
arguments.

`ranksum`

treats `NaN`

s in `x`

and `y`

as
missing values and ignores them.

For a two-sided test of medians with unequal sample sizes, the
test statistic that `ranksum`

returns is the rank
sum of the first sample.

[1] Gibbons, J. D., and S. Chakraborti. *Nonparametric
Statistical Inference*, 5th Ed., Boca Raton, FL: Chapman
& Hall/CRC Press, Taylor & Francis Group, 2011.

[2] Hollander, M., and D. A. Wolfe. *Nonparametric
Statistical Methods*. Hoboken, NJ: John Wiley & Sons,
Inc., 1999.

`kruskalwallis`

| `signrank`

| `signtest`

| `ttest2 `

Was this topic helpful?