impRZalr: alr EM-based imputation of rounded zeros

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/impRZalr.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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
)

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

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.

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.

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-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.

See Also

impRZilr

Examples

1
2
3
4
5
6
7
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

robCompositions documentation built on Jan. 13, 2021, 10:07 p.m.