https://github.com/cran/robCompositions
Raw File
Tip revision: d761b2fedaa3133904cf8bbd87ad4e6fcfdf79ac authored by Matthias Templ on 15 April 2019, 16:22:43 UTC
version 2.1.0
Tip revision: d761b2f
impRZalr.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/impRZalr.R
\name{impRZalr}
\alias{impRZalr}
\title{alr EM-based imputation of rounded zeros}
\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{
\item{x}{compositional data}

\item{pos}{position of the rationing variable for alr transformation}

\item{dl}{detection limit for each part}

\item{eps}{convergence criteria}

\item{maxit}{maximum number of iterations}

\item{bruteforce}{if TRUE, imputations over dl are set to dl. If FALSE,
truncated (Tobit) regression is applied.}

\item{method}{either \dQuote{lm} (default) or \dQuote{MM}}

\item{step}{if TRUE, a stepwise (AIC) procedure is applied when fitting
models}

\item{nComp}{if determined, it fixes the number of pls components. If
\dQuote{boot}, the number of pls components are estimated using a
bootstraped cross validation approach.}

\item{R}{number of bootstrap samples for the determination of pls
components. Only important for method \dQuote{pls}.}

\item{verbose}{additional print output during calculations.}
}
\value{
\item{xOrig }{Original data frame or matrix} \item{xImp }{Imputed
data} \item{wind }{Index of the missing values in the data} \item{iter
}{Number of iterations} \item{eps }{eps}
}
\description{
A modified EM alr-algorithm for replacing rounded zeros in compositional
data sets.
}
\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.
}
\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

}
\references{
Palarea-Albaladejo, J., Martin-Fernandez, J.A. Gomez-Garcia, J. (2007) 
A parametric approach for dealing with compositional rounded zeros. 
\emph{Mathematical Geology}, 39(7), 625-645.
}
\seealso{
\code{\link{impRZilr}}
}
\author{
Matthias Templ and Karel Hron
}
\keyword{manip}
\keyword{multivariate}
back to top