#############################################################################
# EXAMPLE 1: Dataset reading from sirt package
#############################################################################
data(data.read,package="sirt")
resp <- data.read
#***
# Model 1a: Exploratory factor analysis with 2 factors
mod1a <- tam.fa( resp=resp , irtmodel="efa" , nfactors= 2 )
summary(mod1a)
# varimax rotation
varimax(mod1a$B.stand)
# promax rotation
promax(mod1a$B.stand)
# more rotations are included in the GPArotation package
library(GPArotation)
# geomin rotation oblique
GPArotation::geominQ( mod1a$B.stand )
# quartimin rotation
GPArotation::quartimin( mod1a$B.stand )
#***
# Model 1b: Rasch testlet model with 3 testlets
dims <- substring( colnames(resp),1,1 ) # define dimensions
mod1b <- tam.fa( resp=resp , irtmodel="bifactor1" , dims=dims )
summary(mod1b)
#***
# Model 1c: Bifactor model
mod1c <- tam.fa( resp=resp , irtmodel="bifactor2" , dims=dims )
summary(mod1c)
#***
# Model 1d: reestimate Model 1c but assume that items 3 and 5 do not load on
# specific factors
dims1 <- dims
dims1[c(3,5)] <- NA
mod1d <- tam.fa( resp=resp , irtmodel="bifactor2" , dims=dims1 )
summary(mod1d)
Run the code above in your browser using DataLab