Learn R Programming

robCompositions (version 2.0.0)

pcaCoDa: Robust principal component analysis for compositional data

Description

This function applies robust principal component analysis for compositional data.

Usage

pcaCoDa(x, method = "robust", mult_comp = NULL)
"print"(x, ...)

Arguments

x
compositional data
method
either “robust” (default) or “standard”
mult_comp
a list of numeric vectors holding the indices of linked compositions
...
additional parameters for print method passed through

Value

scores
scores in clr space
loadings
loadings in clr space
eigenvalues
eigenvalues of the clr covariance matrix
method
method
princompOutputClr
output of princomp needed in plot.pcaCoDa

Details

The compositional data set is transformed using the ilr tranformation. Afterwards, robust principal component analysis is performed. Resulting loadings and scores are back-transformed to the clr space where the compositional biplot can be shown.

mult_comp is used when there are more than one group of compositional parts in the data. To give an illustrative example, lets assume that one variable group measures angles of the inner ear-bones of animals which sum up to 100 and another one having percentages of a whole on the thickness of the inner ear-bones included. Then two groups of variables exists which are both compositional parts. The ilr-transformation is then internally applied to each group independently whenever the mult_comp is set correctly.

References

Filzmoser, P., Hron, K., Reimann, C. (2009) Principal Component Analysis for Compositional Data with Outliers. Environmetrics, 20, 621-632.

See Also

print.pcaCoDa, plot.pcaCoDa

Examples

Run this code

data(expenditures)
p1 <- pcaCoDa(expenditures)
p1
plot(p1)

## just for illustration how to set the mult_comp argument
p1 <- pcaCoDa(expenditures, mult_comp=list(c(1,2,3),c(4,5)))
p1

Run the code above in your browser using DataLab