Distribution of Wilcoxon Rank Sum Statistic

DESCRIPTION:
Density, cumulative probability, quantiles and random generation for the distribution of the Wilcoxon rank sum statistic (also known as Mann-Whitney).

USAGE:
dwilcox(q, m, n)
pwilcox(q, m ,n)
qwilcox(p, m, n)
rwilcox(nn, m, n)

REQUIRED ARGUMENTS:
q:
vector of quantiles. Missing values (NAs) are allowed. q represents the sum of the ranks of the sample x in c(x,y) where y represents the elements of another sample.
p:
vector of probabilities. Its values must be between 0 and 1. Missing values(NAs) are allowed.
nn:
sample size. If length(nn) is greater than 1, then length(nn) random numbers are returned.
m:
number of observations in sample x. This must be a positive integer not greater than 50.
n:
number of observations in sample y. Also a positive integer not greater than 50.

VALUE:
dwilcox returns values for the exact probability at discrete values of q. Other functions return cumulative probability (pwilcox), quantiles (qwilcox), or a random sample (rwilcox) for the rank sum probability distribution.

SIDE EFFECTS:
The function rwilcox causes creation of the dataset .Random.seed if it does not already exist, otherwise its value is updated.

DETAILS:
Missing values (NAs) and +-Infs are allowed as components of q, p, or nn. If q, m, or n are vectors of different lengths, m, and n will be made to conform to the length of q by replicating their values cyclically. The values of both m and n are rounded to the nearest integer value before any calculations are made.

BACKGROUND:
If data consist of two random samples, a sample x of size m, and a sample y (independent of sample x) of size n, then the Wilcoxon rank sum statistic is the sum of the ranks of x in the combined sample c(x,y). This statistic can then be used for a non-parametric test of location shift between the parent populations.

The Wilcoxon rank sum statistic takes on values between m*(m+1)/2 and m*(m+2*n+1)/2.


REFERENCES:
Hollander, M. and Wolfe, D. (1973). Non-parametric Statistical Methods. Wiley, New York.

SEE ALSO:
wilcox.test , set.seed .

EXAMPLES:
pwilcox(24, 4, 6)   # the probability of q<=24
dwilcox(11:20,9,3)  # probabilities for q <- 11:20