- Introduced by
- John Aitchison
- Year
- 1982
- Type
- Constrained multivariate statistical method
- Family
- Compositional data
What does it do?
Compositional Data Analysis (CoDA) is a branch of multivariate statistics for data that represent parts of a whole, such as proportions, percentages, or concentrations that sum to a constant.
John Aitchison introduced the framework in his 1982 paper, which argued that statistical analysis of data on the simplex had been hampered by the lack of suitable independence concepts and of rich enough parametric distribution classes. The paper introduced independence hypotheses and transformed-normal models on the simplex to address this. Modern CoDA works with log-ratio transformations that respect the relative nature of compositional information.
The intuition behind the method
Imagine describing a pizza by the fraction of each topping rather than absolute amounts. If the cheese fraction rises, every other fraction must fall, because the parts are linked by the constant total. Ordinary statistics ignore this link, so fitted values or correlations can violate the constraint or suggest relationships that come from the constraint itself. CoDA reframes the question in terms of ratios between parts, which are not bound by the total and can be analysed with familiar real-valued tools.
History
John Aitchison formalised the statistical theory of compositional data in his 1982 paper in the Journal of the Royal Statistical Society, Series B. The paper introduced a range of independence hypotheses for data on the simplex and transformed-normal distributions within which those hypotheses can be tested by standard parametric methods. The log-ratio transformations that CoDA now uses are designed to remove the effects of the constant-sum constraint, the closure problem, from the analysis.
When to use it
Use CoDA when observations are vectors of non-negative parts that carry information mainly through their relative magnitudes, such as geochemical element concentrations, microbiome taxon abundances, dietary macronutrient proportions, time-use allocations, or budget shares. It requires strictly positive parts, so zeros must be handled before analysis, and it assumes that relative rather than absolute variation is the scientifically meaningful quantity. Avoid CoDA when absolute amounts matter in their own right, or when the question concerns the total rather than the split between parts. For proportional outcomes, Dirichlet regression is an alternative; normalising the data and then applying standard methods is simpler but lacks the geometric justification that CoDA provides. Inference on log-ratio coordinates, such as hypothesis tests or confidence intervals, assumes a transformed-normal model, meaning that the coordinates are approximately multivariate normal; this should be checked before results are reported.
Limitations and considerations
- Exact zeros cannot be log-transformed directly, and the replacement strategy chosen for observed zeros can affect the results
- Log-ratio coordinates are harder to interpret than the original parts, which can make results difficult to communicate to domain scientists unfamiliar with CoDA
- The ILR basis is not unique, so different choices of basis can make results from different studies hard to compare
- Software packages differ in which transformation they apply by default, which can lead to inconsistent analyses across tools
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Analyses are carried out in the simplex geometry, which avoids the spurious correlations that the constant-sum constraint induces in raw proportions
- Log-ratio coordinates are unchanged by rescaling the parts, so results are the same whether the data are expressed as proportions, percentages, or parts per million
- After transformation, familiar multivariate tools such as PCA, regression, and clustering can be applied to the log-ratio coordinates
- The Aitchison distance gives a defined measure of how far apart two compositions are, based on the log-ratio geometry
Applications
- Geochemistry: analysing major-element oxide compositions of rocks and sediments
- Microbiome research: comparing taxon relative abundances across ecological or clinical groups
- Nutritional epidemiology: modelling dietary macronutrient proportions and their associations with health outcomes
- Economics: studying budget share allocations across expenditure categories
- Time-use research: examining how individuals allocate the 24-hour day across activity categories
How it works
How it works
Before analysis, each observation vector is checked to lie in the simplex S^D: all components must be strictly positive and sum to a common constant, usually 1 or 100. Zero values are problematic because the logarithms in the log-ratio transformations are undefined at zero, so they must be replaced first, for example by multiplicative replacement or Bayesian-multiplicative treatment.
Formula
\mathbf{x} = (x_1, x_2, \ldots, x_D) \in S^D, \quad \sum_{j=1}^{D} x_j = \kappa,\; x_j > 0The additive log-ratio (ALR) transformation maps D compositional parts to D−1 unconstrained real coordinates by taking the natural logarithm of each part divided by a chosen reference part. The result lives in real space and can be analysed with standard multivariate methods. The transformation is not isometric, so it distorts distances relative to the simplex geometry, and the coordinates depend on which part is used as the reference.
Formula
\text{alr}(\mathbf{x}) = \left( \ln\frac{x_1}{x_D},\, \ln\frac{x_2}{x_D},\, \ldots,\, \ln\frac{x_{D-1}}{x_D} \right)The centred log-ratio (CLR) transformation divides each part by the geometric mean of all parts before taking logarithms, producing D coordinates. CLR preserves the Aitchison geometry through an isometric embedding into a zero-sum subspace of real space; it is not an orthonormal coordinate system, which is the role of the isometric log-ratio (ILR) basis. ILR coordinates are obtained by expressing the data in an orthonormal basis of the zero-sum subspace, which makes them non-singular; the choice of basis is not unique. Because CLR coordinates sum to zero, that subspace must be accounted for in principal component analysis and other procedures.
Formula
\text{clr}(\mathbf{x}) = \left( \ln\frac{x_1}{g(\mathbf{x})},\, \ln\frac{x_2}{g(\mathbf{x})},\, \ldots,\, \ln\frac{x_D}{g(\mathbf{x})} \right),\quad g(\mathbf{x}) = \left(\prod_{j=1}^{D} x_j\right)^{1/D}The Aitchison distance is the natural distance on the simplex, computed from CLR coordinates. It is scale-invariant, so multiplying all parts by a constant leaves the distance unchanged, and it is invariant to the order of the parts. It underlies CoDA clustering and ordination; principal component analysis and regression are instead applied to the log-ratio coordinates.
Formula
d_A(\mathbf{x}, \mathbf{y}) = \left[ \sum_{j=1}^{D} \left( \ln\frac{x_j}{g(\mathbf{x})} - \ln\frac{y_j}{g(\mathbf{y})} \right)^2 \right]^{1/2}Common pitfalls
- Applying standard correlation or PCA directly to raw proportions produces spurious negative correlations, an artefact of the constant-sum constraint known as the closure problem.
- Adding a small constant uniformly to all zeros can distort the compositional structure; established zero-replacement methods should be used instead
- ALR coordinates depend on the chosen reference part, so the magnitude and sign of coefficients change with that choice; any reported ALR result must state which part was the denominator
- CoDA discards absolute scale, so if total amounts differ meaningfully between samples, the totals must be analysed separately
Frequently asked questions
Why can't I just use standard statistics on proportions?
Proportions that sum to a constant are linearly dependent by construction, which can induce negative correlations among the parts that reflect the constraint rather than the data. Standard methods assume unconstrained Euclidean data. Applied to the simplex, they can give misleading correlations, principal components that mainly reflect the constant-sum constraint, and regression estimates that ignore it. Log-ratio transformation moves the data to a space where these constraint effects are removed.
How should I handle zeros in compositional data?
True zeros (a part is genuinely absent) and rounded zeros (a part is below the detection limit) require different strategies. Rounded zeros are commonly replaced with multiplicative or Bayesian-multiplicative methods that preserve the compositional structure. True structural zeros may require partitioning the sample or using zero-inflated models. Adding a small constant to all zeros is generally discouraged because it distorts relative relationships.
What is the difference between ALR, CLR, and ILR transformations?
ALR (additive log-ratio) uses a single reference part, is easy to compute, and is not isometric. CLR (centred log-ratio) uses the geometric mean as the reference and is isometric into a zero-sum subspace, but its covariance matrix is singular. ILR (isometric log-ratio) uses an orthonormal basis of the simplex, is fully isometric and non-singular, but requires a choice of basis, which complicates interpretation and comparison across studies.
Related methods
Sources
Aitchison, J. (1982). The statistical analysis of compositional data. Journal of the Royal Statistical Society: Series B, 44(2), 139–177.
Open DOI reference