0

Could you please explain how to use principal components in principal component analysis in a correlation analysis? I performed a PCA on my dataset and extracted 2 components; Now I'm wondering how to use pearson or spearman correlation analaysis to find out the correlation between PC1(or PC2) and, let' say, a continuous variable?

Many thanks!

I tried and extarcted 2 components;but I just don't know how to do a correlation analysis?!

  • You could add a supplementary variable in your PCA, as presented [here](http://www.sthda.com/english/articles/31-principal-component-methods-in-r-practical-guide/112-pca-principal-component-analysis-essentials/#supplementary-elements). Then, you can visualize the correlation between your supplementary variable and your components (PC1 and PC2), as presented in the website – Dimitri Apr 05 '23 at 12:18
  • 1
    Hi Erfan, welcome to SO! Could you please [edit] your post to include a [reproducible example](https://stackoverflow.com/q/5963269/17303805)? This will help us understand where you’re stuck and provide relevant help. Thanks! – zephryl Apr 05 '23 at 12:22
  • 1
    Stack Overflow is for specific programming questions. Asking how to do a statistical analysis is off-topic. You should ask such questions at [stats.se] instead. – MrFlick Apr 05 '23 at 13:30
  • Thanks a lot! I didn't notice that R "principal" function provides us with PC factors of each observation (each participant) – Erfan Naghavi Apr 10 '23 at 14:11

0 Answers0