sla.princomp {RScaLAPACK}R Documentation

Principal Components Analysis (Using ScaLAPACK)

Description

The function sla.prcomp performs a principal components analysis on the give data matrix (using sla.eigen) and returns the results as a object of class princomp.

Usage

sla.princomp(x, ...)
## S3 method for class 'formula'
sla.princomp(formula, data = NULL, subset, na.action, NPROWS=0, NPCOLS=0, MB=16, ...)
## Default S3 method:
sla.princomp(x, cor = FALSE, scores = TRUE, covmat = NULL, subset = rep(TRUE, nrow(as.matrix(x))), NPROWS=0, NPCOLS=0, MB=16, ...)

Arguments

formula

a formula with no response variable.

data

an optional data frame containing the variables in the formula formula. By default the variables are taken from environment(formula).

x

a matrix or data frame which provides the data for the principal components analysis.

subset

an optional vector used to select rows (observations) of the data matrix x.

na.action

a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. The “factory-fresh” default is na.omit.

cor

a logical value indicating whether the calculation should use the correlation matrix or the covariance matrix.

scores

a logical value indicating whether the score on each principal component should be calculated.

covmat

a covariance matrix, or a covariance list as returned by cov.wt, cov.mve or cov.mcd. If supplied, this is used rather than the covariance matrix of x.

...

arguments passed to or from other methods. If x is a formula one might specify cor or scores.

NPROWS

Number of Process Rows in the Process Grid.

NPCOLS

Number of Process Cols in the Process Grid.

MB

Block Size.

Details

If the number of processor rows and columns are both zero, one processor is used. If the number of processor rows is nonzero and the number of processor columns is zero, then the processor rows is taken to be a number of processors, and a grid is made accordingly.

Value

sla.princomp returns a list with class "princomp" containing the following components:

sdev

the standard deviations of the principal components.

loadings

the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors). This is of class "loadings": see loadings for its print method.

center

the means that were subtracted.

scale

the scalings applied to each variable.

n.obs

the number of observations.

scores

if scores = TRUE, the scores of the supplied data on the principal components.

call

the matched call.

na.action

If relevant.

Author(s)

Nagiza Samatova (samatovan@ornl.gov), Guruprasad Kora (koragh@ornl.gov), Srikanth Yoginath (yoginathsb@ornl.gov), David Bauer (bauerda@ornl.gov)

References

summary.princomp, screeplot, biplot.princomp, prcomp, cor, cov, eigen.

http://www.google.com/search?q=principal+components+analysis

http://www.netlib.org/scalapack/

See Also

prcomp for the normal PCA function.

Examples

data(USArrests)
sla.princomp(USArrests, cor=TRUE, NPROWS=2, NPCOLS=2, MB=2)

[Package RScaLAPACK version 0.6.1 Index]