0

I'm running PCA with 31 variables, and I need to know which variable corresponds to the firs principal component and captures the most variance. Here is my code:

mat=cov(df_15[11:41])
pca=princomp(covmat=mat)
summary(pca)

But the output names the components without mentioning any variables. Is there a way to find what I'm looking for? Am I misunderstanding it?

Johnny
  • 59
  • 5

1 Answers1

1

loadings(pca) shows the loadings of the input variables on the components. The higher the loading of variable Vx on component Cx, the higher their correspondence.

(As Rui Barradas mentioned, the mechanics of PCA would be better suited for Q&A on Cross Validated, see e. g. here.)

I_O
  • 4,983
  • 2
  • 2
  • 15