Products & Services Industries Academia Support User Community Company

Learn more about Statistics Toolbox   

signrank - Wilcoxon signed rank test

Syntax

p = signrank(x)
p = signrank(x,m)
p = signrank(x,y)
[p,h] = signrank(...)
[p,h] = signrank(...,'alpha',alpha)
[p,h] = signrank(...,'method',method)
[p,h,stats] = signrank(...)

Description

p = signrank(x) performs a two-sided signed rank test of the null hypothesis that data in the vector x comes from a continuous, symmetric distribution with zero median, against the alternative that the distribution does not have zero median. The p-value of the test is returned in p.

p = signrank(x,m) performs a two-sided signed rank test of the null hypothesis that data in the vectors x and y are independent samples from a continuous, symmetric distribution with median m, against the alternative that the distribution does not have median m. m must be a scalar.

p = signrank(x,y) performs a paired, two-sided signed rank test of the null hypothesis that data in the vector x-y come from a continuous, symmetric distribution with zero median, against the alternative that the distribution does not have zero median. x and y must have equal lengths. Note that a hypothesis of zero median for x-y is not equivalent to a hypothesis of equal median for x and y.

[p,h] = signrank(...) returns the result of the test in h. h = 1 indicates a rejection of the null hypothesis at the 5% significance level. h = 0 indicates a failure to reject the null hypothesis at the 5% significance level.

[p,h] = signrank(...,'alpha',alpha) performs the test at the (100*alpha)% significance level. The default, when unspecified, is alpha = 0.05.

[p,h] = signrank(...,'method',method) computes the p-value using either an exact algorithm, when method is 'exact', or a normal approximation, when method is 'approximate'. The default, when unspecified, is the exact method for small samples and the approximate method for large samples.

[p,h,stats] = signrank(...) returns the structure stats with the following fields:

Examples

Test the hypothesis of zero median for the difference between two paired samples.

before = lognrnd(2,.25,10,1);
after = before+trnd(2,10,1);
[p,h] = signrank(before,after)
p =
   0.5566
h =
   0

The sampling distribution of the difference between before and after is symmetric with zero median. At the default 5% significance level, the test fails to reject to the null hypothesis of zero median in the difference.

References

[1] Gibbons, J. D. Nonparametric Statistical Inference. New York: Marcel Dekker, 1985.

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

See Also

ranksum, ttest, ztest

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS