[R] mann-whitney U-test - U-value

(Ted Harding) Ted.Harding at manchester.ac.uk
Sat Jul 11 21:04:42 CEST 2009


On 11-Jul-09 18:13:29, Martin Batholdy wrote:
> Hi,
> I know that I can perform a Mann-Whitney U test with wilcox.test(x,y)
> But instead of an U-value I get a W-Value.
> Is it possible to change this?

The usual definition of the Man-Whitney U test for two samples x
of size m) and y (of size n) is that

  U = number of pairs (x[i],y[j]) such that X[i] < Y[j]

For R's wilcox.text(X,Y), '?wilcox.test' says:

  R's value can also be computed as the number of all pairs '(x[i],
  y[j])' for which 'y[j]' is not greater than 'x[i]', the most
  common definition of the Mann-Whitney test.

In other words, it is the complement of the definition of U above.
Hence the standard U statistic can be obtained from R's W as

  U = m*n/2 - W

since m*n/2 is the total number of possible pairs.

(In my view, R is being a bit idiosyncratic there).
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 11-Jul-09                                       Time: 20:04:40
------------------------------ XFMail ------------------------------




More information about the R-help mailing list