if(requireNamespace("GDINA")){
library(GDINA)
# Assuming dat0, dat1, Q, and other necessary data and objects are predefined.
rdmodel <- c("GDINA","GDINA","GDINA","GDINA","GDINA","GDINA","GDINA","GDINA",
"GDINA","GDINA","GDINA","GDINA","GDINA","GDINA","GDINA","GDINA",
"GDINA","GDINA","GDINA","GDINA","RRUM","GDINA","GDINA","GDINA",
"GDINA","LLM","LLM","RRUM","ACDM","GDINA","GDINA","GDINA",
"GDINA","GDINA","GDINA","GDINA","GDINA","GDINA","GDINA","GDINA")
fitrd <- GDINA(dat = dat0, Q = Q, model= rdmodel, mono.constraint = TRUE, verbose=0)
# Obtained the item parameters from Tan et al. (2022)
itemparm.rd = GDINA::extract(fitrd,"catprob.parm")
# Fit the response data at pre-test to the selected models
fit.t1 = GDINA(dat = dat1[,3:42], Q = Q, mono.constraint = TRUE, model = rdmodel,
catprob.parm = itemparm.rd, att.dist = "independent", control=list(maxitr = 0), verbose=0)
# Fit the response data at post-test to the selected models
fit.t2 = GDINA(dat = dat1[,43:82], Q = Q, mono.constraint = TRUE, model = rdmodel,
catprob.parm = itemparm.rd, att.dist = "independent", control=list(maxitr = 0), verbose=0)
fit.object = list()
fit.object[[1]] <- fit.t1
fit.object[[2]] <- fit.t2
t = 2 # the number of time points
K = ncol(Q) # the number of attributes
N = nrow(dat1) # the number of observations
cep = CEP_t(fit.object = fit.object, t = t, K = K, N = N)
# The CEP matrices of the attributes
cep$cep.matrix
}
Run the code above in your browser using DataLab