This is a wrapper for the pls::PCR function for computing PCA.
Usage
pca(X, scale = FALSE, ncomp = 1, ...)
Arguments
X
matrix of input data.
scale
logical indicating if variables should be standardised (default=FALSE).
ncomp
integer number of principal components to return.
...
additional arguments to pls:pcr.
Value
multiblock object with scores, loadings, mean X values and explained variances. Relevant plotting functions: multiblock_plots
and result functions: multiblock_results.
Details
PCA is a method for decomposing a matrix into subspace components with sample scores and
variable loadings. It can be formulated in various ways, but the standard formulation uses singular
value decomposition to create scores and loadings. PCA is guaranteed to be the optimal way of extracting
orthogonal subspaces from a matrix with regard to the amount of explained variance per component.
References
Pearson, K. (1901) On lines and planes of closest fit to points in space. Philosophical Magazine, 2, 559<U+2013>572.