Learn R Programming

robCompositions (version 2.0.0)

imputeBDLs: EM-based replacement of rounded zeros in compositional data

Description

Parametric replacement of rounded zeros for compositional data using classical and robust methods based on ilr-transformations with special choice of balances.

Usage

imputeBDLs(x, maxit = 10, eps = 0.1, method = "pls", dl = rep(0.05, ncol(x)), variation = TRUE, nPred = NULL, nComp = "boot", bruteforce = FALSE, noisemethod = "residuals", noise = FALSE, R = 10, correction = "normal", verbose = FALSE)
adjustImputed(xImp, xOrig, wind)
checkData(x, dl)
"print"(x, ...)

Arguments

x
data.frame or matrix
maxit
maximum number of iterations
eps
convergency criteria
method
either “lm”, “lmrob” or “pls”
dl
Detection limit for each variable. zero for variables with variables that have no detection limit problems.
variation,
if TRUE those predictors are chosen in each step, who's variation is lowest to the predictor.
nPred,
if determined and variation equals TRUE, it fixes the number of predictors
nComp
if determined, it fixes the number of pls components. If “boot”, the number of pls components are estimated using a bootstraped cross validation approach.
bruteforce
sets imputed values above the detection limit to the detection limit. Replacement above the detection limit are only exeptionally occur due to numerical instabilities. The default is FALSE!
noisemethod
adding noise to imputed values. Experimental
noise
TRUE to activate noise (experimental)
R
number of bootstrap samples for the determination of pls components. Only important for method “pls”.
correction
normal or density
verbose
additional print output during calculations.
xImp
imputed data set
xOrig
original data set
wind
index matrix of rounded zeros
...
further arguments passed through the print function

Value

x
imputed data
criteria
change between last and second last iteration
iter
number of iterations
maxit
maximum number of iterations
wind
index of zeros
nComp
number of components for method pls
method
chosen method

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 iteratively imputes parts with rounded zeros whereas in each step (1) an specific ilr transformation is applied (2) tobit regression is applied (3) the rounded zeros are replaced by the expected values (4) the corresponding inverse ilr transformation is applied. After all parts are imputed, the algorithm starts again until the imputations do not change.

See Also

imputeBDLs

Examples

Run this code

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