I have a data frame in R containing four variables. I ran a PCA which showed that first two principal components mostly explain much of the variance in my data. I know that principal components are linear combinations of the original variables. Now how do I find out which combination(s) of my original variables give rise to these PCs?


  • 2
    $\begingroup$ the exact command depends on which function you used to get the PCA decomposition... $\endgroup$ – user603 Mar 3 '13 at 12:57
  • 2
    $\begingroup$ this is a pure R question (SO bound). $\endgroup$ – user603 Mar 3 '13 at 12:57

You can take the predicted values from the incomplete principal components regression model, and predict those predicted values from the original variables. This is one case where stepwise regression can help. Unlike prediction of $Y$ causing much volatility in stepwise methods, predicting combinations of the $X$s from the $X$s is more mechanistic.

You might also consider sparse principal components. Here's an example in R:

require(pcaPP)     # X below = data matrix
s <- sPCAgrid(X, k=10, method='sd', center=mean,
              scale=sd, scores=TRUE, maxiter=10)
plot(s, type='lines', main='', ylim=c(0,3))
s$loadings   # These loadings are on the original data scale

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.