Mann Whitney U test¶

MannWhitneyUTest
(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real})¶ Perform a MannWhitney U test of the null hypothesis that the probability that an observation drawn from the same population as
x
is greater than an observation drawn from the same population asy
is equal to the probability that an observation drawn from the same population asy
is greater than an observation drawn from the same population asx
against the alternative hypothesis that these probabilities are not equal.The MannWhitney U test is sometimes known as the Wilcoxon rank sum test.
When there are no tied ranks and ≤50 samples, or tied ranks and ≤10 samples,
MannWhitneyUTest
performs an exact MannWhitney U test. In all other cases,MannWhitneyUTest
performs an approximate MannWhitney U test. Behavior may be further controlled by usingExactMannWhitneyUTest
orApproximateMannWhitneyUTest
directly. See below for further algorithmic details.Implements: pvalue

ExactMannWhitneyUTest
(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real})¶ Perform an exact MannWhitney U test.
When there are no tied ranks, the exact pvalue is computed using the
pwilcox
function from libRmath. In the presence of tied ranks, a pvalue is computed by exhaustive enumeration of permutations, which can be very slow for even moderately sized data sets.Implements: pvalue

ApproximateMannWhitneyUTest
(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real})¶ Perform an approximate MannWhitney U test.
The pvalue is computed using a normal approximation to the distribution of the MannWhitney U statistic:
\[\begin{split}\mu &= \frac{n_x n_y}{2}\\ \sigma &= \frac{n_x n_y}{12}\left(n_x + n_y + 1  \frac{a}{(n_x + n_y)(n_x + n_y  1)}\right)\\ a &= \sum_{t \in \mathcal{T}} t^3  t\end{split}\]where \(\mathcal{T}\) is the set of the counts of tied values at each tied position.
Implements: pvalue