alrEM {robCompositions}R Documentation

alr-EM Imputation for Rounded Zeros

Description

A modified EM alr-algorithm for replacing rounded zeros in compositional data sets.

Usage

alrEM(x, pos = ncol(x), dl = rep(0.05, ncol(x) - 1), eps = 1e-04, maxit = 50)

Arguments

x Compositional data
pos Position of the rationing variable for alr transformation
dl Detection limit for each part
eps convergence criteria
maxit maximum number of iterations

Details

Statistical analysis of compositional data including zeros runs into problems, because log-ratios cannot be applied. Usually, rounded zeros are considerer as missing not at random missing values. The algorithm first applies an additive log-ratio transformation to the compositions. Then the rounded zeros are imputed using a modified EM algorithm. Details can be found in Palarea-Albaladej and Martinn-Fernandez (2008).

The major difference between their MATLAB implementation and this re-implementatin as a R function is that they use the reg.sweep methodology for regression analysis. Nevertheless, we use the standard lm function from R which based on QR-decompositons, which is more accurate than sweep.

Value

xOrig Original data frame or matrix
xImp Imputed data
wind Index of the missing values in the data
iter Number of iterations
eps eps

Author(s)

Matthias Templ and Karel Hron

References

Palarea-Albaladej, J. and Mart'in-Fern'andez, J.A. (2008) A modified EM alr-algorithm for replacing rounded zeros in compositional data sets. Computers and Geosciences, 34, 902-917

See Also

impCoda

Examples

require(compositions)
require(robCompositions)
data(aitchison359)
x <- aitchison359
## generate rounded zeros artificially:
x[x < 5] <- 0
xia <- alrEM(x, pos=2, dl=rep(5,3))
xia$xImp

[Package robCompositions version 1.2 Index]