Learn R Programming

compositions (version 1.01-1)

princomp.rmult: Principal component analysis for real data

Description

Performs a principal component analysis for datasets of type rmult.

Usage

## S3 method for class 'rmult':
princomp(x,cor=FALSE,scores=TRUE,
                           covmat=var(rmult(x[subset,]),robust=robust,giveCenter=TRUE),center=attr(covmat,"center"),  subset = rep(TRUE, nrow(x)),...,robust=getOption("robust"))

Arguments

x
a rmult-dataset
...
Further arguments to call princomp.default
cor
logical: shall the computation be based on correlations rather than covariances?
scores
logical: shall scores be computed?
covmat
provides the covariance matrix to be used for the principle component analysis
center
provides the be used for the computation of scores
subset
A rowindex to x giving the columns that should be used to estimate the variance.
robust
Gives the robustness type for the calculation of the covariance matrix. See var.rmult for details.

Value

  • An object of type princomp with the following fields
  • sdevthe standard deviation of the principal components.
  • loadingsthe matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors). This is of class "loadings".
  • centerthe mean that was substracted from the data set
  • scalethe scaling applied to each variable
  • n.obsnumber of observations
  • scoresif scores = TRUE, the scores of the supplied data on the principal components. Scores are coordinates in a basis given by the principal components.
  • callthe matched call
  • na.actionNot clearly understood

Details

The function just does princomp(unclass(x),...,scale=scale) and is only here for convenience.

See Also

princomp.rplus

Examples

Run this code
data(SimulatedAmounts)
pc <- princomp(rmult(sa.lognormals5))
pc
summary(pc)
plot(pc) 
screeplot(pc)
screeplot(pc,type="l")
biplot(pc)
biplot(pc,choice=c(1,3))
loadings(pc)
plot(loadings(pc))
pc$sdev^2
cov(predict(pc,sa.lognormals5))

Run the code above in your browser using DataLab