1. Learn
  2. /
  3. Courses
  4. /
  5. Linear Algebra for Data Science in R

Exercise

Summarizing PCA in R

As we saw in the video, there was a categorical variable (position) in our data that seemed to identify itself with clusters in the first two principal components. Even when scaling the data, these two PCs still explain a great deal of variation in the data. What if we looked at only one position at a time?

Instructions

100 XP

Perform the same analysis as in the previous exercise, but only use the subset of the data where position equals "WR" (wide receiver):

  • Use the scale() function to scale the 5th through the 12th columns of combine_WR data. Name this data frame B and show some of the values using head().
  • Use prcomp() to perform principal component analysis on the data and summarize this analysis using summary().