data(machines)
## Compute the medcouple of each variable of the Computer hardware data
data.frame(MC=round(apply(machines, 2, mc),2))
## Plot a pairwise scaterplot matrix
pairs(machines[,1:6])
mcd <- CovMcd(machines[,1:6])
plot(mcd, which="pairs")
## Remove the rownames (too long)
rownames(machines) <- NULL
## Start with robust PCA based on MCD (P << n)
(pca1 <- PcaHubert(machines, k=3))
plot(pca1, main="ROBPCA-MCD", off=0.03)
## PCA with the projection algoritm of Hubert
(pca2 <- PcaHubert(machines, k=3, mcd=FALSE))
plot(pca2, main="ROBPCA-SD", off=0.03)
## PCA with the adjusted for skewness algorithm of Hubert et al (2009)
(pca3 <- PcaHubert(machines, k=3, mcd=FALSE, skew=TRUE))
plot(pca3, main="ROBPCA-AO", off=0.03)
Run the code above in your browser using DataLab