Talk:Mann–Whitney U test

message: "All the formulae here are made more complicated in the presence of tied ranks, but if the number of these is small (and especially if there are no large tie bands) these can be ignored when doing calculations by hand. The computer statistical packages will use them as a matter of routine."
First, what does one do with ties?  (A link is sufficient if it is described elsewhere.)
Second, what do computer statistical packages use routinely?  The ignoring procedure, or the proper (undescribed) way to handle ties?
dfrankow (talk) 19:45, 29 December 2008 (UTC)
replies: text: Yes, that was not well expressed.  I have had a go at rephrasing it - does it make better sense now?  The actual formula in the case of ties would be a bit of a pig to enter in Wiki code and I will leave that job for someone more fluent in the coding than I am, though it's certainly true that for completeness we ought to have it here.  seglea (talk) 01:40, 30 December 2008 (UTC)
thread_title:  Ties 

message: "Note that since U1 + U2 = n1 n2, the mean n1 n2/2 used in the normal approximation is the mean of the two values of U. Therefore, you can use U and get the same result, the only difference being between a left-tailed test and a right-tailed test.
Huh? Perhaps it would be clearer to say which value goes with a left-tailed and which with a right-tailed test. dfrankow (talk) 19:45, 29 December 2008 (UTC)
thread_title:  One-tailed versus two-tailed distributions 

message: Really, someone should look into that... I don't have the time. COYW (talk) 22:26, 11 May 2015 (UTC)
thread_title:  This test can be reduced to one formula with one reference table 

message: In the general formulation, the null hypothesis of the Mann-Whitney U-test is not about the equality of distributions. It is about the symmetry between two populations with respect to the probability of obtaining a larger observation. Of course, two identical distributions possess the property of symmetry but two different distributions (for example, 2 normals with the same mean but different variances) can also be perfectly symmetric with respect to the probability of obtaining a larger observation.
The whole issue of correctly formulating a null hypothesis is very important for consideration of the power of the test. Consider again 2 normal distributions with the same mean and different variances. If the null hypothesis is defined as the equality of 2 distributions we are likely to fail to reject the null hypothesis even though we know a priori that it is not true. Only for 2 distributions with a similar variance but different means (more specifically, 2 distributions with a location shift) we will have a fair chance (i.e. good power) of rejecting the null hypothesis. So such a formulation of the null hypothesis severely restricts the applicability of the test.
However, if we define the null hypothesis as a hypothesis of symmetry with respect to obtaining a larger observation then everything works perfectly and the power of the test does not depend on diverging variances. Indeed, the inability to reject the null hypothesis for 2 normals with the same means but different variances is not a failure of the test because we know a priori that the null hypothesis is satisfied in this case.
------  —Preceding unsigned comment added by Marenty (talk • contribs) 02:19, 29 July 2010 (UTC)
thread_title:  Assumptions 

message: The hypothesis stated in this article refers both to the testing of equality of central tendency, and equality of distribution. The central tendancy hypothesis requires the additional assumption that the distribution of the two samples are the same except for a shift (i.e. f1(X) = f2(X+delta)). The test can also be described as a general test of equality of distribution (H0: f1=f2). In this case the shift alternative is not required, however, the test is used most often as a test of central tendency, so the original formulation (with the addition of the shift assumption) is most appropriate. I have added this assumption to the main page.  —Preceding unsigned comment added by 132.239.102.171 (talk) 00:20, 30 January 2008 (UTC)
thread_title:  Assumptions 

message: A significant MW tests does not necessarily imply that the distributions have different medians. This is a common misconception. It is most powerful for detecting a difference in medians, which is why this is commonly misstated. The MW tests that the samples were taken from different distributions.
:This issue seems to have been elaborated in the section "Illustration of object of test". Let me first analyze what is remarked above. Probably meant is 'a significant outcome' of a MW test. And then: a significant outcome never implies anything about any distribution. It merely points to some at forehand assumed property. The MW test is sensitive to shifted support of the distributions. In the mentioned section a (strange) example is given, but an ever stranger remark is made about the "medians". The medians in the sample are merely estimations of the population medians, and the test does not rely on the sample medians. So I do not understand what is meant by this section. Madyno (talk) 09:54, 3 November 2020 (UTC)
thread_title:  Inexact explanation of what this test should be used for 

