Perform two-sample permutation test on vectors of data.
twosample_test (x , y , alternative = "greater" , score = "wilcoxon" ,
method_p = "sampling" , samplenum = 2000 ,samplemethod="R",
conf.level.sample = 0.95 , conf.diff = TRUE, conf.level.diff = 0.95)numeric vector of data values.
numeric vector of data values.
a character string specifying the alternative hypothesis, must be one of "two.sided", "greater"(default) or "less".
a discrete value indicating the type of score. There are "original", "Wilcoxon", "van" and "exp" to be selected.
a string indicating what method to use for p-value. "sampling" represents sampling; "asymptotic" represents using large sample approximations; "exact" represents Iterate through all combinations.
The number of samples
a discrete value indicating the method of sampling. "S" represents sample function sampling; "W" represents Cistern Sampling; "R" represents Put-back sampling.
p-value confidence level for SRS sampling
a logical indicating whether to calculate the confidence interval of drift parameters.
the level of confidence of drift parameters.
the test used.
the score which is used.
the statistic of the original data.
the confidence interval for p-value(only if method_p = "sampling")
p-value for the test
a character string describing the alternative hypothesis.
a character string describing the Hodges-Lehmann estimate and the confidence interval of the drift parameter.
score has 4 options: "original", "Wilcoxon", "van" and "exp". When choosing "original", the test is based on the original data; if score = "Wilcoxon", the test is baesd on rank-sum; if score = "van", the test is based on Van der Waerden score; if score = "exp", the test is based on exponential score.
samplenum and samplemethod only work when method_p="sampling". Similarly, conf.level.diff only works when conf.diff =TRUE.
Higgins, J. J. (2004). An introduction to modern nonparametric statistics. Pacific Grove, CA: Brooks/Cole.
# NOT RUN {
## A simple example
x = c(1,2,3,4,5)
y = c(2,3,4,5,6)
twosample_test(x,y,samplemethod = "R" )
# }
Run the code above in your browser using DataLab