Categories &

Functions List

Function Reference: signrank

statistics: pval = signrank (x)
statistics: pval = signrank (x, my)
statistics: pval = signrank (x, my, Name, Value)
statistics: [pval, h] = signrank (…)
statistics: [pval, h, stats] = signrank (…)

Wilcoxon signed rank test for median.

pval = signrank (x) returns the p-value of a two-sided Wilcoxon signed rank test. It tests the null hypothesis that data in x come from a distribution with zero median at the 5% significance level under the assumption that the distribution is symmetric about its median. x must be a vector.

If the second argument my is a scalar, the null hypothesis is that x has median my, whereas if my is a vector, the null hypothesis is that the distribution of x - my has zero median.

pval = signrank (…, Name, Value) performs the Wilcoxon signed rank test with additional options specified by one or more of the following Name, Value pair arguments:

NameValue
"alpha"A scalar value for the significance level of the test. Default is 0.05.
"tail"A character vector specifying the alternative hypothesis. It can take one of the following values:
ValueDescription
"both"For one-sample test (my is empty or a scalar), the data in x come from a continuous distribution with median different than zero or my. For two-sample test (my is a vector), the data in x - my come from a continuous distribution with median different than zero.
"left"For one-sample test (my is empty or a scalar), the data in x come from a continuous distribution with median less than zero or my. For two-sample test (my is a vector), the data in x - my come from a continuous distribution with median less than zero.
"right"For one-sample test (my is empty or a scalar), the data in x come from a continuous distribution with median greater than zero or my. For two-sample test (my is a vector), the data in x - my come from a continuous distribution with median greater than zero.
NameValue
"method"A character vector specifying the method for computing the p-value. It can take one of the following values:
ValueDescription
"exact"Exact computation of the p-value. It is the default value for 15 of fewer observations when "method" is not specified.
"approximate"Using normal approximation for computing the p-value. It is the default value for more than 15 observations when "method" is not specified.

[pval, h] = signrank (…) also returns a logical value indicating the test decision. If h is 0, the null hypothesis is accepted, whereas if h is 1, the null hypothesis is rejected.

[pval, h, stats] = signrank (…) also returns the structure stats containing the following fields:

FieldValue
signedrankValue of the sign rank test statistic.
zvalValue of the z-statistic (only computed when the "method" is "approximate").

See also: tiedrank, signtest, runstest

Source Code: signrank