[Scipy-tickets] [SciPy] #1593: Mann-Whitney statistic returns incorrect results

SciPy Trac scipy-tickets@scipy....
Sun Feb 5 19:21:57 CST 2012


#1593: Mann-Whitney statistic returns incorrect results
--------------------------+-------------------------------------------------
 Reporter:  rgommers      |       Owner:  somebody   
     Type:  defect        |      Status:  new        
 Priority:  normal        |   Milestone:  Unscheduled
Component:  scipy.stats   |     Version:  0.10.0     
 Keywords:  mannwhitneyu  |  
--------------------------+-------------------------------------------------

Comment(by warren.weckesser):

 The value 102 in the above example is correct.  See the description of the
 calculation in the wikipedia article:
 http://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U#Calculations
 In particular, "The smaller value of U1 and U2 is the one used when
 consulting significance tables."  An elementary statistics text that I
 happen to have handy (Probability and Statistics for Engineers (7th ed),
 by Richard A. Johnson) says the same thing: "...the statistic U, which
 always equals the smaller of the two."  mannwhitneyu() is returning the
 smaller value.

 Because of the symmetry of the calculation, either U1 or U2 can be used to
 compute Z (since U1 + U2 = n1*n2).

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1593#comment:2>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list