Computes ALR transformation.
Usage
transform_alr(object, ...)
# S4 method for class 'CompositionMatrix'
transform_alr(object, j = ncol(object), weights = FALSE)
# S4 method for class 'GroupedComposition'
transform_alr(object, j = ncol(object), weights = FALSE)
# S4 method for class 'CLR'
transform_alr(object, j = ncol(object))
# S4 method for class 'GroupedCLR'
transform_alr(object, j = ncol(object), weights = FALSE)Arguments
- object
A
CompositionMatrixobject.- ...
Currently not used.
- j
An
integergiving the index of the rationing part (denominator).- weights
A
logicalscalar: should varying weights (column means) be computed? IfFALSE(the default), equally-weighted parts are used. Alternatively, a positivenumericvector of weights can be specified (will be rescaled to sum to \(1\)). Weights will be used internally by other methods (e.g.variance()).
Value
An ALR object.
References
Aitchison, J. (1986). The Statistical Analysis of Compositional Data. London: Chapman and Hall.
Greenacre, M. J. (2019). Compositional Data Analysis in Practice. Boca Raton: CRC Press.
Greenacre, M. J. (2021). Compositional Data Analysis. Annual Review of Statistics and Its Application, 8(1): 271-299. doi:10.1146/annurev-statistics-042720-124436 .
See also
Other log-ratio transformations:
transform_clr(),
transform_ilr(),
transform_inverse(),
transform_lr(),
transform_plr()
Examples
## Data from Aitchison 1986
data("hongite")
## Coerce to compositional data
coda <- as_composition(hongite)
## Additive log-ratio
alr <- transform_alr(coda)
## Inverse transformation
inv_alr <- transform_inverse(alr)
all.equal(coda, inv_alr)
#> [1] TRUE
