Learn R Programming

StatDA (version 1.5)

plotmvoutlier: Multivariate outlier plot

Description

This function plots multivariate outliers. One possibility is to distinguish between outlier and no outlier. The alternative is to distinguish between the different percentils (e.g.

Usage

plotmvoutlier(coord, data, quan = 1/2, alpha = 0.025, symb = FALSE, bw = FALSE,
plotmap = TRUE, map = "kola.background", which.map = c(1, 2, 3, 4),
map.col = c(5, 1, 3, 4), map.lwd = c(2, 1, 2, 1), pch2 = c(3, 21),
cex2 = c(0.7, 0.2), col2 = c(1, 1), lcex.fac = 1, ...)

Arguments

coord
the coordinates for the points
data
the value for the different coordinates
quan
Number of subsets used for the robust estimation of the covariance matrix. Allowed are values between 0.5 and 1., see covMcd
alpha
Maximum thresholding proportion
symb
if FALSE, only two different symbols (outlier and no outlier) will be used
bw
if TRUE, symbols are in gray-scale (only if symb=TRUE)
plotmap
if TRUE, the map is plotted
map
the name of the background map
which.map, map.col, map.lwd
parameters for the background plot, see plotbg
pch2, cex2, col2
graphical parameters for the points
lcex.fac
factor for multiplication of symbol size (only if symb=TRUE)
...
further parameters for the plot

Value

  • oreturns the outliers
  • mdthe square root of the Mahalanobis distance
  • euclideanthe Euclidean distance of the scaled data

Details

The function computes a robust estimation of the covariance and then the Mahalanobis distances are calculated. With this distances the data set is divided into outliers and non outliers. If symb=FALSE only two different symbols are used otherwise different grey scales are used to distinguish the different types of outliers.

References

C. Reimann, P. Filzmoser, R.G. Garrett, and R. Dutter: Statistical Data Analysis Explained. Applied Environmental Statistics with R. John Wiley and Sons, Chichester, 2008.

See Also

plotbg, covMcd, arw

Examples

Run this code
data(moss)
X=moss[,"XCOO"]
Y=moss[,"YCOO"]
el=c("Ag","As","Bi","Cd","Co","Cu","Ni")
x=log10(moss[,el])

data(kola.background)
plotmvoutlier(cbind(X,Y),x,symb=FALSE,map.col=c("grey","grey","grey","grey"),
       map.lwd=c(1,1,1,1),
       xlab="",ylab="",frame.plot=FALSE,xaxt="n",yaxt="n")

Run the code above in your browser using DataLab