message: Is this right?  I would have thought it should be symmetrical in n1 and n2...
161.130.68.84 21:11, 28 December 2006 (UTC)
thread_title:  calculation of mu in the normal approx 

message: The 'rank' link currently points to a disambiguation page which doesn't include an article explaining what the rank of a sample is.Tim (talk) 02:31, 3 June 2008 (UTC)
thread_title:  Link to rank article needs to be more specific 

message: I have removed the following from the section on Herrnstein's rho.  As it stands, it does not make sense.  It may well be true, but if so it needs a lot more explanation.
:"ρ is also known as the area under the receiver operating characteristic (ROC) curve."
seglea (talk) 23:14, 12 January 2009 (UTC)
thread_title: Receiver operating characteristic

message: I will shortly change the "Formal statement of object of test" and "Assumptions" sections and put them into one section. There were several errors. 
1. Previously the article stated that the MWW test does not test for differences in medians. But if you make the location shift assumptions, then it does in fact strictly test for the differences in medians. 
2. Previously the article stated that one proper formulation for the MWW test is to have the null hypothesis be that P(X>Y)=0.5.  In fact, this is not true. If you have two normal distributions with the same mean but different variances then the MWW test is no longer valid under that null even though P(X>Y)=.5 (see Pratt, 1964, Journal of the American Statistical Association, 665-680).
3. Previously the article stated "Without making such a strong assumption [about the location shift] (and verifying its validity) it is incorrect to use the MWW test as a test for shift in location." In fact, although we can invalidate the location shift assumption, we cannot verify that assumption with a finite amount of data. (Testing and finding no significant violation of an assumption is not the same a verifying that assumption. You could have not been able to find significance because of a small sample size). In statistics we make assumptions all the time, so saying it is incorrect to use an assumption without verifying it seems contrary to the practice of statistics. Although it may be a good idea to check the assumption if you can.
4. The following statement was made: "the Mann-Whitney U test is valid for testing of stochastic dominance under very broad conditions, without making any additional assumptions, including any additional assumptions about variances of the two samples". This is not correct, see Pratt, 1964 referenced above. The paragraph following was mostly redundant, so I deleted it.
Mpf3205 (talk) 05:18, 7 March 2010 (UTC)
thread_title: Assumptions and Formalization of Hypotheses

