david-barnett / microViz

R package for microbiome data visualization and statistics. Uses phyloseq, vegan and the tidyverse. Docker image available.
https://david-barnett.github.io/microViz/
GNU General Public License v3.0
94 stars 10 forks source link

ord_get() extract Eigenvalues for all the samples #54

Closed Leran10 closed 2 years ago

Leran10 commented 2 years ago

Hi,

I'm trying to extract eigenvalues for every sample with ord_get() function, so that I can use PC1 values of each sample to build a lm(diagnosis ~ PC1) model to get a p value for the PCA plot. But when I run ord_get() on ps_extra object, I only get:

Call: rda(formula = OTU ~ 1, data = data)

              Inertia Rank
Total           309.8     
Unconstrained   309.8  116
Inertia is variance 

Eigenvalues for unconstrained axes:
  PC1   PC2   PC3   PC4   PC5   PC6   PC7   PC8 
50.56 26.64 20.40 14.73 11.55 10.95  9.00  8.43 
**(Showing 8 of 116 unconstrained eigenvalues)**

So I wondered how can I get PC values of other 115 samples? Or do you have any suggestion on how to get p value for PCA plot?

Thanks! Leran