Wilcoxon-Mann-Whitney test in R

wmwTestInR(x, sub, valType = c("p.greater", "p.less", "p.two.sided", "W"))

Arguments

x

A numerical vector

sub

A logical vector or integer vector to subset x. Numbers in sub are compared with numbers out of sub

valType

Type of retured-value. Supported values: p.greater, p.less, p.two.sided, and W statistic (note it is different from the U statistic)

Examples

testNums <- 1:10
testSub <- rep_len(c(TRUE, FALSE), length.out=length(testNums))
wmwTestInR(testNums, testSub)
#> [1] 0.7345653
wmwTestInR(testNums, testSub, valType="p.two.sided")
#> [1] 0.6761033
wmwTestInR(testNums, testSub, valType="p.less")
#> [1] 0.3380517
wmwTestInR(testNums, testSub, valType="W")
#> [1] 10