These functions are used by the Principal Components Analysis dialog.
menuPrincomp
calls
tabSummary.princomp,
tabPlot.princomp and
tabPredict.princomp
if summary, plotting and prediction results are requested.
at least one of
x,
data, or
covlist must be given.
fit
an object of class
princomp.
object
an object of class
princomp.
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 in which to interpret the formula, or a 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 and
cov.mve. Components must
include
center and
cov.
scores
if
TRUE, a matrix of scores for all components will be computed and
returned as a component of the result.
cor
a character string defining the scaling used to compute the principal
components. Possible values are
"covariance" and
"correlation". If
"covariance" is specified,
cor is set to
FALSE in the call to
princomp. If
"correlation" is specified,
cor is set to
TRUE in
the call to
princomp.
na.action
if
TRUE, then any observation with missing values are removed from the
analysis. If
FALSE and there are missing values then the function will
exit with a message that missing values are not allowed. If
na.action
is
TRUE then
na.action is set to
na.omit in the call to
princomp. If
na.action is
FALSE then
na.action is set to
na.fail in the call
to
princomp.
subset
an expression saying which subset of the rows of the data
should be used in the fit. This can be a logical vector (which is
replicated to have length equal to the number of observations), or
a numeric vector indicating which observation numbers are to be included,
or a character vector of the row names to be included.
print.short
if
TRUE, a short summary of the principal components analysis is printed.
This output is from the function
print.princomp.
print.importance
if
TRUE, the importance of components is printed. This output is from the
function
summary.princomp.
print.loadings
if
TRUE, the loadings matrix is printed. Elements of the matrix whose
absolute value is smaller than
cutoff.loadings will appear a blanks.
cutoff.loadings
a number giving the cutoff for printing the loadings.
plot.screeplot
if
TRUE, a screeplot for the computed components will be produced.
plot.loadings
if
TRUE, a bar plot of the loadings for each component will be produced.
plot.biplot
if
TRUE, a biplot for the components specified in
plot.biplot.choices
will be produced.
plot.biplot.choices
a vector of length 2, stating which components to plot.
predict.p
if
TRUE, predictions will be saved to the data frame specified in
save.name.
newdata
a matrix or data frame to use for computing predictions. It must contain
the same names as those used in the original analysis. If missing, the
predictions for the original data are computed.
save.name
a character string for the name of the data frame to save the predictions
in. If a data frame with this name already exists in database 1 and it
has the appropriate number of rows then the saved values will be appended
to the data frame. If the object already exist in database 1 and it is
not a data frame or it does not have the appropriate number of rows then
a new name is created by appending a number to
save.name and the results
are saved in the data frame with the new name.
VALUE:
an object of class
princomp. See the
princomp.object help file for details.
SIDE EFFECTS:
Plots will be drawn if requested. The object
save.name will be created
or appended to if predictions are saved.