We compute the standardized Wilcoxon test statistic with mean 0 and
and standard deviation 1 for samples \(x\) and \(y\). The R function
stats::wilcox.test()
returns the statistic
wilcoxon(x, y, theta = 0)
the standardized Wilcoxon statistic
a sample numeric vector
a sample numeric vector
a value > 0 but < 1/2.
$$ U = \sum_i R_i - \frac{m(m + 1)}{2} $$
where \(R_i\) are the ranks of the first sample \(x\) of size \(m\). We compute
$$ \frac{(U - mn(1/2 + \theta))}{\sqrt{mn(m + n + 1) / 12}} $$
where \(\theta\) is the alternative hypothesis shift on the probability scale, i.e. \(P(X > Y) = 1/2 + \theta\).