# 曼特尔检验

曼特尔检验（Mantel test）是一种基于置换的统计检验，用于评估两个方阵之间的关联性，这两个方阵的元素是同一组 n 个对象之间的距离、相异性或相似性。它已被应用于生命科学的不同领域。<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC11696488/)</sup> 在其最简单的形式中，它将一个地理距离矩阵与同一组对象之间的遗传距离或其他相异性矩阵进行比较。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup> 由于距离矩阵的成对元素相互依赖，通常的显著性检验不再有效，因此该检验改为通过置换整个对象来构建其零分布。<sup>[3](https://vegandevs.github.io/vegan/reference/mantel.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 统计量 | 曼特尔相关是两个距离矩阵对应上三角元素之间的皮尔逊相关；其范围从 −1 到 +1。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup><sup> • </sup><sup>[4](https://uw.pressbooks.pub/appliedmultivariatestatistics/chapter/mantel-test/)</sup> |
| 零假设 | 矩阵 A 中对象间的距离与矩阵 B 中同一组对象间的距离线性无关。<sup>[5](http://www.numericalecology.com/Reprints/Partial_Mantel_paper.pdf)</sup> |
| 随机化 | 一个矩阵保持固定，另一个矩阵的行与对应列一起置换，从而保持矩阵的对称性。<sup>[6](http://www.pelagicos.net/MARS6300/readings/Smouse_et_al._1986.pdf)</sup> |
| 置换次数 | 在示例中 999 次置换很常见，但基于 500–2000 次置换的概率估计可能带有 5–6% 的误差；为获得稳定的 p 值，建议使用 10,000 次或更多。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC3873175/)</sup><sup> • </sup><sup>[8](https://doi.org/10.1139/z89-108)</sup> |
| 主要变体 | 偏曼特尔检验、曼特尔相关图、距离矩阵多元回归（MRM）和 CADM。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup> |
| 已知失效模式 | 当响应变量和解释变量均存在空间自相关时，在名义 5% 水平下第一类错误率可达 25–55%。<sup>[9](https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210x.12018)</sup> |
| 软件 | vegan 包计算曼特尔检验和偏曼特尔检验；ecodist 提供偏曼特尔 r 和 MRM。<sup>[3](https://vegandevs.github.io/vegan/reference/mantel.html)</sup><sup> • </sup><sup>[10](https://search.r-project.org/CRAN/refmans/ecodist/html/mantel.html)</sup> |

## 工作原理

曼特尔检验是一种检验两个 \( n \times n \) 矩阵之间关联性的方法，矩阵元素为所有对象对之间的距离或相似性。<sup>[11](https://people.clas.ufl.edu/jlichstein/files/Lichstein_2007_Plant_Ecol.pdf)</sup> 他最初的统计量是两个矩阵中距离的交叉乘积，即对所有对象对的两个距离值乘积求和。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup><sup> • </sup><sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC3873175/)</sup> 现代程序则计算曼特尔相关，即标准化距离之间的交叉乘积除以 \( (d - 1) \)，其中 \( d \) 是每个矩阵上三角部分中距离的数量；这实际上就是对应元素之间的皮尔逊相关，取值介于 −1 和 +1 之间，且这种变换对置换检验的概率没有影响。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup><sup> • </sup><sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC3873175/)</sup>

零假设是矩阵 A 中对象间的距离与矩阵 B 中同一组对象间的距离线性无关。<sup>[5](http://www.numericalecology.com/Reprints/Partial_Mantel_paper.pdf)</sup> 对于对称矩阵，仅使用上（或下）三角元素；对于非对称矩阵，两部分均纳入，且主对角线无需包含在内。<sup>[5](http://www.numericalecology.com/Reprints/Partial_Mantel_paper.pdf)</sup>

需要置换的原因在于结构本身：一个 \( n \times n \) 距离矩阵包含 \( n(n - 1)/2 \) 个元素，却仅有 \( n \) 个观测，因此元素之间相互依赖，通常的显著性检验不再有效。<sup>[3](https://vegandevs.github.io/vegan/reference/mantel.html)</sup><sup> • </sup><sup>[6](http://www.pelagicos.net/MARS6300/readings/Smouse_et_al._1986.pdf)</sup> 在零假设下，可置换的单位是对象，而非距离。<sup>[5](http://www.numericalecology.com/Reprints/Partial_Mantel_paper.pdf)</sup> 因此随机化置换的是一个矩阵的 n 个对象，这等价于将其行与对应列一起置换：如果第一行和第四行互换，第一列和第四列也互换，从而矩阵保持对称。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup><sup> • </sup><sup>[12](https://lukejharmon.github.io/assets/HarmonGlor_2010_Evolution.pdf)</sup>

## 操作步骤

该过程分为四步。<sup>[9](https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210x.12018)</sup>

1. 从同一组对象构建两个 \( n \times n \) 距离矩阵。
2. 计算对应元素之间的标量积（或等价地，曼特尔相关）。
3. 在大量迭代中，均匀地抽取 {1, …, n} 的一个随机置换，将其应用于一个矩阵的行和对应列，并重新计算统计量；一个矩阵保持固定，另一个被置换。<sup>[9](https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210x.12018)</sup><sup> • </sup><sup>[6](http://www.pelagicos.net/MARS6300/readings/Smouse_et_al._1986.pdf)</sup>
4. 通过将观测统计量与置换值进行比较来推导 p 值，对于正相关的一侧检验，通常取上尾。<sup>[9](https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210x.12018)</sup><sup> • </sup><sup>[3](https://vegandevs.github.io/vegan/reference/mantel.html)</sup>

在 999 次随机化下，若没有任何随机化值超过观测值，则 p 值报告为 \( 1/1000 \)，因为观测值被保守地同时加入分子和分母。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC3873175/)</sup> 更一般地，置换 p 值为 \( p = (N + 1)/(n + 1) \)，其中 \( n \) 是置换次数，因此可实现的最小 p 值为 \( 1/(n + 1) \)。<sup>[13](https://rdrr.io/cran/vegan/man/permutations.html)</sup> 当矩阵维度较小（\( K < 7 \)）时，惯常做法是对所有 \( K! \) 个等可能置换评估该准则；若 \( K \) 较大，则有放回地抽取大量随机置换。<sup>[6](http://www.pelagicos.net/MARS6300/readings/Smouse_et_al._1986.pdf)</sup> 关于需要多少次置换，实践中存在分歧：示例和软件默认值通常使用 999 次，<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC3873175/)</sup> 而一项关于概率稳定性的方法学研究发现在 500–2000 次置换下可能带有 5–6% 的误差，建议至少使用 10,000 次置换，当观测概率接近 0.05 等临界值时则使用 100,000 次。

## 起源

该检验最初用于考察白血病发生的空间模式。<sup>[14](https://aacrjournals.org/cancerres/article-pdf/27/2_Part_1/209/2382183/cr0272p10209.pdf)</sup><sup> • </sup><sup>[4](https://uw.pressbooks.pub/appliedmultivariatestatistics/chapter/mantel-test/)</sup> 该应用以一种广义回归方法，将 \( n \) 个观测疾病案例所形成的 \( n(n - 1)/2 \) 个对象对的空间距离矩阵与时间距离矩阵联系起来。<sup>[14](https://aacrjournals.org/cancerres/article-pdf/27/2_Part_1/209/2382183/cr0272p10209.pdf)</sup><sup> • </sup><sup>[15](https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.12425)</sup> 他在文章结尾声称该方法可普遍用于评估两个方形距离矩阵元素之间的相关性。<sup>[9](https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210x.12018)</sup>

该过程随后被扩展为非参数形式的分析。<sup>[15](https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.12425)</sup> 通过标准正态离差 SND = Zm/var(Zm)^(1/2) 来评估统计量是有偏的，仅在大样本量下表现良好；取而代之的是，零分布应通过置换一个距离矩阵的行和列来经验性地获得。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC3873175/)</sup> 矩阵对应检验随后被群体生物学所采用，此前曾用于地理学和心理测量学。<sup>[6](http://www.pelagicos.net/MARS6300/readings/Smouse_et_al._1986.pdf)</sup><sup> • </sup><sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC3873175/)</sup>

## 变体

若干衍生形式在相同的距离矩阵框架下运作。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup>

- **偏曼特尔检验。** 由 Smouse、Long 和 Sokal（1986）提出，它在控制第三个距离矩阵的条件下评估两个距离矩阵之间的依赖性，第三个矩阵可能包含系统发育、地理或成本距离值；统计量为在给定第三个距离变量的条件下两个距离变量的偏相关系数，使用相同的置换程序。<sup>[9](https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210x.12018)</sup> Smouse、Long 和 Sokal 表明，曼特尔处理实际上是一种回归分析，其归一化度量等价于交叉乘积统计量的归一化。<sup>[6](http://www.pelagicos.net/MARS6300/readings/Smouse_et_al._1986.pdf)</sup>
- **曼特尔相关图。** Borcard 和 Legendre（2012）警告不要使用偏曼特尔检验，并推荐改用曼特尔相关图。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup><sup> • </sup><sup>[3](https://vegandevs.github.io/vegan/reference/mantel.html)</sup>
- **距离矩阵多元回归（MRM）。** 其显著性检验在 Legendre 等（1994）中描述，MRM 通过将一个响应距离矩阵对任意数量的解释距离矩阵进行回归，扩展了经典曼特尔检验和偏曼特尔检验；它因能处理多个解释变量、非参数关系、多种数据类型以及不同尺度的空间自相关而受到关注。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup><sup> • </sup><sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC11696488/)</sup>
- **CADM。** 距离矩阵间一致性检验将框架扩展到多个矩阵。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup>
- **斯皮尔曼变体。** 可以计算矩阵元素之间的斯皮尔曼相关而非皮尔逊相关。<sup>[6](http://www.pelagicos.net/MARS6300/readings/Smouse_et_al._1986.pdf)</sup><sup> • </sup><sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup>

## 应用

自最初用于疾病的时空扩散以来，曼特尔检验已被应用于整个生命科学领域。<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC11696488/)</sup> 在空间遗传分析中，其最简单的形式比较同一组对象之间的地理距离与遗传相异性。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup> 在系统发育比较情境中，距离矩阵通常由系统发育路径距离构成，即分子系统发育树上分隔物种对的枝长之和。<sup>[12](https://lukejharmon.github.io/assets/HarmonGlor_2010_Evolution.pdf)</sup>

## 局限性与替代方法

核心局限在于成对距离之间的依赖性，这正是置换程序存在的原因；蒙特卡罗零分布为简单检验处理了这种非独立性。<sup>[6](http://www.pelagicos.net/MARS6300/readings/Smouse_et_al._1986.pdf)</sup> 更严重的问题是空间自相关。Guillot 和 Rousset 表明，对于他们所考虑的最高空间尺度参数（\( \kappa = 0.7 \)），以 \( \alpha = 5\% \) 为目标的检验实际达到的第一类错误率在 25% 到 40% 之间，并随样本量增加，当 \( n = 200 \) 时可达 55%。<sup>[9](https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210x.12018)</sup> 他们还发现偏曼特尔检验无法控制自相关：纳入地理距离矩阵并不能消除小 p 值的过剩，且这种失败并非由于置换变体的选择。<sup>[9](https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210x.12018)</sup> 关于偏曼特尔检验中所用置换程序有效性的争议曾在文献中出现，Legendre 和 Fortin（2010）对此进行了总结。<sup>[2](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)</sup> 一些基于曼特尔的方法显示出膨胀的第一类错误率，Oden 和 Sokal（1992）对此指出了一个简单的解决方案。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC3873175/)</sup> Legendre、Fortin 和 Borcard（2015）质疑曼特尔检验是否应在地理空间分析中使用。<sup>[15](https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.12425)</sup> 后来的一项基准研究证实，当响应变量和至少一个解释变量均存在空间自相关时，曼特尔检验、偏曼特尔检验和 MRM 的第一类错误率随自相关强度和自相关解释变量数量的增加而增加。<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC11696488/)</sup> 该研究还发现，当不存在空间自相关，或自相关仅影响单个变量时，曼特尔检验和偏曼特尔检验不受第一类错误膨胀的影响。<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC11696488/)</sup>

在与其他方法的比较中，一项基于距离方法的模拟比较发现，ANOSIM 和曼特尔检验对多元离散度的异质性非常敏感，ANOSIM 通常更为敏感，而 PERMANOVA 和 Pillai 迹在平衡设计下基本不受影响；对于非平衡设计，当样本量较小的组离散度较大时所有检验都过于宽松，当样本量较大的组离散度较大时则过于保守。<sup>[16](https://esajournals.onlinelibrary.wiley.com/doi/10.1890/12-2010.1)</sup> 在基于真实生态数据集的模拟中，PERMANOVA 检测群落结构变化的能力通常更强，而曼特尔检验通常比 ANOSIM 更强。<sup>[16](https://esajournals.onlinelibrary.wiley.com/doi/10.1890/12-2010.1)</sup> Harmon 和 Glor（2010）记录了曼特尔检验在使用系统发育路径距离的系统发育比较分析中统计表现不佳。<sup>[12](https://lukejharmon.github.io/assets/HarmonGlor_2010_Evolution.pdf)</sup> 一种广义距离协方差（dCov）检验被提出作为一种更灵活的选项，它将 RV 系数和 dCov 作为特例包含在内，并与 PROTEST 相关联。<sup>[17](https://onlinelibrary.wiley.com/doi/10.1002/env.2238)</sup>

## References

1. [Benchmarking the Mantel test and derived methods for testing association between distance matrices](https://pmc.ncbi.nlm.nih.gov/articles/PMC11696488/)
2. [Comparison of the Mantel test and alternative approaches for detecting complex multivariate relationships in the spatial analysis of genetic data (Legendre & Fortin 2010, Molecular Ecology)](http://www.numericalecology.com/Reprints/Legendre_Fortin_MER_2010.pdf)
3. [Mantel and Partial Mantel Tests for Dissimilarity Matrices, vegan documentation](https://vegandevs.github.io/vegan/reference/mantel.html)
4. [Mantel Test – Applied Multivariate Statistics in R](https://uw.pressbooks.pub/appliedmultivariatestatistics/chapter/mantel-test/)
5. [Comparison of permutation methods for the partial correlation and partial Mantel tests (Legendre, Lapointe & Casgrain)](http://www.numericalecology.com/Reprints/Partial_Mantel_paper.pdf)
6. [Multiple Regression and Correlation Extensions of the Mantel Test of Matrix Correspondence (Smouse, Long & Sokal, 1986)](http://www.pelagicos.net/MARS6300/readings/Smouse_et_al._1986.pdf)
7. [Mantel test in population genetics (Diniz-Filho et al., 2013)](https://pmc.ncbi.nlm.nih.gov/articles/PMC3873175/)
8. [Are probability estimates from the permutation model of Mantel's test stable?](https://doi.org/10.1139/z89-108)
9. [Dismantling the Mantel tests (Guillot & Rousset, Methods in Ecology and Evolution)](https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210x.12018)
10. [mantel (ecodist), CRAN reference manual](https://search.r-project.org/CRAN/refmans/ecodist/html/mantel.html)
11. [Multiple regression on distance matrices: a multivariate spatial analysis tool (Lichstein 2007, Plant Ecology)](https://people.clas.ufl.edu/jlichstein/files/Lichstein_2007_Plant_Ecol.pdf)
12. [Poor statistical performance of the Mantel test in phylogenetic comparative analyses (Harmon & Glor, 2010, Evolution)](https://lukejharmon.github.io/assets/HarmonGlor_2010_Evolution.pdf)
13. [permutations: Permutation tests in Vegan](https://rdrr.io/cran/vegan/man/permutations.html)
14. [The Detection of Disease Clustering and a Generalized Regression Approach (Cancer Research 27:209–220, 1967)](https://aacrjournals.org/cancerres/article-pdf/27/2_Part_1/209/2382183/cr0272p10209.pdf)
15. [Should the Mantel test be used in spatial analysis? (Legendre, 2015, Methods in Ecology and Evolution)](https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.12425)
16. [Warton, Wright & Wang (2012), Distance-based multivariate analyses confounded by multivariate dispersion, simulation comparison of ANOSIM, PERMANOVA and the Mantel test](https://esajournals.onlinelibrary.wiley.com/doi/10.1890/12-2010.1)
17. [A comparison of the Mantel test with a generalised distance covariance test (Environmetrics)](https://onlinelibrary.wiley.com/doi/10.1002/env.2238)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Multivariate association and dimension reduction › Titles A to Me

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/mantel-test

English original: https://www.edgepedia.org/mantel-test
