词条 | Mann–Whitney U test |
释义 |
In statistics, the Mann–Whitney U test (also called the Mann–Whitney–Wilcoxon (MWW), Wilcoxon rank-sum test, or Wilcoxon–Mann–Whitney test) is a nonparametric test of the null hypothesis that it is equally likely that a randomly selected value from one sample will be less than or greater than a randomly selected value from a second sample. Unlike the t-test it does not require the assumption of normal distributions. It is nearly as efficient as the t-test on normal distributions. This test can be used to determine whether two independent samples were selected from populations having the same distribution; a similar nonparametric test used on dependent samples is the Wilcoxon signed-rank test. Assumptions and formal statement of hypothesesAlthough Mann and Whitney[1] developed the Mann–Whitney U test under the assumption of continuous responses with the alternative hypothesis being that one distribution is stochastically greater than the other, there are many other ways to formulate the null and alternative hypotheses such that the Mann–Whitney U test will give a valid test.[1] A very general formulation is to assume that:
Under the general formulation, the test is only consistent when the following occurs under H1:
Under more strict assumptions than the general formulation above, e.g., if the responses are assumed to be continuous and the alternative is restricted to a shift in location, i.e., {{math|1=F1(x) = F2(x + δ)}}, we can interpret a significant Mann–Whitney U test as showing a difference in medians. Under this location shift assumption, we can also interpret the Mann–Whitney U test as assessing whether the Hodges–Lehmann estimate of the difference in central tendency between the two populations differs from zero. The Hodges–Lehmann estimate for this two-sample problem is the median of all possible differences between an observation in the first sample and an observation in the second sample. The Mann–Whitney U test / Wilcoxon rank-sum test is not the same as the Wilcoxon signed-rank test, although both are nonparametric and involve summation of ranks. The Mann–Whitney U test is applied to independent samples. The Wilcoxon signed-rank test is applied to matched or dependent samples. CalculationsThe test involves the calculation of a statistic, usually called U, whose distribution under the null hypothesis is known. In the case of small samples, the distribution is tabulated, but for sample sizes above ~20, approximation using the normal distribution is fairly good. Some books tabulate statistics equivalent to U, such as the sum of ranks in one of the samples, rather than U itself. The Mann–Whitney U test is included in most modern statistical packages. It is also easily calculated by hand, especially for small samples. There are two ways of doing this. Method one:For comparing two small sets of observations, a direct method is quick, and gives insight into the meaning of the U statistic, which corresponds to the number of wins out of all pairwise contests (see the tortoise and hare example under Examples below). For each observation in one set, count the number of times this first value wins over any observations in the other set (the other value loses if this first is larger). Count 0.5 for any ties. The sum of wins and ties is U for the first set. U for the other set is the converse. Method two:For larger samples:
where n1 is the sample size for sample 1, and R1 is the sum of the ranks in sample 1. Note that it doesn't matter which of the two samples is considered sample 1. An equally valid formula for U is The smaller value of U1 and U2 is the one used when consulting significance tables. The sum of the two values is given by Knowing that {{math|1=R1 + R2 = N(N + 1)/2}} and {{math|1=N = n1 + n2}}, and doing some algebra, we find that the sum is {{math|1=U1 + U2 = n1n2}}. PropertiesThe maximum value of U is the product of the sample sizes for the two samples. In such a case, the "other" U would be 0. ExamplesIllustration of calculation methodsSuppose that Aesop is dissatisfied with his classic experiment in which one tortoise was found to beat one hare in a race, and decides to carry out a significance test to discover whether the results could be extended to tortoises and hares in general. He collects a sample of 6 tortoises and 6 hares, and makes them all run his race at once. The order in which they reach the finishing post (their rank order, from first to last crossing the finish line) is as follows, writing T for a tortoise and H for a hare: T H H H H H T T T T T H What is the value of U?
rank the animals by the time they take to complete the course, so give the first animal home rank 12, the second rank 11, and so forth. the sum of the ranks achieved by the tortoises is {{math|1=12 + 6 + 5 + 4 + 3 + 2 = 32}}. Therefore {{math|1=U = 32 − (6×7)/2 = 32 − 21 = 11}} (same as method one). the sum of the ranks achieved by the hares is {{math|1=11 + 10 + 9 + 8 + 7 + 1 = 46}}, leading to {{math|1=U = 46 − 21 = 25}}. Illustration of object of testA second example race illustrates the point that the Mann–Whitney U test does not test for inequality of medians, but rather for difference of distributions. Consider another hare and tortoise race, with 19 participants of each species, in which the outcomes are as follows, from first to last past the finishing post: H H H H H H H H H T T T T T T T T T T H H H H H H H H H H T T T T T T T T T If we simply compared medians, we would conclude that the median time for tortoises is less than the median time for hares, because the median tortoise here (in bold) comes in at position 19, and thus actually beats the median hare (in bold), which comes in at position 20. However, the value of U is 100 (using the quick method of calculation described above, we see that each of 10 tortoises beats each of 10 hares, so {{math|1=U = 10×10}}). Consulting tables, or using the approximation below, we find that this U value gives significant evidence that hares tend to have lower completion times than tortoises ({{math|p < 0.05}}, two-tailed). Obviously these are extreme distributions that would be spotted easily, but in larger samples something similar could happen without it being so apparent. Notice that the problem here is not that the two distributions of ranks have different variances; they are mirror images of each other, so their variances are the same, but they have very different skewness. Normal approximation and tie correctionFor large samples, U is approximately normally distributed. In that case, the standardized value where mU and σU are the mean and standard deviation of U, is approximately a standard normal deviate whose significance can be checked in tables of the normal distribution. mU and σU are given by and The formula for the standard deviation is more complicated in the presence of tied ranks. If there are ties in ranks, σ should be corrected as follows: where {{math|1=n = n1 + n2}}, ti is the number of subjects sharing rank i, and k is the number of (distinct) ranks. If the number of ties is small (and especially if there are no large tie bands) ties can be ignored when doing calculations by hand. The computer statistical packages will use the correctly adjusted formula as a matter of routine. Note that since {{math|1=U1 + U2 = n1n2}}, the mean {{math|1=n1n2/2}} used in the normal approximation is the mean of the two values of U. Therefore, the absolute value of the z statistic calculated will be same whichever value of U is used. Effect sizesIt is a widely recommended practice for scientists to report an effect size for an inferential test.[4][5] Common language effect sizeOne method of reporting the effect size for the Mann–Whitney U test is with the common language effect size.[6][7] As a sample statistic, the common language effect size is computed by forming all possible pairs between the two groups, then finding the proportion of pairs that support a hypothesis.[7] To illustrate, in a study with a sample of ten hares and ten tortoises, the total number of ordered pairs is ten times ten or 100 pairs of hares and tortoises. Suppose the results show that the hare ran faster than the tortoise in 90 of the 100 sample pairs; in that case, the sample common language effect size is 90%. This sample value is an unbiased estimator of the population value, so the sample suggests that the best estimate of the common language effect size in the population is 90%.[8] Rank-biserial correlationA second method of reporting the effect size for the Mann–Whitney U test is with a measure of rank correlation known as the rank-biserial correlation. Edward Cureton introduced and named the measure.[9] Like other correlational measures, the rank-biserial correlation can range from minus one to plus one, with a value of zero indicating no relationship. There is a simple difference formula to compute the rank-biserial correlation from the common language effect size: the correlation is the difference between the proportion of pairs favorable to the hypothesis (f) minus the proportion that is unfavorable (u). The value of f is the common language effect size. This simple difference formula is as follows:[6] Stated another way, the correlation is the difference between the common language effect size and its complement: For example, consider the example where hares run faster than tortoises in 90 of 100 pairs. The common language effect size is 90%, so the rank-biserial correlation is 90% minus 10%, and the rank-biserial {{math|1=r = 0.80}}. There is a formula to compute the rank-biserial from the Mann–Whitney U and the sample sizes of each group:[10] This formula is useful when the data are not available, but when there is a published report, because U and the sample sizes are routinely reported. Using the example above with 90 pairs that favor the hares and 10 pairs that favor the tortoise, U is the smaller of the two, so {{math|1=U = 10}}. This formula then gives {{math|1=r = 1 – (2×10) / (10×10) = 0.80}}, which is the same result as with the simple difference formula above. Relation to other testsComparison to Student's t-testThe Mann–Whitney U test is more widely applicable than independent samples Student's t-test, and the question arises of which should be preferred.
Overall, the robustness makes the Mann–Whitney U test more widely applicable than the t-test, and for large samples from the normal distribution, the efficiency loss compared to the t-test is only 5%, so one can recommend the Mann–Whitney U test as the default test for comparing interval or ordinal measurements with similar distributions.{{citation needed|date=February 2012}} The relation between efficiency and power in concrete situations isn't trivial though. For small sample sizes one should investigate the power of the Mann–Whitney U test vs the t-test. The Mann–Whitney U test will give very similar results to performing an ordinary parametric two-sample t-test on the rankings of the data.[14] Area-under-curve (AUC) statistic for ROC curvesThe U statistic is equivalent to the area under the receiver operating characteristic curve that can be readily calculated.[15][16] Because of its probabilistic form, the U statistic can be generalised to a measure of a classifier's separation power for more than two classes:[17] Where c is the number of classes, and the Rk,l term of AUCk,l considers only the ranking of the items belonging to classes k and l (i.e., items belonging to all other classes are ignored) according to the classifier's estimates of the probability of those items belonging to class k. AUCk,k will always be zero but, unlike in the two-class case, generally {{math|1=AUCk,l ≠ AUCl,k}}, which is why the M measure sums over all (k,l) pairs, in effect using the average of AUCk,l and AUCl,k. Different distributionsIf one is only interested in stochastic ordering of the two populations (i.e., the concordance probability {{math|1=P(Y>X))}}, the Mann–Whitney U test can be used even if the shapes of the distributions are different. The concordance probability is exactly equal to the area under the receiver operating characteristic curve (ROC) that is often used in the context.{{Citation needed|date=November 2009}} AlternativesIf one desires a simple shift interpretation, the Mann–Whitney U test should not be used when the distributions of the two samples are very different, as it can give erroneously significant results.[18] In that situation, the unequal variances version of the t-test is likely to give more reliable results, but only if normality holds.{{citation needed|date=February 2012}} Alternatively, some authors (e.g., Conover{{full citation needed|date=November 2012}}) suggest transforming the data to ranks (if they are not already ranks) and then performing the t-test on the transformed data, the version of the t-test used depending on whether or not the population variances are suspected to be different. Rank transformations do not preserve variances, but variances are recomputed from samples after rank transformations. The Brown–Forsythe test has been suggested as an appropriate non-parametric equivalent to the F-test for equal variances.{{citation needed|date=February 2012}} See also Kolmogorov–Smirnov test. HistoryThe statistic appeared in a 1914 article[19] by the German Gustav Deuchler (with a missing term in the variance). As a one-sample statistic, the signed rank was proposed by Frank Wilcoxon in 1945,[20] with some discussion of a two-sample variant for equal sample sizes, in a test of significance with a point null-hypothesis against its complementary alternative (that is, equal versus not equal). A thorough analysis of the statistic, which included a recurrence allowing the computation of tail probabilities for arbitrary sample sizes and tables for sample sizes of eight or less appeared in the article by Henry Mann and his student Donald Ransom Whitney in 1947.[21] This article discussed alternative hypotheses, including a stochastic ordering (where the cumulative distribution functions satisfied the pointwise inequality {{math|1=FX(t) < FY(t)}}). This paper also computed the first four moments and established the limiting normality of the statistic under the null hypothesis, so establishing that it is asymptotically distribution-free. Related test statisticsKendall's tauThe Mann–Whitney U test is related to a number of other non-parametric statistical procedures. For example, it is equivalent to Kendall's tau correlation coefficient if one of the variables is binary (that is, it can only take two values).{{citation needed|date=February 2012}} ρ statisticA statistic called ρ that is linearly related to U and widely used in studies of categorization (discrimination learning involving concepts), and elsewhere, is calculated by dividing U by its maximum value for the given sample sizes, which is simply {{math|1=n1×n2}}. ρ is thus a non-parametric measure of the overlap between two distributions; it can take values between 0 and 1, and it is an estimate of {{math|1=P(Y > X) + 0.5 P(Y = X)}}, where X and Y are randomly chosen observations from the two distributions. Both extreme values represent complete separation of the distributions, while a ρ of 0.5 represents complete overlap. The usefulness of the ρ statistic can be seen in the case of the odd example used above, where two distributions that were significantly different on a Mann–Whitney U test nonetheless had nearly identical medians: the ρ value in this case is approximately 0.723 in favour of the hares, correctly reflecting the fact that even though the median tortoise beat the median hare, the hares collectively did better than the tortoises collectively.{{citation needed|date=February 2012}} Example statement of resultsIn reporting the results of a Mann–Whitney U test, it is important to state:
In practice some of this information may already have been supplied and common sense should be used in deciding whether to repeat it. A typical report might run, "Median latencies in groups E and C were 153 and 247 ms; the distributions in the two groups differed significantly (Mann–Whitney {{math|1=U = 10.5}}, {{math|1=n1 = n2 = 8}}, {{math|1=P < 0.05}} two-tailed)." A statement that does full justice to the statistical status of the test might run, "Outcomes of the two treatments were compared using the Wilcoxon–Mann–Whitney two-sample rank-sum test. The treatment effect (difference between treatments) was quantified using the Hodges–Lehmann (HL) estimator, which is consistent with the Wilcoxon test.[22] This estimator (HLΔ) is the median of all possible differences in outcomes between a subject in group B and a subject in group A. A non-parametric 0.95 confidence interval for HLΔ accompanies these estimates as does ρ, an estimate of the probability that a randomly chosen subject from population B has a higher weight than a randomly chosen subject from population A. The median [quartiles] weight for subjects on treatment A and B respectively are 147 [121, 177] and 151 [130, 180] kg. Treatment A decreased weight by HLΔ = 5 kg (0.95 CL [2, 9] kg, {{math|1=2P = 0.02}}, {{math|1=ρ = 0.58}})." However it would be rare to find so extended a report in a document whose major topic was not statistical inference. ImplementationsIn many software packages, the Mann–Whitney U test (of the hypothesis of equal distributions against appropriate alternatives) has been poorly documented. Some packages incorrectly treat ties or fail to document asymptotic techniques (e.g., correction for continuity). A 2000 review discussed some of the following packages:[23]
See also
Notes1. ^{{cite journal |last=Fay |first=Michael P. |last2=Proschan |first2=Michael A. |journal=Statistics Surveys |year=2010 |pages=1–39 |volume=4 |doi=10.1214/09-SS051 |title=Wilcoxon–Mann–Whitney or t-test? On assumptions for hypothesis tests and multiple interpretations of decision rules |pmc=2857732 |mr=2595125 |pmid=20414472 }} 2. ^[https://www.jstor.org/stable/2283092], See Table 2.1 of Pratt (1964) "Robustness of Some Procedures for the Two-Sample Location Problem." Journal of the American Statistical Association. 59 (307): 655–680. If the two distributions are normal with the same mean but different variances, then Pr[ X>Y]=Pr[Y 4. ^{{cite journal | last=Wilkinson | first=Leland | title=Statistical methods in psychology journals: Guidelines and explanations | year=1999 | journal=American Psychologist | volume=54 | pages=594–604 | doi=10.1037/0003-066X.54.8.594 | issue=8}} 5. ^{{cite journal | last=Nakagawa | first=Shinichi |author2=Cuthill, Innes C | year=2007 | title=Effect size, confidence interval and statistical significance: a practical guide for biologists | journal = Biological Reviews of the Cambridge Philosophical Society | volume=82 | pages=591–605 | doi=10.1111/j.1469-185X.2007.00027.x | pmid=17944619 | issue=4}} 6. ^1 Kerby, D.S. (2014). "The simple difference formula: An approach to teaching nonparametric correlation." Comprehensive Psychology, volume 3, article 1. {{doi|10.2466/11.IT.3.1}}. link to full article 7. ^1 {{cite journal | last1 = McGraw | first1 = K.O. | last2 = Wong | first2 = J.J. | year = 1992 | title = A common language effect size statistic | url = | journal = Psychological Bulletin | volume = 111 | issue = 2| pages = 361–365 | doi = 10.1037/0033-2909.111.2.361 }} 8. ^{{Cite journal | author = Grissom RJ | year = 1994| title = Statistical analysis of ordinal categorical status after therapies | journal = Journal of Consulting and Clinical Psychology | volume = 62| issue = 2| pages = 281–284| doi= 10.1037/0022-006X.62.2.281 | url = | pmid = }} 9. ^{{cite journal | last1 = Cureton | first1 = E.E. | year = 1956 | title = Rank-biserial correlation | url = | journal = Psychometrika | volume = 21 | issue = 3| pages = 287–290 | doi = 10.1007/BF02289138 }} 10. ^{{cite journal | last1 = Wendt | first1 = H.W. | year = 1972 | title = Dealing with a common problem in social science: A simplified rank-biserial coefficient of correlation based on the U statistic | url = | journal = European Journal of Social Psychology | volume = 2 | issue = 4| pages = 463–465 | doi = 10.1002/ejsp.2420020412 }} 11. ^Motulsky, Harvey J.; Statistics Guide, San Diego, CA: GraphPad Software, 2007, p. 123 12. ^Lehamnn, Erich L.; Elements of Large Sample Theory, Springer, 1999, p. 176 13. ^Conover, William J.; [https://onlinepubs.trb.org/onlinepubs/nchrp/cd-22/manual/v2chapter6.pdf Practical Nonparametric Statistics], John Wiley & Sons, 1980 (2nd Edition), pp. 225–226 14. ^{{cite journal |doi=10.2307/2683975 |title=Rank Transformations as a Bridge Between Parametric and Nonparametric Statistics |first1=William J. |last1=Conover |first2=Ronald L. |last2=Iman |authorlink2=Ronald L. Iman |journal=The American Statistician |volume=35 |issue=3 |year=1981 |pages=124–129 |jstor=2683975 }} 15. ^{{cite journal|last1=Hanley |first1=James A. |last2=McNeil |first2=Barbara J.|journal=Radiology |number=1 |pages=29–36|title=The Meaning and Use of the Area under a Receiver Operating (ROC) Curve Characteristic|volume=143|year=1982|pmid=7063747 |doi=10.1148/radiology.143.1.7063747}} 16. ^{{cite journal |last1=Mason |first1=Simon J. |last2=Graham |first2=Nicholas E.|year=2002 |title=Areas beneath the relative operating characteristics (ROC) and relative operating levels (ROL) curves: Statistical significance and interpretation |journal=Quarterly Journal of the Royal Meteorological Society |volume=128 |issue=584 |pages=2145–2166 |url=http://www.inmet.gov.br/documentos/cursoI_INMET_IRI/Climate_Information_Course/References/Mason+Graham_2002.pdf |doi=10.1256/003590002320603584|citeseerx=10.1.1.458.8392 }} 17. ^{{cite journal |title=A Simple Generalisation of the Area Under the ROC Curve for Multiple Class Classification Problems |first1=David J. |last1=Hand |first2=Robert J. |last2=Till |journal=Machine Learning |volume=45 |number=2 |pages=171–186 |year=2001 |doi=10.1023/A:1010920819831 |url=http://www.springerlink.com/index/nn141j42838n7u21.pdf }} 18. ^{{cite journal |doi=10.1006/anbe.2001.1691 |title=Mann–Whitney U test when variances are unequal | volume=61 |issue=6 | year=2001 |journal=Animal Behaviour |pages=1247–1249 | last1 = Kasuya | first1 = Eiiti}} 19. ^{{cite journal |jstor=2280906 |title=Historical Notes on the Wilcoxon Unpaired Two-Sample Test |last=Kruskal |first=William H. |journal=Journal of the American Statistical Association |date=September 1957 |volume=52 |issue=279 |pages=356–360 |doi=10.2307/2280906}} 20. ^{{cite journal |doi=10.2307/3001968 |last=Wilcoxon |first=Frank |authorlink=Frank Wilcoxon |year=1945 |title=Individual comparisons by ranking methods |journal=Biometrics Bulletin |volume=1 |issue=6 |pages=80–83 |jstor=3001968 }} 21. ^1 {{cite journal |first1=Henry B. |last1=Mann |authorlink=Henry Mann |first2=Donald R. |last2=Whitney |title=On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other |journal=Annals of Mathematical Statistics |volume=18 |issue=1 |year=1947 |pages=50–60 |doi=10.1214/aoms/1177730491 |mr=22058 |zbl=0041.26103 }} 22. ^{{cite book |title= Nonparametric Statistical Methods |authors= Myles Hollander and Douglas A. Wolfe |publisher= Wiley-Interscience |edition=2 |year=1999 |isbn= 978-0471190455}} 23. ^{{cite journal |title=Different Outcomes of the Wilcoxon–Mann–Whitney Test from Different Statistics Packages |first=Reinhard |last=Bergmann |first2=John |last2=Ludbrook |first3=Will P.J.M. |last3=Spooren |journal=The American Statistician |volume=54 |issue=1 |year=2000 |pages=72–77 |jstor=2685616 |doi=10.1080/00031305.2000.10474513}} 24. ^{{cite web |url=http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html |title=scipy.stats.mannwhitneyu |work=SciPy v0.16.0 Reference Guide |author= |date=24 July 2015 |publisher=The Scipy community |access-date=11 September 2015 |quote=scipy.stats.mannwhitneyu(x, y, use_continuity=True): Computes the Mann–Whitney rank test on samples x and y.}} 25. ^{{cite web |url=http://commons.apache.org/proper/commons-math/javadocs/api-3.3/org/apache/commons/math3/stat/inference/MannWhitneyUTest.html |title=org.apache.commons.math3.stat.inference.MannWhitneyUTest}} }} References
|title=Multivariate nonparametric methods with R: An approach based on spatial signs and ranks|series=Lecture Notes in Statistics|volume=199|publisher=Springer|location=New York|year=2010|pages=xiv+232|isbn=978-1-4419-0467-6|doi=10.1007/978-1-4419-0468-3|mr=2598854|ref=harv}}
External links
3 : Statistical tests|Nonparametric statistics|U-statistics |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。