princomp.acomp         package:compositions         R Documentation

_P_r_i_n_c_i_p_a_l _c_o_m_p_o_n_e_n_t _a_n_a_l_y_s_i_s _f_o_r _A_i_t_c_h_i_s_o_n _c_o_m_p_o_s_i_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     A principal component analysis is done in the Aitchison geometry
     (i.e. clr-transform) of the simplex. Some gimics simplify the
     interpretation of the computed components as compositional
     perturbations.

_U_s_a_g_e:

     ## S3 method for class 'acomp':
     princomp(x,...,scores=TRUE)
     ## S3 method for class 'princomp.acomp':
     print(x,...)
     ## S3 method for class 'princomp.acomp':
     plot(x,y=NULL,...,
     npcs=min(10,length(x$sdev)-1),
     type=c("screeplot","variance","biplot","loadings","relative"),
     main=NULL,
     scale.sdev=1)
     ## S3 method for class 'princomp.acomp':
     predict(object,newdata,...)

_A_r_g_u_m_e_n_t_s:

       x: a acomp-dataset (in princomp) or a result from princomp.acomp

       y: not used

  scores: a logical indicating whether scores should be computed or not

    npcs: the number of components to be drawn in the scree plot

    type: type of the plot: '"screeplot"' is a lined screeplot,
          '"variance"' is a boxplot like screeplot, '"biplot"' is a
          biplot, '"loadings"' displayes the Loadings as a 
          'barplot.acomp'

scale.sdev: the multiple of sigma to use plotting the loadings

    main: headline of the plot

  object: a fitted princomp.acomp object

 newdata: another compositional dataset of class acomp

     ...: further arguments to pass to internally-called functions

_D_e_t_a_i_l_s:

     As a metric euclidean space the Aitchison simplex has its own
     principal component analysis, that should be performed in terms of
     the covariance matrix and not in terms of the meaningless
     correlation matrix.  
      To aid the interpretation we added some extra functionality to a
     normal 'princomp(clr(x))'. First of all the result contains as
     additional information the compositional representation of the
     returned vectors in the space of the data: the center as a
     composition 'Center', and the loadings in terms of a composition
     to perturbe with positively ('Loadings') or negatively
     ('DownLoadings'). The Up- and DownLoadings are normalized to the
     number of parts in the simplex and not to one to simplify the
     interpretation. A value of about one means no change in the
     specific component. To avoid confusion the meaningless last
     principal component is removed. 
      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 biplot strongly differs from one.  The
     relevant variables are not the drawn arrows of the components, but
     rather the links or differences between two arrowheads, which can
     be interpreted as log-ratios between the two components
     represented by the arrows.  
      The compositional loading plot is introduced with this package.
     The loadings of all component can be seen as an orthogonal basis
     in the space of clr-transformed data. These vectors are displayed
     by a barplot with their corresponding composition. For a better
     interpretation the total of these compositons is set to the number
     of parts in the composition, such that a portion of one means no
     effect. This is similar to (but not exactly the same as) 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 composition beeing
     represented by the unit vector of loadings in the clr-transformed
     space. If 'scale.sdev' is numeric we use this composition 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.

_V_a_l_u_e:

     'princomp' gives an object of type
     'c("princomp.acomp","princomp")' with the following content: 

    sdev: the standard deviation of the principal components

loadings: the matrix of variable loadings (i.e., a matrix which columns
          contain the eigenvectors). This is of class '"loadings"'. The
          last eigenvector is removed since it should contain the
          irrelevant scaling.

  center: the clr-transformed vector of means used to center the
          dataset

  Center: the 'acomp' vector of means used to center the dataset

   scale: the scaling applied to each variable

   n.obs: number of observations

  scores: if 'scores = TRUE', the scores of the supplied data on the
          principal components and the information was available.
          Scores are coordinates in a basis given by the principal
          components and thus not compositions

    call: the matched call

na.action: not clearly understood

Loadings: compositions that represent a perturbation with the vectors
          represented by the loadings of each of the factors 

DownLoadings: compositions that represent a perturbation with the
          inverse of the vectors represented by the loadings of each of
          the factors

     'predict' 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'.

_R_e_f_e_r_e_n_c_e_s:

     Aitchison, J, C. Barcel'o-Vidal, J.J. Egozcue, V. Pawlowsky-Glahn
     (2002) A consise guide to the algebraic geometric structure of the
     simplex, the sample space for compositional data analysis, _Terra
     Nostra_, Schriften der Alfred Wegener-Stiftung, 03/2003

     Aitchison, J. and M. Greenacre (2002) _Biplots for Compositional
     Data_ Journal of the Royal Statistical Society, Series C (Applied
     Statistics) *51* (4) 375-392

     Pawlowsky-Glahn, V. and J.J. Egozcue (2001) Geometric approach to
     statistical analysis on the simplex. _SERRA_ *15*(5), 384-398

     <URL: http://ima.udg.es/Activitats/CoDaWork03>

     <URL: http://ima.udg.es/Activitats/CoDaWork05>

_S_e_e _A_l_s_o:

     'clr','acomp', 'relativeLoadings'  'princomp.aplus',
     'princomp.rcomp', 'barplot.acomp', 'mean.acomp', 'var.acomp'

_E_x_a_m_p_l_e_s:

     data(SimulatedAmounts)
     pc <- princomp(acomp(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))

