Week 6 HW Submission

.pdf

School

Georgia Institute Of Technology *

*We aren’t endorsed by this school

Course

CS 6501

Subject

Statistics

Date

Jun 6, 2024

Type

pdf

Pages

3

Uploaded by PresidentBaboon4458

Question 9.1 Using the same crime data set uscrime.txt as in Question 8.2, apply Principal Component Analysis and then create a regression model using the first few principal components. Specify your new model in terms of the original variables (not the principal components), and compare its quality to that of your solution to Question 8.2. You can use the R function prcomp for PCA. (Note that to first scale the data, you can include scale. = TRUE to scale as part of the PCA function. Don’t forget that, to make a prediction for the new city, you’ll need to unscale the coefficients (i.e., do the scaling calculation in reverse)!) #Run PCA on the non-binary data then add it back in later #run PCA on the matrix of SCALED predictors #PCA SUMMARY RESULTS #pca$rotation is the matrix of eigenvectors
#screeplot to visualize and help us decide on the number of principal components to use. #I decided to pick the first 6 principal components as that seems to be when the variance starts to level off. #build linear regression model with first 6 components
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help