cs.test(x, alternative = c("two.sided", "increasing", "decreasing"), exact = TRUE, correct = TRUE)
"two.sided"
(default), "increasing"
, or "decreasing"
.TRUE
(default) or FALSE
indicating whether an exact p-value should be computed. See 'Details' for the meaning of TRUE
.TRUE
.exact = TRUE
) is based on binomial distribution of statistic $S+$ ("increasing"
) or $S-$ ("decreasing"
) or $S = min(S+, S-)$ ("two.sided"
) and one can thus compute the exact p-value. When the sample size is large, one can also use the normal approximation (argument exact = TRUE
) to the binomial distribution with or without continuity correction. Missing values have been removed.
x <- 0.5*c(1:100) + rnorm(100,2,20)
# exact method
cs.test(x)
# approximate method
cs.test(x, exact = FALSE)
Run the code above in your browser using DataLab