message: I spent a great deal of time puzzling over the table of critical values in the second external link (www.stat.auckland.ac.nz), wondering why it didn't match up with the first link, and more importantly, why some of the values appeared to be theoretically impossible (e.g. greater than 100 for a 10*10 test). After careful reading, I realized that the test statistic in the link was calculated differently than the one in the article. (i.e. a straight R1 sum of ranks versus the R1 - n1(n1+1)/2). 
I have no external experience with this, but the best I can tell from the external link, while the Mann-Whitney and Wilcoxon tests are equivalent, they are not identical, in that the numeric form of the statistic differs. Whereas the Mann-Whitney includes the n1(n1+1)/2 adjustment, the Wilcoxon is a straight sum of ranks. While not changing the application or conclusions of the test, this is crucial to know when looking at critical value tables, as what works for one won't work for the other.
I altered the text for the external link so hopefully others will not be as confused, but could someone who has a better understanding of the history and situation add a clarification about the different functional forms to the article? (If you would add info about why they're equivalent, and why one form might be preferred over the other, so much the better.)
P.S. While you're at it, a discussion on how to treat identical valued items in calculating the test statistic would be also be appreciated. The Auckland link discusses it for the straight Wilcoxon sum of ranks, but I'm still not sure how they are accounted for in the Mann-Whitney statistic. -- 140.142.20.229 (talk) 22:30, 8 March 2010 (UTC)
replies: text: Just thought I'd point to a reference which touches on the difference: Journal of the American Statistical Association, Vol. 59, No. 307 (Sep., 1964), pp. 925-934   -- 140.142.20.229 (talk) 22:39, 8 March 2010 (UTC)

text: Different implementations are using differently defined test statistics!  There definitely needs to be a section that makes this clear.  It would save a lot of wasted time.  I have been using some R implementations, the standard one in 'stats' called via wilcox.text and the advanced version in the 'coin' package invoked via wilcox_test.  The test statistic reported from wilcox_test (coin package) is equal to the sum of ranks R1 in the wikipedia example [in the R idiom, this is accessed via 'statistic(out, "linear")' where "out" is the output of wilcox_test-- without the "linear" option, you'll get a Z score].  The test statistic reported from wilcox.test (stats package) is equal to the sum of ranks R1 minus a factor that corresponds to n1(n1+1)/2 in the wikipedia notation [in the R idiom, this is invoked via out$statistic, where "out" is the output of the wilcox.test].  Neither of these implementations computes the "U" statistic as defined in the wikipedia article.  Dabs (talk) 19:34, 4 December 2014 (UTC)
thread_title:  Mann-Whitney vs. Wilcoxon 

message: Under the section that describes the assumptions, I had previously added that you need to have both distributions be equal under the null. That was deleted. But I assert that you need that assumption. If you state the null hypothesis as only needing that Pr[X>Y]+ .5 Pr[X=Y] = .5, that does not give sufficient conditions for validity. Here is a counter example (see Pratt, 1964, JASA, cited in my previous notes above): if you have two normal distributions with the same mean but different variances then  Pr[X>Y]+ .5 Pr[X=Y] = .5, but your type I error can be inflated (i.e., the test can reject the null hypothesis more often than the nominal significance level). 
The paragraph that I deleted also had that same mistaken idea.  —Preceding unsigned comment added by Mpf3205 (talk • contribs) 05:31, 27 August 2010 (UTC)
thread_title:  What do you need to assume under the null hypothesis? 

message: "Taking each observation in sample 1, count the number of observations in sample 2 that are smaller than it (count a half for any that are equal to it)." 
If I understand correctly the test does not require to compare observed values but just the ranks, so this sentence should be changed using ranks.
"Choose the sample for which the ranks seem to be smaller"
"count the number of hares it is beaten by (lower rank)"
is 1st the lowest rank ? For me it is the opposite. The word smaller seems less ambiguous to me.
"Arrange all the observations into a single ranked series. That is, rank all the observations without regard to which sample they are in."
This has to be done for small samples or big samples, so this sentence should precede. 
I will do the modifications I propose, it is probably better so you see what I mean.
Arnaud  —Preceding unsigned comment added by 132.183.93.37 (talk) 16:10, 16 November 2010 (UTC)
replies: text: This does not seem to have gotten fixed.  I just fixed it.  There are two issues here.  First, the explanation as given was incorrect, as implied above.  We want to count the *wins*, and counting the wins for sample 1 means counting the observations in sample 2 that are *larger* (and counting 0.5 for ties).  The second issue is about whether or not ranks are needed.  The answer is no, they are not needed with the simple method introduced in the "calculations" section.  It is possible to calculate U correctly without assigning numeric ranks.  Just do each pairwise comparison, and count the wins.  Here is a numeric example: A = (1, 3) and B = (2, 3, 7).  The pairwise wins for A are (3, 1.5), i.e., 1 beats 2, 3 and 7, and 3 beats 7 and ties with 3.  This means that U equals 4.5.  For B, the number of wins is only 1.5, because 2 beats 3, and 3 ties with 3.  The sum of these two U values is 6, which is the produce of 2 and 3, as expected.  If you go through the second method of calculation,  the sums of ranks are 1 + 3.5=4.5 for A, and 2 + 3.5 + 5 = 10.5 for B (this particular numeric example isn't ideal because in this case r1 just happens to equal 4.5, same as u1).  Given that n1=2 and n2=3, the formulas for U will give you exactly the same result as for the simple method.  So, to reiterate, we do not need to assign numeric ranks to do the simple method-- we only need to make binary comparisons. Dabs (talk) 21:53, 8 December 2014 (UTC)
thread_title:  Un-clarity in terms : ranks or observations ? lower rank or smaller ? 

message: Despite Mann-Whitney U test and Wilcoxon rank-sum test are equivalent, they are two different tests, as pointed out by 140.142.20.229. In the current version, Mann–Whitney U is described, while Wilcoxon rank-sum test is not. Since the are two different tests, shouldn't we create a new page for Wilcoxon rank-sum test, containing the description of this method, and then say that Mann-Whitney U test and Wilcoxon rank-sum test are equivalent?--Gorif (talk) 23:42, 12 February 2012 (UTC)
thread_title:  Separate pages for Mann-Whitney U test and Wilcoxon rank-sum test? 

message: The Wikipedia article says that ranks start at 0, because you are considering how many hares the tortoise beats, which could be 0.  But everything else I've seen about Wilcoxon test says the ranks start at 1.  If one has tables for looking up the implication of Wilcoxon rank, it is rather important whether ranks are from 0 or 1.  Further the observation that U1+U2=n1*n2 only holds if ranks start at 0, not 1.
This issue needs clarification!!
Ian Davis
textserver.com@gmail.com  — Preceding unsigned comment added by 209.183.141.235 (talk) 01:52, 2 December 2014 (UTC)
replies: text: Ranks begin at 1, otherwise the formulas will be off.  However, this is *not* contradicted by the tortoises and hares example, because it does not use ranks.  This is explained in the beginning of the "calculations" section-- "method 1" is simply to count the pairwise wins.  This calculation does not require assigning numeric ranks, and it gives the correct value. Dabs (talk) 21:52, 8 December 2014 (UTC)
replies: text:  To follow up: It is not true that U_1 + U_2 = n_1 * n_2 only holds if ranks start at 0.  Since ranks start at 1, the case of n_1 = n_2 = 1 gives U_1 and U_2 being 1-1=0 and 2-1=1, which sum to n_1 * n_2 = 1. LachlanA (talk) 01:29, 5 August 2016 (UTC)
thread_title:  Do Ranks start at 1 or at 0 

message: The introduction says the Wilcoxon is more efficient than the t-test when the distribution is non-normal. That's misleding. The t-test is not just inefficient (is that term meaningful for a test as opposed to an estimator?), but rather fails to be valid if the distribution is not normal. It's a parametric test. See https://en.wikipedia.org/wiki/Student's_t-test Erasmuse~enwiki (talk) 12:22, 22 June 2015 (UTC)
thread_title:  Is the t-Test Valid for Non-Normal Distributions? 

message: The example of the hare and the tortoise says
:significant evidence that hares tend to have lower completion times than tortoises (p < 0.05, two-tailed)
My understanding of a two-tailed test is that the alternative hypothesis is simply that the distributions are unequal, rather than one dominates the other.  To test whether hares have lower completion times, don't we need a one-sided test?  In particular, being significant on a two-sided test doesn't AFAICT show that the sample with the lower mean was drawn from a distribution with a lower mean with the same significance.  (If it did, why would anyone use one-sided tests?) LachlanA (talk) 01:20, 5 August 2016 (UTC)
thread_title:  Can a two-tailed test show the sign of the difference? 

message: There's been some edit activity re: the paragraph where this test is compared to a Wilcoxon signed-rank test
(1,
2,
3, and
mine).
I think I have clarified it but I don't want to start an edit war, so   What do you think of
the current phrasing?
—Cousteau (talk) 13:34, 21 July 2017 (UTC)
replies: text: Thank you for this. I did intervene initially because I was worried that it looked as if  had got it wrong, identifying something as repetition (and removing it) when it was not. Then, however, I thought that I had myself perhaps been somewhere along the hasty<------>ignorant spectrum in making this edit (and in my edit on the user's Talk page) so I undid it all. Because I have no understanding of this topic area I think it was unwise editing from me, and I am withdrawing from further involvement, leaving it to people who actually know what they are doing. So: apologies, thanks and best wishes DBaK (talk) 20:03, 23 July 2017 (UTC)
thread_title:  Paragraph about Wilcoxon signed-rank test 

message: In the 'Relation to other tests' under alternative it says: "If one desires a simple shift interpretation..." What is meant by simple shift interpretation? This seems extremely vague. shift of what?  — Preceding unsigned comment added by 70.187.129.94 (talk) 20:45, 14 July 2018 (UTC)
thread_title:  Clarifying needed: a simple shift interpretation 

message: Specifically, the following section: https://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U_test#Proportion_of_concordance_out_of_all_pairs
has three sub section of different names for the same measure.
Tal Galili (talk) 19:39, 31 July 2019 (UTC)
thread_title:  Effect size section should be tightened 

message: This section: Mann–Whitney_U_test#Rank-biserial_correlation can take material from:
* Effect_size#Rank-biserial_correlation
* Rank_correlation#Rank-biserial_correlation
* Wilcoxon_signed-rank_test#Effect_size
In both of these cases I linked to the section on this page, but I think they might contain material that could be added to this section (and the ones in these articles should probably be shortened).
Tal Galili (talk) 17:07, 3 August 2019 (UTC)
thread_title:  Rank-biserial_correlation should be merged with text from other articles 

message: The formula for the common language effect size of U/(n1*n2) seems to me only works in case there are no ties. 
In general: "for continuous data, it is the probability that a score sampled at random from one distribution will be greater than a score sampled from some other distribution" (McGraw & Wong, 1992, p. 361).  — Preceding unsigned comment added by Stikpet (talk • contribs) 11:08, 2 September 2020 (UTC)
thread_title:  Formula for Common Language Effect Size? 

message: I have hidden the section 'Illustration of object of test' as it is not correct. The author doesn't properly distinguish between population and sample.Madyno (talk) 09:20, 10 November 2020 (UTC)
thread_title:  Illustration of object of test 

message: Hi everyone
I have added a link under "External Links" to my online app, that can perform the Mann-Whitney U test.
Question: Was it all right for me to do that? Linking to my own website? Or would that be considered conflict of interest or spam?
The site is completely free of charge and no registration required.  — Preceding unsigned comment added by IwanHBon (talk • contribs) 20:48, 5 March 2021 (UTC)
replies: text: No, you should not add links to your website. See WP:ELNO - MrOllie (talk) 22:09, 5 March 2021 (UTC)
thread_title:  New link added to another online calculator 

message: Can someone help me format the table in the efficiency section so it is on the right? DMH43 (talk) 17:40, 6 December 2023 (UTC)
thread_title:  Help with table 

message: Link to U-Statistic should be discussed in greater depth. Why is the Whitney U statistic unbiased etc... Biggerj1 (talk) 19:39, 19 February 2024 (UTC)
thread_title:  [[U-Statistic]] 

message: "if the responses are assumed to be continuous and the alternative is restricted to a shift in location, i.e., F1(x) = F2(x + δ), we can interpret a significant Mann–Whitney U test as showing a difference in medians."
If the shape of the distribution is the same then the mean should move too right? Why is it always described as being about the median?
 Transient Being (talk) 18:01, 24 May 2024 (UTC)
thread_title:  Does it test for a difference in mean as well as a difference in median?