prcomp.robust: Principal Components Analysis using Robust Estimators

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/mdqc.R

Description

A function that performs PCA using the robust estimators "S-estimator","MCD" and "MVE".

Usage

1
2
3
4
5
prcomp.robust(x, robust = c("S-estimator","MCD", "MVE"),
                        nsamp = 10*nrow(x), ...)
## S3 method for class 'robust'
prcomp(x, robust = c("S-estimator","MCD", "MVE"),
                        nsamp = 10*nrow(x), ...)

Arguments

x

a matrix. Contains the data to perform PCA on.

robust

The robust estimator to use. One of "S-estimator", "MCD", or "MVE". The default robust estimator is the S-estimator with 25% breakdown point.

nsamp

The number of subsamples that the robust estimator should use. This defaults to 10 times the number of rows in the matrix.

...

Further arguments that can be passed to the robust estimator

Details

The calculation is done by a singular value decomposition of the robust centered and scaled data matrix, not by using eigen on the covariance matrix. This is generally the preferred method for numerical accuracy. The print method for the these objects prints the results in a nice format and the plot method produces a scree plot. The scree plot can be used to determine the number k of principal components preserved in the analysis, looking for the “elbow” or the first important bend in the line. A biplot can also be generated to represent the values of the first two principal components (PCs) and the contribution of each variable to these components in the same plot (see Supplementary Material of Cohen Freue et al. (2007)).

Value

prcomp.robust returns a list with class "prcomp" containing the following components:

sdev

the standard deviations of the principal components (i.e., the square roots of the eigenvalues of the covariance matrix calculated using the robust argument, though the calculation is actually done with the singular values of the data matrix).

rotation

the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors). The function princomp returns this in the element loadings.

x

the value of the rotated data (the centered and scaled) data multiplied by the rotation matrix) is returned.

Author(s)

Justin Harrington harringt@stat.ubc.ca and Gabriela V. Cohen Freue gcohen@stat.ubc.ca.

References

Cohen Freue, G. V. and Hollander, Z. and Shen, E. and Zamar, R. H. and Balshaw, R. and Scherer, A. and McManus, B. and Keown, P. and McMaster, W. R. and Ng, R. T. (2007) ‘MDQC: A New Quality Assessment Method for Microarrays Based on Quality Control Reports’. Bioinformatics 23, 3162 – 3169.

See Also

mdqc, prcomp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(allQC) ## Loads the dataset allQC

prout <- prcomp.robust(allQC)
screeplot(prout, type="line")
biplot(prout)

prout <- prcomp.robust(allQC, robust="MCD")
screeplot(prout, type="line")
biplot(prout)

prout <- prcomp.robust(allQC, robust="MVE")
screeplot(prout, type="line")
biplot(prout)

Example output

Loading required package: cluster
Loading required package: MASS

mdqc documentation built on Nov. 8, 2020, 11 p.m.