Hello,
I am using pcangsd and getting a covariance matrix. Until now I was simply applying a PCA on the covariance matrix using the "prcomp" unscale fonction in R and plotting/analysing the PC outputs.
Yet, the prcomp function is rather supposed to be applied on raw data and include in itself the passage through the covariance matrix. So I am unsure whether it is correct to apply a PCA on the covariance matrix. First trial seems to show that a pca on data et different than a pca on the covariance matrix of the data.
So I'm curious to know how pcangsd users deal with the covariance matrix and how in the paper you went from the covariance matrix to the PC representation.
Sorry, I found the solution. Migth be useful for somebody else.
One can use the function eigen in R which makes the decomposition of the covariance matrix into eigenvectors (=PCs) and eigenvalues.
My apologies!
Hello, I am using pcangsd and getting a covariance matrix. Until now I was simply applying a PCA on the covariance matrix using the "prcomp" unscale fonction in R and plotting/analysing the PC outputs.
Yet, the prcomp function is rather supposed to be applied on raw data and include in itself the passage through the covariance matrix. So I am unsure whether it is correct to apply a PCA on the covariance matrix. First trial seems to show that a pca on data et different than a pca on the covariance matrix of the data.
So I'm curious to know how pcangsd users deal with the covariance matrix and how in the paper you went from the covariance matrix to the PC representation.
Thanks a lot for your help
Claire