# 成分数据分析

成分数据分析（Compositional data analysis，CoDA）是统计学的一个分支，处理的是只携带相对信息的数据，例如百分比、比例或百万分数值——这些数值之和为一个固定总量。由于每个观测的各成分被约束为恒定总和，直接将普通多元方法应用于原始数值会产生虚假相关和扭曲的协方差结构；CoDA 转而分析成分之间比值的对数，在一个为受约束数据而设计的单纯形几何中进行。<sup>[1](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-042720-124436)</sup><sup> • </sup><sup>[2](https://ww2.amstat.org/meetings/proceedings/2014/data/assets/pdf/312239_89024.pdf)</sup> 该领域建立在 J. Aitchison 1986 年专著《成分数据的统计分析》（*The Statistical Analysis of Compositional Data*）所确立的对数比方法之上。<sup>[3](https://doi.org/10.1007/978-94-009-4109-0)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 携带相对而非绝对信息的非负数据，通常受恒定总和约束（比例之和为 1，百分比之和为 100）<sup>[1](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-042720-124436)</sup> |
| 核心问题 | 闭合在固定总和成分数据的各成分之间诱发虚假相关；共享同一成分的比值之间的相关也可能源自该共享分母，而与闭合无关<sup>[2](https://ww2.amstat.org/meetings/proceedings/2014/data/assets/pdf/312239_89024.pdf)</sup><sup> • </sup><sup>[25](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004075)</sup> |
| 解决方案 | 变换为成分比值的对数，之后标准的单变量和多元方法即可适用<sup>[1](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-042720-124436)</sup> |
| 主要变换 | 加性对数比（alr）、中心对数比（clr）和等距对数比（ilr），各有不同的取舍<sup>[4](http://www.sediment.uni-goettingen.de/staff/tolosana/extra/CoDaNutshell.pdf)</sup> |
| 核心实践障碍 | 零值，因为对数比在零处无定义；稀疏测序表可达约 90% 的零单元格<sup>[1](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-042720-124436)</sup><sup> • </sup><sup>[5](https://digitalcollection.zhaw.ch/items/a8e26557-b5a4-4c85-ac66-00b14d2d2c2b/full)</sup> |
| 奠基工作 | Aitchison 1986 年的专著，其前身为他 1982 年向皇家统计学会宣读的论文<sup>[3](https://doi.org/10.1007/978-94-009-4109-0)</sup><sup> • </sup><sup>[6](https://arxiv.org/html/2201.05197v3)</sup> |
| 软件 | R 包，包括 compositions、zCompositions、robCompositions、ALDEx2、philr 和 CoDaLoMic<sup>[7](https://f1000research.com/articles/7-1278)</sup> |

## 工作原理

含 D 个部分的成分的样本空间是单纯形，即各分量非负且总和为常数 κ 的向量集合，其中 κ 对比例为 1，对百分比为 100，对 ppm 为 \( 10^{6} \)，对 ppb 为 \( 10^{9} \)。<sup>[4](http://www.sediment.uni-goettingen.de/staff/tolosana/extra/CoDaNutshell.pdf)</sup> 在此空间内，普通加法和标量乘法被两种运算取代：扰动，定义为 \( z = x \oplus y = C[x_{1} \cdot y_{1}; \ldots; x_{D} \cdot y_{D}] \)，其中 C 表示闭合（重新缩放使总和为 κ）；以及幂运算，\( z = \lambda \odot x = C[x_{1}^{\lambda}; \ldots; x_{D}^{\lambda}] \)。<sup>[4](http://www.sediment.uni-goettingen.de/staff/tolosana/extra/CoDaNutshell.pdf)</sup> 这些运算由 Aitchison 在其 1986 年专著中引入，使单纯形成为一个阿贝尔群，并构成了如今所称的艾奇逊几何（Aitchison geometry）的基础。<sup>[3](https://doi.org/10.1007/978-94-009-4109-0)</sup><sup> • </sup><sup>[8](https://www.ajs.or.at/index.php/ajs/article/download/vol45-4-4/525)</sup> 距离用艾奇逊距离度量，它由对数比差的平方和构成；各部分之间的依赖性由变异矩阵 \( T = [\tau_{ij}] \) 概括，其中 \( \tau_{ij} = \mathrm{Var}\,\ln(x_{i}/x_{j}) \)；\( \tau_{ij} \) 接近零的值表明部分 \( x_{i} \) 和 \( x_{j} \) 成比例。<sup>[4](http://www.sediment.uni-goettingen.de/staff/tolosana/extra/CoDaNutshell.pdf)</sup>

Aitchison 表明，无论采用变换技术还是留在单纯形内的方法，推断结果都是相同的。<sup>[9](http://leg.ufpr.br/lib/exe/fetch.php/pessoais:abtmartins:a_concise_guide_to_compositional_data_analysis.pdf)</sup> 指导原则是尺度不变性：成分只提供关于各部分相对大小的信息，因此分析应基于成分比值，而对数使这些比值在数学上易于处理。<sup>[9](http://leg.ufpr.br/lib/exe/fetch.php/pessoais:abtmartins:a_concise_guide_to_compositional_data_analysis.pdf)</sup>

## 如何实施

典型工作流程先处理零值，选择一种对数比变换，然后对变换后的坐标应用标准多元方法。<sup>[1](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-042720-124436)</sup> 一旦数据变换为对数比，就可以使用降维、聚类和建模等常规方法。<sup>[1](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-042720-124436)</sup> 成分均值以闭合几何均值的形式恢复，\( \mathrm{Mean}_{A}[X] = \mathrm{clr}^{-1}(\mathrm{Mean}[\ln X]) \)，因此估计值通过逆 clr 回到单纯形。<sup>[4](http://www.sediment.uni-goettingen.de/staff/tolosana/extra/CoDaNutshell.pdf)</sup>

零值要求在计算任何对数比之前做出决定。零值被分类为低于检测限的零值、结构零值和随机缺失值，即使仔细的插补也可能根据数据集其余部分的不同而产生截然不同的比值。<sup>[10](http://stat.boogaart.de/Publications/iamg06_s07_01.pdf)</sup> 替代替换的方法包括：将含缺失部分的 clr 变换成分投影到缺失部分 clr 方向的正交补上，从而在不插补的情况下给出无偏的均值和方差估计量；<sup>[10](http://stat.boogaart.de/Publications/iamg06_s07_01.pdf)</sup> 合并成分以消除零值；<sup>[1](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-042720-124436)</sup> 以及反正弦转换，后者在零处有良好定义且无需替换。<sup>[11](https://pmc.ncbi.nlm.nih.gov/articles/PMC11609487/)</sup>

主要的 R 实现有 compositions、zCompositions（左删失成分数据的多元插补）、robCompositions（稳健分析）、ALDEx2、philr 和 CoDaLoMic。<sup>[7](https://f1000research.com/articles/7-1278)</sup><sup> • </sup><sup>[1](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-042720-124436)</sup> ALDEx2 由 Andrew D Fernandes 及其同事于 2014 年在《微生物组》上提出，它使用从狄利克雷分布采样的蒙特卡洛实例将读数建模为比例，并在贝叶斯框架下处理零值。<sup>[12](https://pmc.ncbi.nlm.nih.gov/articles/PMC4030730/)</sup>

## 起源

Karl Pearson 于 1897 年在《伦敦皇家学会会刊》（*Proceedings of the Royal Society of London*）上警告不要解释分子和分母含有共同部分的比值之间的相关，并证明如果 X、Y 和 Z 不相关，X/Z 和 Y/Z 也不会不相关。<sup>[13](https://doi.org/10.1098/rspl.1896.0076)</sup><sup> • </sup><sup>[2](https://ww2.amstat.org/meetings/proceedings/2014/data/assets/pdf/312239_89024.pdf)</sup> 这一警告在很大程度上被忽视，直到 1960 年代，包括 Chayes、Krumbein、Sarmanov 和 Vistelius 在内的地质学家以及生物学家 Mosimann 再次提出了这个问题；Chayes 1960 年在《地球物理研究杂志》（*Journal of Geophysical Research*）上的论文将虚假相关与恒定总和数据联系起来，并表明由于单位总和约束，成分之间的某些相关必然是负的。<sup>[9](http://leg.ufpr.br/lib/exe/fetch.php/pessoais:abtmartins:a_concise_guide_to_compositional_data_analysis.pdf)</sup><sup> • </sup><sup>[14](https://doi.org/10.1029/jz065i012p04185)</sup><sup> • </sup><sup>[2](https://ww2.amstat.org/meetings/proceedings/2014/data/assets/pdf/312239_89024.pdf)</sup>

一套恰当的方法论在 1980 年代出现：单纯形上的逻辑正态分布由 J. Aitchison 和 S. M. Shen 于 1980 年在《生物计量学》（*Biometrika*）上提出，<sup>[15](https://doi.org/10.2307/2335470)</sup><sup> • </sup><sup>[6](https://arxiv.org/html/2201.05197v3)</sup><sup> • </sup><sup>[16](http://wiki.leg.ufpr.br/lib/exe/fetch.php/pessoais:abtmartins:thestatisticalanalysisofcompositionaldata.pdf)</sup> 而 1986 年的专著确立了该领域。<sup>[3](https://doi.org/10.1007/978-94-009-4109-0)</sup> 这项工作是对原始百分比无约束分析的反动，后者忽视了数据点被限制在单纯形内这一事实。<sup>[16](http://wiki.leg.ufpr.br/lib/exe/fetch.php/pessoais:abtmartins:thestatisticalanalysisofcompositionaldata.pdf)</sup>

## 变体

三种经典变换在参照和几何上有所不同。加性对数比将含 D 个部分的成分映射到 \( \mathbb{R}^{D-1} \)，形式为 \( \mathrm{alr}(x) = [\ln(x_{1}/x_{D}); \ldots; \ln(x_{D-1}/x_{D})] \)，逆变换为 \( \mathrm{alr}^{-1}(y) = C[\exp([y; 0])] \)；它支持无约束分析，但使用任意参照部分并在斜基中定义坐标，因此不是等距变换。<sup>[4](http://www.sediment.uni-goettingen.de/staff/tolosana/extra/CoDaNutshell.pdf)</sup><sup> • </sup><sup>[7](https://f1000research.com/articles/7-1278)</sup> 中心对数比对称地对待各部分，\( \mathrm{clr}(x) = \ln(x/g(x)) \)，其中 \( g(x) = (x_{1} x_{2} \cdots x_{D})^{1/D} \)，逆变换为 \( \mathrm{clr}^{-1}(z) = C[\exp(z)] \)，但所得的 D 个坐标是奇异的（它们之和为零），且 clr 不具有子成分一致性。<sup>[4](http://www.sediment.uni-goettingen.de/staff/tolosana/extra/CoDaNutshell.pdf)</sup><sup> • </sup><sup>[6](https://arxiv.org/html/2201.05197v3)</sup><sup> • </sup><sup>[7](https://f1000research.com/articles/7-1278)</sup> 等距对数比，\( \mathrm{ilr}_{V}(x) = \mathrm{clr}(x) \cdot V \)，其中 \( V \cdot V^{t} = I_{D-1} \)，产生 \( D-1 \) 个线性无关的等距坐标；其缺点是将这些坐标解释为几何均值之比较为复杂。<sup>[4](http://www.sediment.uni-goettingen.de/staff/tolosana/extra/CoDaNutshell.pdf)</sup><sup> • </sup><sup>[6](https://arxiv.org/html/2201.05197v3)</sup> 平衡（balances）提供了可解释的 ilr 坐标：对各部分进行序贯二元划分可定义 \( D-1 \) 个平衡，其方差之和等于样本总方差，该方法由 J. J. Egozcue 和 V. Pawlowsky-Glahn 于 2005 年在《数学地质》（*Mathematical Geology*）上提出。<sup>[17](https://doi.org/10.1007/s11004-005-7381-9)</sup><sup> • </sup><sup>[7](https://f1000research.com/articles/7-1278)</sup>

领域特定的变体包括 PhILR——一种用于微生物群数据的系统发育 ilr 变换，由 Justin D Silverman 及其同事于 2017 年在《eLife》上描述，<sup>[18](https://doi.org/10.7554/elife.21887)</sup> 以及在《健康与疾病中的微生物生态学》（*Microbial Ecology in Health and Disease*）上介绍的 ANCOM，连同在《自然·通讯》（*Nature Communications*）上介绍的、经过偏差校正的后继方法 ANCOM-BC。<sup>[19](https://doi.org/10.3402/mehd.v26.27663)</sup><sup> • </sup><sup>[20](https://doi.org/10.1038/s41467-020-17041-7)</sup> 近期的补充包括 chiPower 变换——一种基于幂的、可允许零值的对数比替代方法，由 Michael Greenacre 于 2024 年在《数据分析与分类进展》（*Advances in Data Analysis and Classification*）上描述。<sup>[21](https://doi.org/10.1007/s11634-024-00600-x)</sup><sup> • </sup><sup>[6](https://arxiv.org/html/2201.05197v3)</sup>

## 应用

CoDA 起源于地球化学，该领域以百分比或 ppm 记录的数据受恒定总和约束，使得许多普通统计分析无法进行。<sup>[22](https://www.jstage.jst.go.jp/article/geosoc/112/3/112_3_173/_article/-char/en)</sup> 高通量测序是另一个主要应用领域：RNA-seq 和 16S rRNA 数据集是成分性的，因为每个样本的总读数不携带信息，它们映射到艾奇逊单纯形而非欧几里得空间，而标准工具假设欧几里得计数数据。<sup>[12](https://pmc.ncbi.nlm.nih.gov/articles/PMC4030730/)</sup>

## 局限与替代方案

已命名的失效模式源于该理论。子成分一致性——即对部分子集的结果应与对完整成分的结果一致——是一项定义性原则，而 clr 违反了它；单纯形上的线性约束在对数比表示下也变为非线性的。<sup>[2](https://ww2.amstat.org/meetings/proceedings/2014/data/assets/pdf/312239_89024.pdf)</sup><sup> • </sup><sup>[7](https://f1000research.com/articles/7-1278)</sup> 模拟表明，零值的比例和零值替换值的选择都会显著影响对 ALR/CLR 变换数据检验的效能和错误发现率，而 ILR 保持几何性质，但在高维或小样本情形下统计效能可能低于 ALR/CLR。<sup>[11](https://pmc.ncbi.nlm.nih.gov/articles/PMC11609487/)</sup>

与替代方案相比，ANCOM-BC 通过线性回归模型中的样本特定偏移校正不等采样分数，在模拟中 ANCOM 和 ANCOM-BC 在名义水平上控制 FDR，除非样本量低于 10，而其他方法的 FDR 随样本量增加而不断膨胀；DESeq2 和 edgeR 等 RNA-seq 方法在微生物组数据上表现不佳，因为其归一化假设极少数分类单元存在差异丰度。<sup>[23](https://www.nature.com/articles/s41522-020-00160-w)</sup> 一项 38 个数据集的基准测试发现差异丰度工具之间差异很大，ALDEx2 和 ANCOM-II 最为保守和一致，并建议对 16S 数据避免使用 edgeR 和未校正的 LEfSe，而采用多方法共识。<sup>[24](https://www.nature.com/articles/s41467-022-28034-z)</sup>

## References

1. [Compositional Data Analysis (Annual Review of Statistics and Its Application)](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-042720-124436)
2. [Compositional Data: An Overview (Bacon-Shone, JSM 2014 proceedings)](https://ww2.amstat.org/meetings/proceedings/2014/data/assets/pdf/312239_89024.pdf)
3. [J. Aitchison (1986). The Statistical Analysis of Compositional Data. .](https://doi.org/10.1007/978-94-009-4109-0)
4. [Compositional Data Analysis in a Nutshell (Tolosana-Delgado, 2008)](http://www.sediment.uni-goettingen.de/staff/tolosana/extra/CoDaNutshell.pdf)
5. [Comparison of zero replacement strategies for compositional data with large numbers of zeros (Lubbe, Filzmoser & Templ, 2021, Chemometrics and Intelligent Laboratory Systems 210:104248)](https://digitalcollection.zhaw.ch/items/a8e26557-b5a4-4c85-ac66-00b14d2d2c2b/full)
6. [Aitchison's Compositional Data Analysis 40 Years On: A Reappraisal (Greenacre)](https://arxiv.org/html/2201.05197v3)
7. [Visualizing balances of compositional data (F1000Research, 2018)](https://f1000research.com/articles/7-1278)
8. [The Mathematics of Compositional Analysis (Austrian Journal of Statistics)](https://www.ajs.or.at/index.php/ajs/article/download/vol45-4-4/525)
9. [A Concise Guide to Compositional Data Analysis (Aitchison)](http://leg.ufpr.br/lib/exe/fetch.php/pessoais:abtmartins:a_concise_guide_to_compositional_data_analysis.pdf)
10. [Concepts for handling of zeros and missing values in compositional data (van den Boogaart & Tolosana-Delgado, IAMG 2006)](http://stat.boogaart.de/Publications/iamg06_s07_01.pdf)
11. [Review and revamp of compositional data transformation: A new framework combining proportion conversion and contrast transformation](https://pmc.ncbi.nlm.nih.gov/articles/PMC11609487/)
12. [Unifying the analysis of high-throughput sequencing datasets: characterizing RNA-seq, 16S rRNA gene sequencing and selective growth experiments by compositional data analysis (Gloor et al., Microbiome 2014; ALDEx2)](https://pmc.ncbi.nlm.nih.gov/articles/PMC4030730/)
13. [Karl Pearson (1897). Mathematical contributions to the theory of evolution., On a form of spurious correlation which may arise when indices are used in the measurement of organs. Proceedings of the Royal Society of London.](https://doi.org/10.1098/rspl.1896.0076)
14. [F. Chayes (1960). On correlation between variables of constant sum. Journal of Geophysical Research Atmospheres.](https://doi.org/10.1029/jz065i012p04185)
15. [J. Aitchison, S. M. Shen (1980). Logistic-Normal Distributions: Some Properties and Uses. Biometrika.](https://doi.org/10.2307/2335470)
16. [Aitchison (1982) read paper full text, Royal Statistical Society](http://wiki.leg.ufpr.br/lib/exe/fetch.php/pessoais:abtmartins:thestatisticalanalysisofcompositionaldata.pdf)
17. [J. J. Egozcue, V. Pawlowsky-Glahn (2005). Groups of Parts and Their Balances in Compositional Data Analysis. Mathematical Geology.](https://doi.org/10.1007/s11004-005-7381-9)
18. [Justin D Silverman and colleagues (2017). A phylogenetic transform enhances analysis of compositional microbiota data. eLife.](https://doi.org/10.7554/elife.21887)
19. [Siddhartha Mandal and colleagues (2015). Analysis of composition of microbiomes: a novel method for studying microbial composition. Microbial Ecology in Health and Disease.](https://doi.org/10.3402/mehd.v26.27663)
20. [Huang Lin, Shyamal Das Peddada (2020). Analysis of compositions of microbiomes with bias correction. Nature Communications.](https://doi.org/10.1038/s41467-020-17041-7)
21. [Michael Greenacre (2024). The chiPower transformation: a valid alternative to logratio transformations in compositional data analysis. Advances in Data Analysis and Classification.](https://doi.org/10.1007/s11634-024-00600-x)
22. [Problems in compositional data analysis and their solutions (Ohta & Arai, J. Geol. Soc. Japan, 2006)](https://www.jstage.jst.go.jp/article/geosoc/112/3/112_3_173/_article/-char/en)
23. [Analysis of microbial compositions: a review of normalization and differential abundance analysis (npj Biofilms and Microbiomes, 2020)](https://www.nature.com/articles/s41522-020-00160-w)
24. [Microbiome differential abundance methods produce different results across 38 datasets (Nature Communications)](https://www.nature.com/articles/s41467-022-28034-z)
25. [Proportionality: A Valid Alternative to Correlation for Relative Data](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004075)

---
*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/compositional-data-analysis

English original: https://www.edgepedia.org/compositional-data-analysis
