rospca (version 1.0.4)

diagPlot: Diagnostic plot for PCA

Description

Make diagnostic plot using the output from robpca or rospca.

Usage

diagPlot(res, title = "Robust PCA", col = "black", pch = 16, labelOut = TRUE, id = 3)

Arguments

res

A list containing the orthogonal distances (od), the score distances (sd) and their respective cut-offs (cutoff.od and cutoff.sd). Output from robpca or rospca can for example be used.

title

Title of the plot, default is "Robust PCA".

col

Colour of the points in the plot, this can be a single colour for all points or a vector specifying the colour for each point. The default is "black".

pch

Plotting characters or symbol used in the plot, see points for more details. The default is 16 which corresponds to filled circles.

labelOut

Logical indicating if outliers should be labelled on the plot, default is TRUE.

id

Number of OD outliers and number of SD outliers to label on the plot, default is 3.

Author

Tom Reynkens, based on R code from Valentin Todorov for the diagnostic plot in rrcov (released under GPL-3).

Details

The diagnostic plot contains the score distances on the x-axis and the orthogonal distances on the y-axis. To detect outliers, cut-offs for both distances are added, see Hubert et al. (2005).

References

Hubert, M., Rousseeuw, P. J., and Vanden Branden, K. (2005), ``ROBPCA: A New Approach to Robust Principal Component Analysis,'' Technometrics, 47, 64--79.

Examples

Run this code
X <- dataGen(m=1, n=100, p=10, eps=0.2, bLength=4)$data[[1]]

resR <- robpca(X, k=2, skew=FALSE)
diagPlot(resR)

Run the code above in your browser using DataLab