#***
set.seed(657)
# simulate data according to the Ramsay model
N <- 1000 # persons
I <- 11 # items
theta <- exp( rnorm( N ) ) # person ability
b <- exp( seq(-2,2,len=I)) # item difficulty
K <- rep( 3 , I ) # K parameter (=> guessing)
# apply simulation function
dat <- sim.qm.ramsay( theta , b , K )
#***
# analysis
mmliter <- 50 # maximum number of iterations
I <- ncol(dat)
fixed.K <- rep( 3 , I )
# Ramsay QM with fixed K parameter (K=3 in fixed.K specification)
mod1 <- rasch.mml2( dat , mmliter = mmliter , irtmodel = "ramsay.qm",
numdiff.parm = .0001 , fixed.K = fixed.K )
summary(mod1)
# Ramsay QM with joint estimated K parameter
mod2 <- rasch.mml2( dat , mmliter = mmliter , irtmodel = "ramsay.qm" ,
numdiff.parm = .0001 , est.K = rep(1,I) )
summary(mod2)
# Ramsay QM with itemwise estimated K parameter
mod3 <- rasch.mml2( dat , mmliter = mmliter , irtmodel = "ramsay.qm" ,
numdiff.parm = .0001 , est.K = 1:I )
summary(mod3)
# Rasch model
mod4 <- rasch.mml2( dat )
summary(mod4)
# generalized logistic model
mod5 <- rasch.mml2( dat , est.alpha = TRUE )
summary(mod5)
# 2PL model
mod6 <- rasch.mml2( dat , est.a = rep(1,I) )
summary(mod6)
# Difficulty + Guessing (b+c) Model
mod7 <- rasch.mml2( dat , est.c = rep(1,I) )
summary(mod7)
# estimate separate guessing (c) parameters
mod8 <- rasch.mml2( dat , est.c = 1:I )
summary(mod8)
Run the code above in your browser using DataLab