Here is the template I’ve been working on to fit EFA models to categorical items. Besides the packages listed at the beginning it will use the Num2Fac function.

##import your data: this example is for spss file ##remember to change data.sav for your path/filename library(foreign) tt <- read.spss("data.sav", use.value.labels=TRUE, max.value.labels=Inf, to.data.frame=TRUE) #loading packages that may be used in the script library(ltm) library(psych) library(polycor) library(nFactors) library(GPArotation) #You can get the Num2Fac function on a previous post #https://latentperiod.wordpress.com/2011/04/06/num2fac/ #save it as an R file and source it or run it to use it source("Num2Fac.R") #creating the dataframe with items as categorical variables ("factors") tt.f <- Num2Fac(tt) summary(tt) summary(tt.f) #using the hetcor function to run get the polychoric cors #this will take a while tt.polyf <- hetcor(tt.f) tt.poly <- as.data.frame(tt.polyf$correlations) #scree plot tests (notice that PA needs a proper simulation to run tt.scree<-nScree(eig=NULL, x=tt.poly, aparallel=NULL, cor=TRUE, model="factors", criteria=NULL) plotnScree(tt.scree) #you can also use the Very Simple Structure method to get number of #factors to retain VSS(tt.poly, n=6, rotate="oblimin", diagonal=FALSE, fm="pa", n.obs=426, plot=TRUE, title="VSS") #fitting a one factor solution (principal axis, oblimin rotation) tt.1f <- factor.pa(tt.poly, nfactors=1, n.obs=755,rotate="oblimin") print(tt.1f,digits=3)

Created by Pretty R at inside-R.org