if (FALSE) {
#############################################################################
# EXAMPLE 07a: Dataset Gefechtsangst
#############################################################################
data(data.bs07a)
dat <- data.bs07a
items <- grep( "GF", colnames(dat), value=TRUE )
#************************
# Model 1: Rasch model
mod1 <- TAM::tam.mml(dat[,items] )
summary(mod1)
IRT.WrightMap(mod1)
#************************
# Model 2: 2PL model
mod2 <- TAM::tam.mml.2pl(dat[,items] )
summary(mod2)
#************************
# Model 3: Latent class analysis (LCA) with two classes
tammodel <- "
ANALYSIS:
TYPE=LCA;
NCLASSES(2)
NSTARTS(5,10)
LAVAAN MODEL:
F=~ GF1__GF9
"
mod3 <- TAM::tamaan( tammodel, dat )
summary(mod3)
#************************
# Model 4: LCA with three classes
tammodel <- "
ANALYSIS:
TYPE=LCA;
NCLASSES(3)
NSTARTS(5,10)
LAVAAN MODEL:
F=~ GF1__GF9
"
mod4 <- TAM::tamaan( tammodel, dat )
summary(mod4)
#************************
# Model 5: Located latent class model (LOCLCA) with two classes
tammodel <- "
ANALYSIS:
TYPE=LOCLCA;
NCLASSES(2)
NSTARTS(5,10)
LAVAAN MODEL:
F=~ GF1__GF9
"
mod5 <- TAM::tamaan( tammodel, dat )
summary(mod5)
#************************
# Model 6: Located latent class model with three classes
tammodel <- "
ANALYSIS:
TYPE=LOCLCA;
NCLASSES(3)
NSTARTS(5,10)
LAVAAN MODEL:
F=~ GF1__GF9
"
mod6 <- TAM::tamaan( tammodel, dat )
summary(mod6)
#************************
# Model 7: Probabilistic Guttman model
mod7 <- sirt::prob.guttman( dat[,items] )
summary(mod7)
#-- model comparison
IRT.compareModels( mod1, mod2, mod3, mod4, mod5, mod6, mod7 )
}
Run the code above in your browser using DataLab