Re: [R] Mann-Whitney & Wilcoxon Rank Sum

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Mon 16 May 2005 - 16:34:27 EST

Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:

> as essentially
>
> r <- rank(c(x,y))
> sum(r[seq(along = x)]) - n.x * (n.x + 1)/2
>
> I guess your reference just uses the first term.
>
> Another way of looking at this is whether ranks start at 0 or at 1 (as
> in rank()): R's definition is the rank sum with 0-based ranks.

Er, no... Then you'd be subtracting n.x. The definition is such that the minimum value of the statistic becomes zero (2nd term is equal to sum(1:n.x)).

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon May 16 16:40:46 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:46 EST