| Title: | Compositional Data Two-Sample Test of Equal Distributions |
|---|---|
| Description: | Two-sample tests of equal distributions for compositional data, with zero values present. The p-value is computed via permutations. The relevant papers are Stewart C., Iverson S. and Field C. (2014). "Testing for a diet change using fatty acid signatures". Environmental and Ecological Statistics, <doi:10.1007/s10651-014-0280-9> and Sevinc V. and Tsagris. M. (2026). "Energy Based Equality of Distributions Testing for Compositional Data". Communications in Statistics--Simulation and Computation, <doi:10.1080/03610918.2026.2636167>. |
| Authors: | Michail Tsagris [aut, cre] |
| Maintainer: | Michail Tsagris <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0 |
| Built: | 2026-09-23 11:31:30 UTC |
| Source: | https://github.com/cran/CompositionalMPT |
Two-sample tests of equal distributions for compositional data, with zero values present. The p-value is computed via permutations.
| Package: | CompositionalMPT |
| Type: | Package |
| Version: | 1.0 |
| Date: | 2026-08-20 |
Michail Tsagris <[email protected]>.
Michail Tsagris [email protected]
Stewart C., Iverson S. and Field C. (2014). Testing for a change in diet using fatty acid signatures. Environmental and Ecological Statistics, 21(4): 775–792.
Sevinc V. and Tsagris. M. (2026). Energy Based Equality of Distributions Testing for Compositional Data. Communications in Statistics-Simulation and Computation (Accepted for publication). https://arxiv.org/pdf/2412.05199
-transformation
Energy test of equality of distributions using the -transformation.
etest(x, y, a = 0.1, R = 999)etest(x, y, a = 0.1, R = 999)
x |
A matrix with the compositional data of the first sample. |
y |
A matrix with the compositional data of the second sample. |
a |
The value of the power transformation, it has to be between -1 and 1. If zero
values are present it has to be greater than 0. If |
R |
The number of permutations to apply in order to compute the approximate p-value. |
The -transformation is applied to each composition and then the
energy distance of equality of distributions is applied.
The permutation based p-value of the energy test.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Szekely, G. J. and Rizzo, M. L. (2004) Testing for Equal Distributions in High Dimension. InterStat, November (5).
Szekely, G. J. (2000) Technical Report 03-05: E-statistics: Energy of Statistical Samples. Department of Mathematics and Statistics, Bowling Green State University.
Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451
Sevinc V. and Tsagris. M. (2026). Energy Based Equality of Distributions Testing for Compositional Data. Communications in Statistics-Simulation and Computation (Accepted for publication). https://arxiv.org/pdf/2412.05199
x <- matrix( rgamma(20 * 4, 3, 1), ncol = 4 ) x <- x / rowSums(x) ## Dirichlet simulated values y <- matrix( rgamma(30 * 4, 5, 1), ncol = 4 ) y <- y / rowSums(y) ## Dirichlet simulated values etest(x, y)x <- matrix( rgamma(20 * 4, 3, 1), ncol = 4 ) x <- x / rowSums(x) ## Dirichlet simulated values y <- matrix( rgamma(30 * 4, 5, 1), ncol = 4 ) y <- y / rowSums(y) ## Dirichlet simulated values etest(x, y)
Multivariate permutation test of equality of distributions.
mpt(x, y, type = "ait", a = 0, R = 999)mpt(x, y, type = "ait", a = 0, R = 999)
x |
A matrix with the compositional data of the first sample. |
y |
A matrix with the compositional data of the second sample. |
type |
The type of distance to use, "ait", or "chisq". The first corresponds to Aitchison's distance, whereas the second refers to the chi-square distance. |
a |
The value of the power transformation, it has to be between -1 and 1. If zero
values are present it has to be greater than 0. If |
R |
The number of permutations to apply in order to compute the approximate p-value. |
The multivariate permutation test of Stewart et al. (2014) is applied.
A numerical value or a numerical vector, depending on the length of the values
of , with the permutation based p-value(s) of the energy test.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Stewart C., Iverson S. and Field C. (2014). Testing for a change in diet using fatty acid signatures. Environmental and Ecological Statistics, 21(4): 775–792.
x <- matrix( rgamma(20 * 4, 3, 1), ncol = 4 ) x <- x / rowSums(x) ## Dirichlet simulated values y <- matrix( rgamma(30 * 4, 5, 1), ncol = 4 ) y <- y / rowSums(y) ## Dirichlet simulated values mpt(x, y)x <- matrix( rgamma(20 * 4, 3, 1), ncol = 4 ) x <- x / rowSums(x) ## Dirichlet simulated values y <- matrix( rgamma(30 * 4, 5, 1), ncol = 4 ) y <- y / rowSums(y) ## Dirichlet simulated values mpt(x, y)