Labs: Dimension Reduction, Factor Analysis Peter Fox Data Analytics – ITWS-4600/ITWS-6600/MATP-4450 Group 3 Lab 3, March 22, 2018
Factor Analysis, DR group3/ lab3_fa1.R lab3_dr1.R # real life research example
Glass index <- 1:nrow(Glass) testindex <- sample(index, trunc(length(index)/3)) testset <- Glass[testindex,] trainset <- Glass[-testindex,] # you’ve used this for classification, now…. cor(Glass[,-10]) prcomp(Glass[,-10]) Factor Analysis? How many factors? Dimension reduction?
SPSS files On web page: html/DA personality.sav, and SAQ.sav (Band Personality.sav) require(psych); require(foreign); # Import data from SPSS data file.personality <- foreign::read.spss("personality.sav", to.data.frame = TRUE) Explore with psych:VSS routines Do factor analysis, looking for ~ 5 factors, use rotation