Learn R Programming

asht (version 0.5)

signTest: Exact Sign Test with Confidence Intervals

Description

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

Value

  • A list of class 'htest'

Details

Exact sign test, using exact binomial test on the proportion positive out of the non-zero values.

Examples

Run this code
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)

Run the code above in your browser using DataLab