# 曼-惠特尼U检验

**曼-惠特尼U检验**（Mann–Whitney U test）是一种非参数统计检验，用于比较两个独立样本，检验的零假设是：两个样本来自同一分布；或者等价地说，从一个总体中随机抽取的值，大于或小于从另一个总体中随机抽取的值的可能性相同。它也被称为威尔科克森秩和检验、曼-惠特尼-威尔科克森检验或威尔科克森-曼-惠特尼检验，是独立样本t检验的标准非参数替代方法。<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC8933355/)</sup><sup> • </sup><sup>[2](https://discovery.ucl.ac.uk/id/eprint/10053296/1/Flynn_10053296_thesis.Redacted.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 检验什么 | 两个独立样本之一是否在随机意义上大于另一个；在零假设下，P(X > Y) = P(Y > X)<sup>[3](https://webspace.ship.edu/pgmarr/Geo441/Readings/Mann%20and%20Whitney%201947%20-%20On%20a%20Test%20of%20Whether%20one%20of%20Two%20Random%20Variables%20is%20Stochastically%20Larger%20than%20the%20Other.pdf)</sup> |
| 起源 | 弗兰克·威尔科克森于1945年提出秩和检验；亨利·B·曼和唐纳德·R·惠特尼于1947年在《数理统计年鉴》18:50–60上发表U统计量版本<sup>[3](https://webspace.ship.edu/pgmarr/Geo441/Readings/Mann%20and%20Whitney%201947%20-%20On%20a%20Test%20of%20Whether%20one%20of%20Two%20Random%20Variables%20is%20Stochastically%20Larger%20than%20the%20Other.pdf)</sup> |
| 与t检验的关系 | 用于两个独立组的非参数替代方法；当数据服从正态分布时，其相对于t检验的渐近相对效率为0.955<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC4754273/)</sup> |
| 不检验什么 | 它是秩和检验，不是中位数检验；当各组中位数相等时，它也可能显著<sup>[5](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faq-why-is-the-mann-whitney-significant-when-the-medians-are-equal/)</sup> |
| 中位数解释 | 只有在额外假设两个分布形状相同的情况下，才能作为等中位数检验<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC8933355/)</sup> |
| 软件默认设置 | 当其中一个样本的观测值不超过8个且没有结时，SciPy选择精确方法；当样本包含少于50个有限值且没有结时，R默认计算精确p值<sup>[6](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html)</sup><sup> • </sup><sup>[7](https://stat.ethz.ch/CRAN/doc/manuals/r-release/fullrefman.pdf)</sup> |

## 该检验实际检验的是什么

检验统计量U统计的是：在所有由每组各取一个观测值构成的配对中，来自某一组的值大于来自另一组的值出现了多少次。样本量为n₁和n₂时，共有n₁·n₂个这样的配对；如果零假设成立，U应约为该乘积的一半。<sup>[8](https://www.graphpad.com/guides/prism/latest/statistics/how_the_mann-whitney_test_works.htm)</sup><sup> • </sup><sup>[9](https://dspace.mchs.mw/api/core/bitstreams/1eb370b5-4b2f-451b-8f43-f78ece1ea326/content)</sup>在实践中，统计量由秩计算得出：将两组的所有观测值合并，从小到大排列，忽略组别归属，再由秩和求得U。<sup>[8](https://www.graphpad.com/guides/prism/latest/statistics/how_the_mann-whitney_test_works.htm)</sup>

曼-惠特尼U检验与威尔科克森秩和检验在计算过程上略有不同，但由于使用相同的统计量，被广泛认为是等价的方法；两者产生的p值和标准化z统计量相同，尽管原始统计量不同。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC4754273/)</sup><sup> • </sup><sup>[6](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html)</sup>若U₁是样本x的统计量，则样本y的统计量为U₂ = n₁·n₂ − U₁，秩和统计量为R₁ = U₁ + n₁(n₁ + 1)/2。<sup>[6](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html)</sup>

零假设针对的是整个分布，而不是某个单一的概括数值。独立样本t检验专门针对均值相等，而曼-惠特尼U检验更广泛地评估的零假设是：结果变量在两组中服从相同的分布；两组可能具有相近的均数和中位数，但分布仍然不同。<sup>[9](https://dspace.mchs.mw/api/core/bitstreams/1eb370b5-4b2f-451b-8f43-f78ece1ea326/content)</sup>当零假设被拒绝时，结论是分布不相等；对于单侧备择假设，则是一个分布在随机意义上大于另一个分布，即其累积分布函数处处位于另一个的累积分布函数之下或与之相等，且在某处严格不等。<sup>[2](https://discovery.ucl.ac.uk/id/eprint/10053296/1/Flynn_10053296_thesis.Redacted.pdf)</sup><sup> • </sup><sup>[10](https://pmc.ncbi.nlm.nih.gov/articles/PMC2857732/)</sup>

## 中位数、均值与常见误读

一个常见的错误是把该检验描述为中位数的比较。它是秩和检验，不是中位数检验，当各组中位数相等时也可能出现显著结果，因为该检验不仅对分布的位置差异敏感，也对分布的形状或离散程度差异敏感。<sup>[5](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faq-why-is-the-mann-whitney-significant-when-the-medians-are-equal/)</sup>一项已发表的随机试验说明了这种不一致：两组的中位数显示没有差异，尽管两组实际上相当不同，而直接反映秩和程序实际检验的量的威尔科克森-曼-惠特尼优势比显示了这一点。<sup>[11](https://pubmed.ncbi.nlm.nih.gov/23456667/)</sup>

在某些假设下，中位数解读是合理的。如果总体是连续的，且两个分布形状相似，该检验可以看作中位数差异的检验，即平移解释。<sup>[2](https://discovery.ucl.ac.uk/id/eprint/10053296/1/Flynn_10053296_thesis.Redacted.pdf)</sup><sup> • </sup><sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC8933355/)</sup>没有这些假设，该检验根本不涉及关于中位数的假设，备择假设应表述为随机占优。<sup>[12](https://rcompanion.org/documents/RHandbookProgramEvaluation.pdf)</sup><sup> • </sup><sup>[2](https://discovery.ucl.ac.uk/id/eprint/10053296/1/Flynn_10053296_thesis.Redacted.pdf)</sup>一个相关的微妙之处涉及伴随该检验的位置估计：霍奇斯-莱曼估计量估计的是来自x的样本与来自y的样本之间差值的中位数，而不是中位数之差——R文档指出，混淆这两者是一个常见误解。<sup>[7](https://stat.ethz.ch/CRAN/doc/manuals/r-release/fullrefman.pdf)</sup>

## 假设与有效性

该检验要求组间观测值相互独立。它是针对连续分布推导的，在连续分布中结的概率为零；对于离散或四舍五入的数据，会出现结，需要进行调整。<sup>[3](https://webspace.ship.edu/pgmarr/Geo441/Readings/Mann%20and%20Whitney%201947%20-%20On%20a%20Test%20of%20Whether%20one%20of%20Two%20Random%20Variables%20is%20Stochastically%20Larger%20than%20the%20Other.pdf)</sup><sup> • </sup><sup>[13](https://journals.plos.org/plosone/article/file?id=10.1371%2Fjournal.pone.0309074&type=printable)</sup>

方差不相等时的有效性需要谨慎对待。在一项关于非参数贝伦斯-费希尔问题的模拟研究中，威尔科克森-曼-惠特尼检验被证明要么过于保守，要么过于宽松，取决于各组样本量的相对大小和底层分布的方差；布伦纳-蒙策尔检验从所有观测值以及各样本内部计算的秩来估计渐近方差，对于至少10个观测值的组，能相当准确地保持名义水平。<sup>[14](https://onlinelibrary.wiley.com/doi/abs/10.1002/%28SICI%291521-4036%28200001%2942%3A1%3C17%3A%3AAID-BIMJ17%3E3.0.CO%3B2-U)</sup>因此，在不假设方差相等的情况下比较组分布或相对处理效应时，建议使用布伦纳-蒙策尔检验。<sup>[15](https://www.ncbi.nlm.nih.gov/sites/books/NBK560699/)</sup>美国国家过敏症和传染病研究所的统计学家费伊（Fay）与他在美国国立卫生研究院的同事普罗尚（Proschan）在许多组假设（他们称之为“视角”）下分析了该检验，得出结论：t检验与威尔科克森-曼-惠特尼检验之间的选择不应基于正态性检验，因为t检验的决策规则在相当一般的条件下仍然渐近有效。<sup>[10](https://pmc.ncbi.nlm.nih.gov/articles/PMC2857732/)</sup>

## 结与精确p值对近似p值

结值被赋予它们所跨越的秩的平均值（中秩）。<sup>[8](https://www.graphpad.com/guides/prism/latest/statistics/how_the_mann-whitney_test_works.htm)</sup>当存在结时，秩和的正态近似可能很差，取决于结的数量和模式，但现代计算消除了对近似的需要：即使没有结，对于小样本或中等样本，精确置换版本的检验也更可取。<sup>[13](https://journals.plos.org/plosone/article/file?id=10.1371%2Fjournal.pone.0309074&type=printable)</sup>

2024年，科布伦茨应用科学大学莱茵阿校区的统计学家马库斯·诺伊豪泽与圣安德鲁斯大学的格雷姆·D·拉克斯顿进行了一项模拟研究，考察了一项已发表的建议——在检验前省略结观测值。他们发现，使用全部数据（包括结）的精确检验能保证第一类错误率，并提供比省略结后进行的检验更大的效能，通常大得多；而且省略结可能改变样本的形状，足以违反检验假设。他们建议无论是否出现结，都以相同方式分析整个数据集，最好使用精确置换检验。软件默认设置反映了精确与渐近之间的权衡：SciPy的`mannwhitneyu`在其中一个样本的观测值不超过8个且没有结时选择精确方法，否则使用带结校正的正态近似；R的`wilcox.test`在样本包含少于50个有限值且没有结时默认计算精确p值。<sup>[13](https://journals.plos.org/plosone/article/file?id=10.1371%2Fjournal.pone.0309074&type=printable)</sup><sup> • </sup><sup>[6](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html)</sup><sup> • </sup><sup>[7](https://stat.ethz.ch/CRAN/doc/manuals/r-release/fullrefman.pdf)</sup>

## 效率、效能与设计

在正态性下，该检验的损失很小：其相对于t检验的渐近相对效率为0.955，多项研究报告称，在适当的环境中，非参数分析与参数方法具有同样的效率。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC4754273/)</sup>对于方差不相等的情况，比较可能反转。一项受癌症研究实例启发的设计研究表明，等方差和不等方差的两样本t检验在方差不等但使用等大样本时可能损失大量效能，而威尔科克森-曼-惠特尼检验不表现这种行为，因此在规划研究时，各组之间样本量的分配值得注意。<sup>[16](https://arxiv.org/abs/2211.12556)</sup>总样本量非常小时，该检验效能很低；如果总样本量为七或更少，无论各组差异多大，该检验给出的p值都大于0.05。<sup>[8](https://www.graphpad.com/guides/prism/latest/statistics/how_the_mann-whitney_test_works.htm)</sup>

## 效应量与报告

由于仅凭p值对幅度说明甚少，建议使用与该检验一致的效应量度量，包括瓦尔加-德莱尼A、克利夫德尔塔和格拉斯秩二列相关系数。<sup>[12](https://rcompanion.org/documents/RHandbookProgramEvaluation.pdf)</sup>量U/n₁n₂估计的是从一个组中随机抽取的值大于另一组中随机抽取的值的概率，即优势概率；临床试验中使用的胜率与曼-惠特尼U统计量密切相关，可以通过将每一次组间比较评分为胜、负或平来估计。<sup>[17](https://pmc.ncbi.nlm.nih.gov/articles/PMC13063477/)</sup>威尔科克森-曼-惠特尼优势比与秩和检验结果一一对应，而均数和中位数缺乏这种对应关系，因此可以是更优的概括度量。<sup>[11](https://pubmed.ncbi.nlm.nih.gov/23456667/)</sup>

建议的报告内容包括各组中位数和四分位距、U统计量或标准化z统计量、p值，以及对所比较的独立组的清晰描述。<sup>[15](https://www.ncbi.nlm.nih.gov/sites/books/NBK560699/)</sup>

## 扩展与相关方法

该检验属于一个更大的家族。单侧威尔科克森-曼-惠特尼统计量支持基于秩的随机占优检验，并且已开发出修正的自助法版本来控制该情形下的零假设拒绝率。<sup>[18](https://arxiv.org/abs/2210.08892)</sup>对于临床试验中的有序结局，曼-惠特尼U检验及相关效应量度量是一种标准方法，它保留了量表的有序性质，而比例优势模型可以概念化为它的多变量扩展。<sup>[19](https://www.neurology.org/doi/10.1212/WNL.0000000000210229)</sup><sup> • </sup><sup>[20](https://academic.oup.com/cid/article/81/5/e319/8161766)</sup>该检验在其精确置换形式下也能处理二值数据：费希尔精确检验可以视为精确威尔科克森-曼-惠特尼检验的特例，两者产生相同的p值。<sup>[13](https://journals.plos.org/plosone/article/file?id=10.1371%2Fjournal.pone.0309074&type=printable)</sup>

## 历史

弗兰克·威尔科克森于1945年12月在《生物统计公报》上提出了等价的秩和检验，仅处理样本量相等的情况，并且只列出了其统计量分布的少数几个点。当时在俄亥俄州立大学的亨利·B·曼和唐纳德·R·惠特尼于1947年发表论文，计算了U的方差、矩和极限分布，列出了样本量不超过n = m = 8时的精确概率表，并证明了当n和m以任意方式增长时U的极限分布为正态分布；他们证明了该检验对于“一个分布处处大于另一个分布”的备择假设是一致的。<sup>[3](https://webspace.ship.edu/pgmarr/Geo441/Readings/Mann%20and%20Whitney%201947%20-%20On%20a%20Test%20of%20Whether%20one%20of%20Two%20Random%20Variables%20is%20Stochastically%20Larger%20than%20the%20Other.pdf)</sup>

## References

1. [Mann Whitney U test, Statistics Decrypted, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC8933355/)
2. [Flynn, thesis, University College London](https://discovery.ucl.ac.uk/id/eprint/10053296/1/Flynn_10053296_thesis.Redacted.pdf)
3. [Mann HB, Whitney DR (1947). On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other. Annals of Mathematical Statistics 18(1):50–60](https://webspace.ship.edu/pgmarr/Geo441/Readings/Mann%20and%20Whitney%201947%20-%20On%20a%20Test%20of%20Whether%20one%20of%20Two%20Random%20Variables%20is%20Stochastically%20Larger%20than%20the%20Other.pdf)
4. [Nonparametric statistical tests for the continuous data, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC4754273/)
5. [FAQ: Why is the Mann-Whitney significant when the medians are equal?, UCLA IDRE](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faq-why-is-the-mann-whitney-significant-when-the-medians-are-equal/)
6. [scipy.stats.mannwhitneyu, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html)
7. [R manual, wilcox.test](https://stat.ethz.ch/CRAN/doc/manuals/r-release/fullrefman.pdf)
8. [Interpreting results: Mann-Whitney test, GraphPad Prism 11 Statistics Guide](https://www.graphpad.com/guides/prism/latest/statistics/how_the_mann-whitney_test_works.htm)
9. [Medical Statistics textbook](https://dspace.mchs.mw/api/core/bitstreams/1eb370b5-4b2f-451b-8f43-f78ece1ea326/content)
10. [Fay MP, Proschan MA (2010). Wilcoxon-Mann-Whitney or t-test? Statistics Surveys 4:1–39](https://pmc.ncbi.nlm.nih.gov/articles/PMC2857732/)
11. [Divine G et al. (2013). Statistical grand rounds: Wilcoxon tests. Anesthesia & Analgesia 117(3):699–710](https://pubmed.ncbi.nlm.nih.gov/23456667/)
12. [Mann–Whitney U Test and Wilcoxon Rank-Sum Test for Two-Sample Data, R Companion Handbook](https://rcompanion.org/documents/RHandbookProgramEvaluation.pdf)
13. [Neuhäuser M, Ruxton GD (2024). A note on the Wilcoxon-Mann-Whitney test and tied observations. PLoS ONE 19(8):e0309074](https://journals.plos.org/plosone/article/file?id=10.1371%2Fjournal.pone.0309074&type=printable)
14. [Brunner E, Munzel U (2000). The Nonparametric Behrens-Fisher Problem. Biometrical Journal 42(1):17–25](https://onlinelibrary.wiley.com/doi/abs/10.1002/%28SICI%291521-4036%28200001%2942%3A1%3C17%3A%3AAID-BIMJ17%3E3.0.CO%3B2-U)
15. [McNemar and Mann-Whitney U Tests, StatPearls](https://www.ncbi.nlm.nih.gov/sites/books/NBK560699/)
16. [Optimal design of the Wilcoxon-Mann-Whitney-test, arXiv](https://arxiv.org/abs/2211.12556)
17. [Statistical analysis of Likert-based ordinal scales: a guide for clinical trialists, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC13063477/)
18. [Modified Wilcoxon-Mann-Whitney tests of stochastic dominance, arXiv](https://arxiv.org/abs/2210.08892)
19. [Statistical Practice of Ordinal Outcome Analysis in Neurologic Trials, Neurology](https://www.neurology.org/doi/10.1212/WNL.0000000000210229)
20. [Making Sense of Hierarchical Composite End Points in Randomized Clinical Trials, Clinical Infectious Diseases](https://academic.oup.com/cid/article/81/5/e319/8161766)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Estimation theory and estimator families › Robust statistics and resampling › Rank-based and distribution-free robust methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/mann-whitney-u-test

English original: https://www.edgepedia.org/mann-whitney-u-test
