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, log = FALSE) 
pwilcox(q, m ,n) 
qwilcox(p, m, n) 
rwilcox(nn, m, n, bigdata=F) 

REQUIRED ARGUMENTS:

q
vector or bdVector 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 or bdVector 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.

OPTIONAL ARGUMENTS:

bigdata
a logical value; if TRUE, an object of type bdVector is returned. Otherwise, a vector object is returned. This argument can be used only if the bigdata library section has been loaded.
log
a logical scalar; if TRUE, dwilcox will return the log of the density, not the density itself.

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 or bdVectors 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.

For details on the uniform random number generator implemented in S-PLUS, see the set.seed help file.

NOTE:

For wilcox.test, S-PLUS uses the Wilcoxon rank sum test W (see the BACKGROUND section above), while R computes the Mann and Whitney U statistic:

For samples x and y, for each value of x, count the number of values of y that are less than x. The sum of these counts is U.

The W and U statistics differ by a function of the sample sizes, and thus the Wilcoxon distribution is defined differently between R and S-PLUS.

REFERENCES:

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

SEE ALSO:

, .

EXAMPLES:

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