biplot diagram of PCA analysis differs from plot of variables
Entering edit mode
Last seen 6.3 years ago

I made a PCA analysis of mz 94x20 matrix:

pca_<-dudi.pca(df = rg, scannf = F, nf = 2)

and displayed the result with scatter(pca_, posieig = "bottomright").

I wanted to see only the variables, so I wrote


The variables were grouped differently on the first plot then on the second. Why?


r pca biplot • 1.3k views
Entering edit mode
Last seen 4 hours ago
United States

This question is only tangential to Bioconductor, as the made4 package uses the CRAN ade4 package internally. So one could argue that it is better asked on R-help.

That said, you need to read and understand the help page for the functions you are using. In the help page for dudi.pca() it says:


     Returns a list of classes ‘pca’ and ‘dudi’ (see dudi) containing
     the used information for computing the principal component
     analysis :

     tab: the data frame to be analyzed depending of the transformation
          arguments (center and scale)

      cw: the column weights

      lw: the row weights

     eig: the eigenvalues

    rank: the rank of the analyzed matrice

      nf: the number of kept factors

      c1: the column normed scores i.e. the principal axes

      l1: the row normed scores

      co: the column coordinates

      li: the row coordinates i.e. the principal components

So if you use scatterplot(), you get a PCA plot. If you directly plot pca_$co, you do not because you aren't plotting the principal components.


Login before adding your answer.

Traffic: 357 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6