Test for median.
Perform a signtest of the null hypothesis that x is from a distribution that has a zero median.
If the second argument m is a scalar, the null hypothesis is that X has median m.
If the second argument y is a vector, the null hypothesis is that
the distribution of x - y
has zero median.
The argument "alpha"
can be used to specify the significance level
of the test (the default value is 0.05). The string
argument "tail"
, can be used to select the desired alternative
hypotheses. If "alt"
is "both"
(default) the null is
tested against the two-sided alternative median (x) != m
.
If "alt"
is "right"
the one-sided
alternative median (x) > m
is considered.
Similarly for "left"
, the one-sided alternative median
(x) < m
is considered. When "method"
is "exact"
the p-value is computed using an exact method (this is the default). When
"method"
is "approximate"
a normal approximation is used for the
test statistic.
The p-value of the test is returned in pval. If h is 0 the null hypothesis is accepted, if it is 1 the null hypothesis is rejected. stats is a structure containing the value of the test statistic (sign) and the value of the z statistic (zval) (only computed when the ’method’ is ’approximate’.
Package: statistics