Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

impRZalr

alr EM-based imputation of rounded zeros


Description

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

Usage

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

Examples

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

Compositional Data Analysis

v2.3.0
GPL (>= 2)
Authors
Matthias Templ [aut, cre] (<https://orcid.org/0000-0002-8638-5276>), Karel Hron [aut] (<https://orcid.org/0000-0002-1847-6598>), Peter Filzmoser [aut] (<https://orcid.org/0000-0002-8014-4682>), Kamila Facevicova [ctb], Petra Kynclova [ctb], Jan Walach [ctb], Veronika Pintar [ctb], Jiajia Chen [ctb], Dominika Miksova [ctb], Bernhard Meindl [ctb], Alessandra Menafoglio [ctb] (<https://orcid.org/0000-0003-0682-6412>), Alessia Di Blasi [ctb], Federico Pavone [ctb], Gianluca Zeni [ctb]
Initial release
2020-11-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.