compareMahal: Compares Mahalanobis distances from two approaches

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

View source: R/compareMahal.R

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.

Usage

1
2
3
4
compareMahal(x, imp = "KNNa")

## S3 method for class 'mahal'
plot(x, y, ...)

Arguments

x

data frame or matrix

imp

imputation method

y

unused second argument for the plot method

...

additional arguments for plotting passed through

Value

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

df2

a groupwise statistics.

Author(s)

Matthias Templ, Karel Hron

References

Templ, M., Hron, K., Filzmoser, P. (2017) Exploratory tools for outlier detection in compositional data with structural zeros". Journal of Applied Statistics, 44 (4), 734–752

See Also

impKNNa, pivotCoord

Examples

1
2
3
4
5
6
data(arcticLake)
# generate some zeros
arcticLake[1:10, 1] <- 0
arcticLake[11:20, 2] <- 0
m <- compareMahal(arcticLake)
plot(m)

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