Uses binom.exact to create sign test with confidence intervals.
Usage
signTest(x, stat = c("pos-neg", "prop pos"), ...)
Arguments
x
numeric vector
stat
statistic for estimates and confidence intervals,
"pos-neq"= proportion positive - proportion negative, "prop pos"= proportion positive
(all proportions are out of non-zero values)
...
arguments passed to binom.exact
Details
Exact sign test, using exact binomial test on the proportion positive out of the non-zero values.
Value
A list of class 'htest'
Note
The sign test can be interpreted as a test that the median is zero assuming continuous data. If you want to test on the median without making continuity assumptions use medianTest.
Author(s)
Michael P. Fay
Examples
x<-c(rep(-1,10),rep(0,60),rep(1,30))
signTest(x)
# sample median is zero,
# and not surprisingly the median test
# properly gives a large p-value
medianTest(x)