signrank
Wilcoxon signed rank test for median.
pval = signrank (x)
returns the -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:
Name | Value | |
---|---|---|
"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: |
Value | Description | |
---|---|---|
"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. |
Name | Value | |
---|---|---|
"method" | A character vector specifying the method for computing the -value. It can take one of the following values: |
Value | Description | |
---|---|---|
"exact" | Exact computation of the -value. It
is the default value for 15 of fewer observations when "method" is
not specified. | |
"approximate" | Using normal approximation for
computing the -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:
Field | Value | |
---|---|---|
signedrank | Value of the sign rank test statistic. | |
zval | Value of the -statistic (only computed
when the "method" is "approximate" ). |
See also: tiedrank, signtest, runstest
Source Code: signrank