Wilcoxon
The Distribution of the Wilcoxon Rank Sum Statistic

Description

Calculates density, cumulative probability, quantile, and generate random sample for the distribution of the Wilcoxon rank sum statistic (discrete).

Usage

dwilcox(x, m, n, log = FALSE) # density
pwilcox(q, m ,n, lower.tail = TRUE, log.p = FALSE) # probability
qwilcox(p, m, n, lower.tail = TRUE, log.p = FALSE) # quantile
rwilcox(nn, m, n) # random

Arguments

x, q numeric vectors in the range [0, m*n] that specify the quantiles.
p a numeric vector in the range [0, 1] that specifies the probabilities.
nn an integer value in the range [0, Inf) that specifies the number of random samples requested. If the input value is not an integer, it is truncated. If length(nn) is greater than 1, the random function returns length(nn) random samples.
m an integer vector in the range [0, Inf) that specifies the number of observations in the first sample.
n an integer vector in the range [0, Inf) that specifies the number of observations in the second sample.
log a logical value. If FALSE (default), the density function returns the density itself. If TRUE, it returns the log of the density.
lower.tail a logical value. If TRUE (default), the probability supplied to the quantile function or returned by the probability function is P[X <= x]. If FALSE, it is P[X > x].
log.p a logical value. If FALSE (default), the probability supplied to the quantile function or returned by the probability function is the probability itself. If TRUE, it is the log of the probability.

Details

The distribution parameter(s) are replicated cyclically to be the same length as the input x, q, p, or the number of random samples requested.
Missing values (NAs) in the input or the distribution parameter(s) will cause the corresponding elements of the result to be missing.
Value
returns density (dwilcox), cumulative probability (pwilcox), quantiles (qwilcox), or random sample (rwilcox) for the Wilcoxon rank sum statistic distribution with parameters m and n. The quantile is defined as the smallest value q such that Pr(Wilcoxon rank sum statistic random variate <= q) >= p.
Side Effects
If the .Random.seed dataset exists, the random sample function updates its value. The random sample function creates the .Random.seed dataset if it does not exist.
Background
For two independent random samples, x of size m and y of size n, the Wilcoxon rank sum statistic is the sum of the ranks of x in the combined sample c(x,y). This statistic takes value between 0 and m*n.
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
Package stats version 6.1.4-13
Package Index