impRZalr | R Documentation |
A modified EM alr-algorithm for replacing rounded zeros in compositional data sets.
impRZalr(
x,
pos = ncol(x),
dl = rep(0.05, ncol(x) - 1),
eps = 1e-04,
maxit = 50,
bruteforce = FALSE,
method = "lm",
step = FALSE,
nComp = "boot",
R = 10,
verbose = FALSE
)
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 |
bruteforce |
if TRUE, imputations over dl are set to dl. If FALSE, truncated (Tobit) regression is applied. |
method |
either “lm” (default) or “MM” |
step |
if TRUE, a stepwise (AIC) procedure is applied when fitting models |
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. |
R |
number of bootstrap samples for the determination of pls components. Only important for method “pls”. |
verbose |
additional print output during calculations. |
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.
xOrig |
Original data frame or matrix |
xImp |
Imputed data |
wind |
Index of the missing values in the data |
iter
|
Number of iterations |
eps |
eps |
Matthias Templ and Karel Hron
Palarea-Albaladejo, J., Martin-Fernandez, J.A. Gomez-Garcia, J. (2007) A parametric approach for dealing with compositional rounded zeros. Mathematical Geology, 39(7), 625-645.
impRZilr
data(arcticLake)
x <- arcticLake
## generate rounded zeros artificially:
x[x[,1] < 5, 1] <- 0
x[x[,2] < 47, 2] <- 0
xia <- impRZalr(x, pos=3, dl=c(5,47), eps=0.05)
xia$xImp
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.