Returns an object of class
princompRob
containing the standard deviations of the principal components, the
loadings, and, optionally, the scores. The principal components are
calculated from a robust estimate of the covariance matrix.
at least one of
x,
data
, or
covlist
must be given.
OPTIONAL ARGUMENTS:
x
a matrix, data frame or formula. If a matrix, the columns should
correspond to variables and the rows to observations. If a formula, no
variables may appear on the left (response) side.
data
a data frame or matrix. This is usually used only when
x is a formula, though it may be used instead
of
x.
covlist
a list of the form returned by
cov.wt or
cov.mve. Components must include
center and
cov.
A
cor component will not be used, however, an
n.obs will be used it present. WARNING: if
the
covlist does not contain a robust estimate
of the covariance matrix then the principal component analysis will not be
robust.
scores
logical value or integer. If
scores=T then a
matrix of the scores for all of the components is returned. If
scores is numeric, then scores and loadings
for the first scores components are returned. If
scores=F, then no scores are computed.
corr
logical flag: if
TRUE, then the principal
components are based on the correlation matrix rather than the covariance
matrix. That is, the variables are scaled to have unit variance.
na.action
function to handle missing values. The default is to create an error if
missing values are found.
subset
the subset of the observations to use.
estim
the robust estimator used by covRob. The choices are: "mcd" for the Fast
MCD algorithm of Rousseeuw and Van Driessen, "donostah" for the
Donoho-Stahel projection based estimator, "M" for the constrained M
estimator provided by Rocke, "pairwiseQC" for the quadrant correlation
based pairwise estimator, and "pairwiseGK" for the Gnanadesikan-Kettenring
pairwise estimator. The default "auto" selects from "donostah", "mcd", and
"pairwiseQC" with the goal of producing a good estimate in a resonable
amount of time.
control
a list of control parameters to be used in the numerical algorithms. See
for the
possible control parameters and their default settings.
...
optionally, control parameters for the robust covariance estimation
algorithms may be included in the call to
princompRob.
VALUE:
an object of class
princompRob with components:
sdev
vector of standard deviations of the principal components.
loadings
orthogonal matrix of class
loadings giving
the loadings. The first column is the linear combination of columns of
x
defining the first principal component,
etc. If argument
scores was numeric, then this
contains that number of columns.
n.obs
the number of observations on which the estimates are based. This may not
be present if covlist was used.
scores
the scores of some or all of the principal components for the observations.
center
vector of centers for the variables.
scale
vector of numbers by which the variables are scaled. These are all 1 if
corr
is
FALSE. If
corr
is
TRUE,
then scales will be the square roots of the diagonal of the
cov
component of
covlist
, if present, and otherwise it is the
standard deviations of the input data variables.
terms
the terms object of the formula. This is not present if a formula was not
used.
call
an image of the call to
princompRob.
DETAILS:
The argument
covlist is provided only so that
princompRob
is consistent with
. If
covlist
is given, the covariance estimate must
be robust for the principal components to be robust.