.BG
.VE $Header: /usr3/s/current/s/.help/RCS/prcomp,v 1.2 83/12/30 19:32:30 rab Exp $
.FN prcomp
.TL
prcomp: Principal Component Analysis
.CS
prcomp(x, retx)
.PP
.AG x
data matrix to be decomposed. Principal component analysis
defines a rotation of the variables (columns) of `x'. The
first derived direction is chosen to maximize the standard
deviation of the derived variable, the second to maximize
the standard deviation among directions uncorrelated with
the first, etc.
.AG retx
logical, if TRUE (the default) the rotated version of the
data matrix is returned.  Setting to FALSE just saves space
in the returned data structure.
.RT
structure describing the principal component analysis:
.RC sdev
standard deviations of the derived variables.
.RC rotation
orthogonal matrix describing the rotation. The first
column is the linear combination of columns of `x' defining
the first principal component, etc.  May have fewer columns
than `x'.
.RC x
if `retx' was TRUE, the rotated version of `x'; i.e., the
first column is the `nrow(x)' values for the first derived
variable, etc.  May have fewer columns than `x'.
.PP
The analysis will work even if `nrow(x)<ncol(x)', but in
this case only `nrow(x)' variables will be derived, and the
returned `x' will have only `nrow(x)' columns. In general,
if any of the derived variables has zero standard deviation,
that variable is dropped from the returned result.
.KW array*
.KW multivariate
.KW algebra
.WR
