PCdiagplot {pcaPP} | R Documentation |
Computes Orthogonal Distances (OD) and Score Distances (SD) for already computed principal components using the projection pursuit technique.
PCdiagplot(x, PCobj, crit = c(0.975, 0.99, 0.999), ksel = NULL, plot = TRUE, plotbw = TRUE, raw = FALSE, colgrid = "black", ...)
x |
a numeric matrix or data frame which provides the data for the principal components analysis. |
PCobj |
a PCA object resulting from PCAproj or PCAgrid |
crit |
quantile(s) used for the critical value(s) for OD and SD |
ksel |
range for the number of PCs to be used in the plot; if NULL all PCs provided are used |
plot |
if TRUE a plot is generated, otherwise only the values are returned |
plotbw |
if TRUE the plot uses gray, otherwise color representation |
raw |
if FALSE, the distribution of the SD will be transformed to approach chisquare distribution, otherwise the raw values are reported and used for plotting |
colgrid |
the color used for the grid lines in the plot |
... |
additional graphics parameters as used in par |
Based on (robust) principal components, a diagnostics plot is made using Orthogonal Distance (OD) and Score Distance (SD). This plot can provide important information about the multivariate data structure.
ODist |
matrix with OD for each observation (rows) and each selected PC (cols) |
SDist |
matrix with SD for each observation (rows) and each selected PC (cols) |
critOD |
matrix with critical values for OD for each selected PC (rows) and each critical value (cols) |
critSD |
matrix with critical values for SD for each selected PC (rows) and each critical value (cols) |
Peter Filzmoser <P.Filzmoser@tuwien.ac.at>
P. Filzmoser (2007). Exploring high-dimensional data with robust principal components, To appear in a Proceedings Volume of CDAM'07, Minsk, Belarus.
M. Hubert, P.J. Rousseeuwm, K. Vanden Branden (2005). ROBCA: a new approach to robust principal component analysis Technometrics 47, pp. 64-79.
# multivariate data with outliers library(mvtnorm) x <- rbind(rmvnorm(85, rep(0, 6), diag(c(5, rep(1,5)))), rmvnorm( 15, c(0, rep(20, 5)), diag(rep(1, 6)))) # Here we calculate the principal components with PCAgrid pcrob <- PCAgrid(x, k=6) resrob <- PCdiagplot(x,pcrob,plotbw=FALSE) # compare with classical method: pcclass <- PCAgrid(x, k=6, method="sd") resclass <- PCdiagplot(x,pcclass,plotbw=FALSE)