1. Learn
  2. /
  3. Courses
  4. /
  5. Helsinki Open Data Science

Connected

Exercise

A biplot of PCA

A biplot is a way of visualizing the connections between two representations of the same data. First, a simple scatter plot is drawn where the observations are represented by two principal components (PC's). Then, arrows are drawn to visualize the connections between the original variables and the PC's. The following connections hold:

  • The angle between the arrows can be interpret as the correlation between the variables.
  • The angle between a variable and a PC axis can be interpret as the correlation between the two.
  • The length of the arrows are proportional to the standard deviations of the variables

Instructions

100 XP
  • Create and print out a summary of pca_human (created in the previous exercise)
  • Create object pca_pr and print it out
  • Adjust the code: instead of proportions of variance, save the percentages of variance in the pca_pr object. Round the percentages to 1 digit.
  • Execute the paste0() function. Then create a new object pc_lab by assigning the output to it.
  • Draw the biplot again. Use the first value of the pc_lab vector as the label for the x-axis and the second value as the label for the y-axis.