Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bc

The Box-Cox transformation applied to ratios of components


Description

The Box-Cox transformation applied to ratios of components.

Usage

bc(x, lambda)

Arguments

x

A matrix with the compositional data. The first component must be zero values free.

lambda

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 λ=0 the additive log-ratio transformation (alr) is applied.

Details

The Box-Cox transformation applied to ratios of components, as described in Aitchison (1986) is applied.

Value

A matrix with the transformed data.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Aitchison J. (1986). The statistical analysis of compositional data. Chapman & Hall.

See Also

Examples

library(MASS)
x <- as.matrix(fgl[, 2:9])
x <- x / rowSums(x)
y1 <- bc(x, 0.2)
y2 <- bc(x, 0)
rbind( colMeans(y1), colMeans(y2) )
rowSums(y1)
rowSums(y2)

Compositional

Compositional Data Analysis

v4.6
GPL (>= 2)
Authors
Michail Tsagris [aut, cre], Giorgos Athineou [aut], Abdulaziz Alenazi [ctb]
Initial release
2021-04-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.