Draws ellipses according to Mahalanobis distances

Description

For 2-dimensional data a scatterplot is made. Additionally, ellipses corresponding to certain Mahalanobis distances and quantiles of the data are drawn.

Usage

1
2
drawMahal(x, center, covariance, quantile = c(0.975, 0.75, 0.5, 0.25), m = 1000, 
lwdcrit = 1, ...)

Arguments

x

numeric data frame or matrix with 2 columns

center

vector of length 2 with multivariate center of x

covariance

2 by 2 covariance matrix of x

quantile

vector of quantiles for the Mahalanobis distance

m

number of points where the ellipses should pass through

lwdcrit

line width of the ellipses

...

additional graphics parameters, see par

Details

For multivariate normally distributed data, a fraction of 1-quantile of data should be outside the ellipses. For center and covariance also robust estimators, e.g. from the MCD estimator, can be supplied.

Value

A scatterplot with the ellipses is generated.

Author(s)

Peter Filzmoser <P.Filzmoser@tuwien.ac.at>

References

K. Varmuza and P. Filzmoser: Introduction to Multivariate Statistical Analysis in Chemometrics. CRC Press, Boca Raton, FL, 2009.

See Also

covMcd

Examples

1
2
3
4
5
6
data(glass)
data(glass.grp)
x=glass[,c(2,7)]
require(robustbase)
x.mcd=covMcd(x)
drawMahal(x,center=x.mcd$center,covariance=x.mcd$cov,quantile=0.975,pch=glass.grp)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.