Learn R Programming

reproducer (version 0.6.0)

pairedSignTest: pairedSignTest

Description

Computes the exact sign test for two dependent (paired) samples, the standard reference test for ordinal paired observations referenced by Munzel and Brunner (2002). It is based on the qualitative within-pair differences only: under the null hypothesis the number of positive differences among the non-tied pairs follows a Binomial(m, 0.5) distribution (equivalently, the shift algorithm of pairedRankTest applied with all absolute differences set to one). Tied pairs are discarded. The more efficient rank-based alternative is pairedRankTest.

Usage

pairedSignTest(x, y, alternative = c("two.sided", "greater", "less"))

Value

a list with components: nPositive (number of pairs with x > y), nNegative (number of pairs with x < y), nNonTied (number of non-tied pairs used by the test), p.value, method and alternative.

Arguments

x

a numeric vector of observations from the first condition.

y

a numeric vector of observations from the second condition, paired element-wise with x.

alternative

a character string specifying the alternative hypothesis, one of "two.sided" (default), "greater" (x tends to exceed y) or "less".

Author

Lech Madeyski

References

Munzel, U. and Brunner, E. (2002). An Exact Paired Rank Test. Biometrical Journal 44(5), 558-569.

Examples

Run this code
# Munzel and Brunner (2002) PGI example: the exact sign test reported p = 0.023.
pairedSignTest(MunzelBrunner02.PGI$week4, MunzelBrunner02.PGI$baseline)$p.value

Run the code above in your browser using DataLab