Learn R Programming

StatDA (version 1.5)

rg.robmva: Robust Multivariate Analysis

Description

Procedure for multivariate analysis using the minimum volume ellipsoid (MVE), minimum covariance determinant (MCD) or a supplied set of 0-1 weights.

Usage

rg.robmva(x, proc = "mcd", wts = NULL, main = deparse(substitute(x)))

Arguments

x
data
proc
procedure for the estimation (MVE or MCD)
wts
if proc=NULL, the supplied weights for the calculation
main
input for the list

Value

  • nnumber of rows
  • pnumber of columns
  • wtsthe weights for the covariance matrix
  • meanthe mean of the data
  • covthe covariance
  • sdthe standard deviation
  • rcorrelation matrix
  • eigenvalueseigenvalues of the SVD
  • econtribproportion of eigenvalues in %
  • eigenvectorseigenvectors of the SVD
  • rloadloadings matrix
  • rcrstandardised loadings matrix
  • vcontribscores variance
  • pvcontribproportion of scores variance in %
  • cpvcontribcummulative proportion of scores variance
  • mdMahalanbois distance
  • ppmprobability for outliegness using F-distribution
  • epmprobability for outliegness using Chisquared-distribution

Details

cov.mcd is limited to a maximum of 50 variables. Both of these procedures lead to a vector of 0-1 weights and mcd is the default. A set of weights can be generated by using Graphical Adaptive Interactive Trimming (GAIT) procedure available though rg.md.gait(). Using 0-1 weights the parameters of the background distribution are estimated by cov.wt(). A robust estimation of the Mahalanobis distances is made for the total data set but is only undertaken if x is non-singular (lowest eigenvalue is >10e-4).

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.

Examples

Run this code
#input data
data(ohorizon)
vegzn=ohorizon[,"VEG_ZONE"]
veg=rep(NA,nrow(ohorizon))
veg[vegzn=="BOREAL_FOREST"] <- 1
veg[vegzn=="FOREST_TUNDRA"] <- 2
veg[vegzn=="SHRUB_TUNDRA"] <- 3
veg[vegzn=="DWARF_SHRUB_TUNDRA"] <- 3
veg[vegzn=="TUNDRA"] <- 3
el=c("Ag","Al","As","B","Ba","Bi","Ca","Cd","Co","Cu","Fe","K","Mg","Mn",
  "Na","Ni","P","Pb","Rb","S","Sb","Sr","Th","Tl","V","Y","Zn")
x <- log10(ohorizon[!is.na(veg),el])
v <- veg[!is.na(veg)]
subvar=c("Ag","B","Bi","Mg","Mn","Na","Pb","Rb","S","Sb","Tl")
set.seed(100)

rg.robmva(as.matrix(x[v==1,subvar]))

Run the code above in your browser using DataLab