Is it possible to visualize the output of Principal Component Analysis in ways that give more insight than just summary tables? Is it possible to do it when the number of observations is large, say ~1e4? And is it possible to do it in R [other environments welcome]?

  • 2
    A few questions: How many components do you have? Besides the sample size, is there anything that makes the display of this PCA output need to be different from the display of other continuous variables that one might be dealing with? Are you trying to contrast scores of different groups, and if so how many? Generally, what are you hoping to achieve with your displays? – rolando2 Mar 3 '11 at 23:26
up vote 52 down vote accepted

The biplot is a useful tool for visualizing the results of PCA. It allows you to visualize the principal component scores and directions simultaneously. With 10,000 observations you’ll probably run into a problem with over-plotting. Alpha blending could help there.

Here is a PC biplot of the wine data from the UCI ML repository:

PC Biplot of Wine Data from  UCI ML Repository

The points correspond to the PC1 and PC2 scores of each observation. The arrows represent the correlation of the variables with PC1 and PC2. The white circle indicates the theoretical maximum extent of the arrows. The ellipses are 68% data ellipses for each of the 3 wine varieties in the data.

I have made the code for generating this plot available here.

  • 5
    A really dynamite addition. – rolando2 Mar 4 '11 at 22:35
  • Nice. How did you generate the graph above? Is there an R package, or bare hands? – gappy Mar 5 '11 at 16:56
  • 1
    that's a really nice visualization. Any chance you'd share the R code? – Jonathan Shore May 24 '11 at 18:39
  • I've released the code. See the link the at the bottom of the updated answer. – vqv Oct 23 '11 at 16:49
  • This is by far the prettiest biplot I have ever seen, +1 long time ago. I have a question about scaling the arrows (loadings) that you chose: what is the radius of the white circle? It is not equal to $1$ (maximal value for a correlation), so some scaling must have been done. Is it arbitrary (to make the circle and the arrows large enough to be nicely seen), or is there some logic behind the scaling choice? – amoeba Jan 14 '15 at 22:17

A Wachter plot can help you visualize the eigenvalues of your PCA. It is essentially a Q-Q plot of the eigenvalues against the Marchenko-Pastur distribution. I have an example here:Wachter plot showing a single dominant eigenvalue There is one dominant eigenvalue which falls outside the Marchenko-Pastur distribution. The usefulness of this kind of plot depends on your application.

  • 6
    It would be helpful to know more here (perhaps some additional explication &/or some useful links). What is the Marchenko-Pastur distribution? How does it relate to PCA? What does it mean for your results if it holds or does not? (etc) – gung Feb 2 '14 at 5:13

You could also use the psych package.

This contains a plot.factor method, which will plot the different components against one another in the style of a scatterplot matrix.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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