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
compareMahal.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compareMahal.R
\name{compareMahal}
\alias{compareMahal}
\alias{getEstimates}
\alias{print.estimates}
\alias{plot.estimates}
\alias{plot.mahal}
\title{Compares Mahalanobis distances from two approaches}
\usage{
compareMahal(x, imp = "KNNa")

\method{plot}{mahal}(x, y, ...)
}
\arguments{
\item{x}{data frame or matrix}

\item{imp}{imputation method}

\item{y}{unused second argument for the plot method}

\item{...}{additional arguments for plotting passed through}
}
\value{
\item{df}{a data.frame containing the Mahalanobis distances from the estimation in subgroups, the Mahalanobis distances from the imputation and covariance approach, an indicator specifiying outliers and an indicator specifying the zero pattern} \item{df2}{a groupwise statistics.}
}
\description{
Mahalanobis distances are calculated for each zero pattern.
Two approaches are used. The first one estimates Mahalanobis distance for observations belonging to one each zero pattern each.
The second method uses a more sophisticated approach described below.
}
\examples{

data(arcticLake)
# generate some zeros
arcticLake[1:10, 1] <- 0
arcticLake[11:20, 2] <- 0
m <- compareMahal(arcticLake)
plot(m)
}
\references{
Templ, M., Hron, K., Filzmoser, P. (2017) 
Exploratory tools for outlier detection in compositional data with structural zeros".
\emph{Journal of Applied Statistics}, \strong{44} (4), 734--752
}
\seealso{
\code{\link{impKNNa}}, \code{\link{pivotCoord}}
}
\author{
Matthias Templ, Karel Hron
}
back to top