Learn R Programming

robCompositions (version 1.3.2)

alr: additive log-ratio transformation

Description

The alr transformation opens compositional data into an unconstrained form in the real space.

Usage

alr(x, ivar=ncol(x))

Arguments

x
Multivariate compositional data
ivar
Rationing variable

Value

  • A list of class alr which includes the following content:
  • x.alrthe transformed data
  • varxthe rationing variable
  • ivarthe index of the rationing variable, indicating the column number of the rationing variable in the data matrix x
  • cnamesthe column names of x
  • The additional information such as cnames or ivar is usefull when a back-transformation is applied on the same data set.

Details

The variables divided by its rationing variable before the logarithm is taken. This results in an D-1 dimensional space, with D the dimension of the data matrix x.

References

Aitchison, J. (1986) The Statistical Analysis of Compositional Data Monographs on Statistics and Applied Probability. Chapman & Hall Ltd., London (UK). 416p.

See Also

ilr

Examples

Run this code
data(arcticLake)
x <- arcticLake
x.alr <- alr(x, 2)
y <- invalr(x.alr)
## This exactly fulfills:
invalr(alr(x, 3))
data(expenditures)
x <- expenditures
y <- invalr(alr(x, 5))
head(x)
head(y)
## --> absolute values are preserved as well.

## preserve only the ratios:
invalr(x.alr, ivar=2, useClassInfo=FALSE)

Run the code above in your browser using DataLab