choplump(x, ...)
## S3 method for class 'default':
choplump(x, y, alternative = c("two.sided", "less", "greater"),
use.ranks=TRUE, exact = NULL, method=NULL,
methodRule=methodRule1, methodRuleParms=c(10^4),
nMC=10^4-1,seed=1234321, printNumCalcs=TRUE, ...)
## S3 method for class 'formula':
choplump(formula, data, subset, na.action, \dots)set.seed if method='exactMC', ignored otherwisenMC resamples.
The associated functions for the above methods (choplumpApprox, choplumpExact,
choplumpExactMC), are internal and not to be called directly.
A methodRule function has 4 input values: W (a vector of all responses), Z (a vector of 0 or 1 denoting group membership),
exact (a logical value, same as exact in the choplump call), and parms (the vector of parameters, same as methodRuleParms
in the choplump call). The methodRule function returns a character vector with one of the allowed methods.
The default method rule is methodRule1. It gives a result of 'approx' if either exact=FALSE
or exact=NULL and there are more than parms calculations of the test statistic. It gives a result
of 'exact' if there are less than methodRuleParms calculations of the test statistic, and it gives a result of
'exactMC' if exact=TRUE and there are more than methodRuleParms calculations of the test statistic.set.seed(1)
Ntotal<-200
Mtotal<-12
Z<-rep(0,Ntotal)
Z[sample(1:Ntotal,Ntotal/2,replace=FALSE)]<-1
test<-data.frame(W=c(rep(0,Ntotal-Mtotal),abs(rnorm(Mtotal))),Z=Z)
## defaults to asymptotic approximation if
## the number of calculations of the test
## statistic is greater than parms
## see help for methodRule1
choplump(W~Z,data=test,use.ranks=TRUE)
## alternate form
cout<-choplump(test$W[test$Z==0],test$W[test$Z==1],use.ranks=TRUE,exact=TRUE)
cout
cout$p.valuesRun the code above in your browser using DataLab