impCoda {robCompositions}R Documentation

Imputation of missing values in compositional data

Description

This function offers different methods for the imputation of missing values in compositional data. Missing values are initialized with proper values. Then iterative algorithms try to find better estimations for the former missing values.

Usage

impCoda(x, maxit = 10, eps = 0.5, method = "ltsReg", closed = FALSE, init = "KNN", k = 5, dl = rep(0.05, ncol(x)))

Arguments

x data frame or matrix
maxit maximum number of iterations
eps convergence criteria
method imputation method
closed imputation of transformed data (using ilr transformation) or in the original space (closed $==$ TRUE)
init method for initializing missing values
k number of nearest neighbors (if init $==$ “KNN”)
dl detection limit(s), only important for the imputation of rounded zeros

Details

eps: The algorithm is finished as soon as the imputed values stabilize, i.e. until the sum of Aitchison distances from the present and previous iteration changes only marginally (eps).\

method: Several different methods can be chosen, such as ‘ltsReg’ (least trimmed squares regression is used within the iterative procedure), ‘lm’ (least squares regression is used within the iterative procedure), ‘classical’ (principal component analysis is used within the iterative procedure), ‘ltsReg2’ (least trimmed squares regression is used within the iterative procedure. The imputated values are perturbed in the direction of the predictor by values drawn form a normal distribution with mean and standard deviation related to the corresponding residuals).

method ‘roundedZero’ is experimental. It imputes rounded zeros within our iterative framework.

Value

xOrig Original data frame or matrix
xImp Imputed data
criteria Sum of the Aitchison distances from the present and previous iteration
iter Number of iterations
maxit Maximum number of iterations
w Amount of imputed values
wind Index of the missing values in the data

Author(s)

Matthias Templ, Karel Hron

References

Hron, K. and Templ, M. and Filzmoser, P. (2008) Imputation of missing values for compositional data using classical and robust methods Research Report SM-2008-4, Vienna University of Technology, 15 pages.

See Also

impKNNa, ilr

Examples

data(aitchison395)
x <- aitchison395
x[1,3]
x[1,3] <- NA
xi <- impCoda(x)$xImp
xi[1,3]
s1 <- sum(x[1,-3])
impS <- sum(xi[1,-3])
xi[,3] * s1/impS

[Package robCompositions version 1.2 Index]