Parametric replacement of rounded zeros for compositional data using classical and robust methods based on ilr coordinates with a special choice of balances.
impRZilr(
x,
maxit = 10,
eps = 0.1,
method = "pls",
dl = rep(0.05, ncol(x)),
variation = FALSE,
nComp = "boot",
bruteforce = FALSE,
noisemethod = "residuals",
noise = FALSE,
R = 10,
correction = "normal",
verbose = FALSE
)
imputed data
change between last and second last iteration
number of iterations
maximum number of iterations
index of zeros
number of components for method pls
chosen method
data.frame or matrix
maximum number of iterations
convergency criteria
either “lm”, “MM” or “pls”
Detection limit for each variable. zero for variables with variables that have no detection limit problems.
matrix is used to first select number of parts
if determined, it fixes the number of pls components. If “boot”, the number of pls components are estimated using a bootstraped cross validation approach.
sets imputed values above the detection limit to the detection limit. Replacement above the detection limit only exceptionally occur due to numerical instabilities. The default is FALSE!
adding noise to imputed values. Experimental
TRUE to activate noise (experimental)
number of bootstrap samples for the determination of pls components. Only important for method “pls”.
normal or density
additional print output during calculations.
Matthias Templ and Peter Filzmoser
Statistical analysis of compositional data including zeros runs into problems, because log-ratios cannot be applied. Usually, rounded zeros are considered as missing not at random missing values.
The algorithm iteratively imputes parts with rounded zeros whereas in each step (1) compositional data are expressed in pivot coordinates (2) tobit regression is applied (3) the rounded zeros are replaced by the expected values (4) the corresponding inverse ilr mapping is applied. After all parts are imputed, the algorithm starts again until the imputations do not change.
Martin-Fernandez, J.A., Hron, K., Templ, M., Filzmoser, P., Palarea-Albaladejo, J. (2012) Model-based replacement of rounded zeros in compositional data: Classical and robust approaches. Computational Statistics and Data Analysis, 56 (9), 2688-2704.
Templ, M., Hron, K., Filzmoser, P., Gardlo, A. (2016) Imputation of rounded zeros for high-dimensional compositional data. Chemometrics and Intelligent Laboratory Systems, 155, 183-190.
impRZalr
data(arcticLake)
x <- arcticLake
## generate rounded zeros artificially:
#x[x[,1] < 5, 1] <- 0
x[x[,2] < 44, 2] <- 0
xia <- impRZilr(x, dl=c(5,44,0), eps=0.01, method="lm")
xia$x
Run the code above in your browser using DataLab