Statistics Toolbox | ![]() ![]() |
Syntax
Description
returns the significance probability that the medians of two matched samples, p = signtest(x,y,alpha)
x
and y
, are equal. x
and y
must be vectors of equal length. y
may also be a scalar; in this case, signtest
computes the probability that the median of x
is different from the constant y
. alpha
is the desired level of significance and must be a scalar between zero and one.
also returns the result of the hypothesis test, [p,h] = signtest(x,y,alpha)
h
. h
is 0
if the difference in medians of x
and y
is not significantly different from zero. h
is 1
if the two medians are significantly different.
p
is the probability of observing a result equally or more extreme than the one using the data (x
and y
) if the null hypothesis is true. p
is calculated using the signs (plus or minus) of the differences between corresponding elements in x
and y
. If p
is near zero, this casts doubt on this hypothesis.
also returns a structure [p,h,stats] = signtest(x,y,alpha)
stats
containing the field stats.sign
whose value is the sign statistic. For large samples, it also contains stats.zval
, the value of the normal (Z) statistic used to compute p
.
Example
This example tests the hypothesis of equality of medians for two samples generated with normrnd
. The samples have the same theoretical median but different standard deviations. (For the normal distribution, the mean and median are the same.)
See Also
ranksum
, signrank
, ttest
![]() | signrank | silhouette | ![]() |