## S3 method for class 'aplus':
princomp(x,\dots,scores=TRUE,center=attr(covmat,"center"),
covmat=var(x,robust=robust,giveCenter=TRUE),robust=getOption("robust"))
## S3 method for class 'princomp.aplus':
print(x,\dots)
## S3 method for class 'princomp.aplus':
plot(x,y=NULL,\dots, npcs=min(10,length(x$sdev)),
type=c("screeplot","variance","biplot","loadings","relative"),
main=NULL,scale.sdev=1)
## S3 method for class 'princomp.aplus':
predict(object,newdata,\dots)
"screeplot"
is a lined screeplot,
"variance"
is a boxplot-like screeplot, "biplot"
is a
biplot, "loadings"
displays the loadings as a
var.rmult
for details.princomp
gives an object of type
c("princomp.acomp","princomp")
with the following content:"loadings"
.aplus
vector of means used to center the datasetscores = TRUE
, the scores of the supplied data
on the principal components. Scores are coordinates in a basis given by the principal
components and thus not compositionspredict
returns a matrix of scores of the observations in the
newdata
dataset
.
The other routines are mainly called for their side effect of plotting or
printing and return the object x
.aplus
has its own
principal component analysis, that can be performed either in terms of the
covariance matrix or the correlation matrix. However, since all parts in a composition
or in an amount vector share a natural scaling, they do not need the
standardization (which in fact would produce a loss of important information).
For this reason, princomp.aplus
works on the covariance matrix.
To aid the interpretation we added some extra functionality to a
normal princomp(ilt(x))
. First of all the result contains as
additional information the amount representation of
returned vectors in the space of the data: the center as an amount
Center
, and the loadings in terms of amounts to perturbe
with, either positively
(Loadings
) or negatively (DownLoadings
). The Up- and
DownLoadings are normalized to the number of parts
and not to one to simplify the interpretation. A value of about one
means no change in the specific component.
The plot routine provides screeplots (type = "s"
,type=
"v"
), biplots (type = "b"
), plots of the effect of
loadings (type = "b"
) in scale.sdev*sdev
-spread, and
loadings of pairwise (log-)ratios (type = "r"
).
The interpretation of a screeplot does not differ from ordinary
screeplots. It shows the eigenvalues of the covariance matrix, which
represent the portions of variance explained by the principal
components.
The interpretation of the the biplot uses, additionally to the
classical one, a compositional concept: The
differences between two arrowheads can be interpreted as log-ratios
between the two components represented by the arrows.
The amount loading plot is introduced with this
package. The loadings of all component can be seen as an orthogonal basis
in the space of ilt
-transformed data. These vectors are displayed by a barplot with
their corresponding amounts. A portion of one means no change of this
part. This is equivalent to a zero loading in a real principal component analysis.
The loadings plot can work in two different modes. If
scale.sdev
is set to NA
it displays the amount vector
being represented by the unit vector of loadings in the ilt-transformed space. If
scale.sdev
is numeric we use this amount vector scaled by the
standard deviation of the respective component.
The relative plot displays the relativeLoadings
as a
barplot. The deviation from a unit bar shows the effect of each principal component
on the respective ratio. The
interpretation of the ratios plot may only be done in an Aitchison-compositional framework
(see princomp.acomp
).ilt
,aplus
, relativeLoadings
princomp.acomp
, princomp.rplus
,
barplot.aplus
, mean.aplus
,data(SimulatedAmounts)
pc <- princomp(aplus(sa.lognormals5))
pc
summary(pc)
plot(pc) #plot(pc,type="screeplot")
plot(pc,type="v")
plot(pc,type="biplot")
plot(pc,choice=c(1,3),type="biplot")
plot(pc,type="loadings")
plot(pc,type="loadings",scale.sdev=-1) # Downward
plot(pc,type="relative",scale.sdev=NA) # The directions
plot(pc,type="relative",scale.sdev=1) # one sigma Upward
plot(pc,type="relative",scale.sdev=-1) # one sigma Downward
biplot(pc)
screeplot(pc)
loadings(pc)
relativeLoadings(pc,mult=FALSE)
relativeLoadings(pc)
relativeLoadings(pc,scale.sdev=1)
relativeLoadings(pc,scale.sdev=2)
pc$Loadings
pc$DownLoadings
barplot(pc$Loadings)
pc$sdev^2
cov(predict(pc,sa.lognormals5))
Run the code above in your browser using DataLab