#############################################################################
# EXAMPLE 1: Fitted unidimensional model with gdm
#############################################################################
data(data.Students)
dat <- data.Students
# select part of thze dataset
resp <- dat[ , paste0("sc",1:4) ]
resp[ paste(resp[,1]) == 3 ,1] <- 2
psych::describe(resp)
# Model 1: Partial credit model in gdm
theta.k <- seq( -5 , 5 , len=21 ) # discretized ability
mod1 <- gdm( dat = resp , irtmodel="1PL" , theta.k=theta.k , skillspace="normal" ,
centered.latent=TRUE)
# compute thresholds
thresh1 <- IRT.threshold(mod1)
print(thresh1)
IRT.WrightMap(thresh1)
#############################################################################
# EXAMPLE 2: Fitted mutidimensional model with gdm
#############################################################################
data( data.fraction2 )
dat <- data.fraction2$data
Qmatrix <- data.fraction2$q.matrix3
# Model 1: 3-dimensional Rasch Model (normal distribution)
theta.k <- seq( -4 , 4 , len=11 ) # discretized ability
mod1 <- gdm( dat , irtmodel="1PL" , theta.k=theta.k , Qmatrix=Qmatrix ,
centered.latent=TRUE , maxiter=10 )
summary(mod1)
# thresholds
thresh1 <- IRT.threshold(mod1)
print(thresh1)
Run the code above in your browser using DataLab