StanDCM is a helpful tool of estimating Diagnostic Classification Models (DCM) via Stan
- Check Jiang and Carter’s (2019) article on Using Hamiltonian Monte Carlo to estimate the log-linear cognitive diagnosis model via Stan
- Estimating log-linear cognitive diagnosis model (LCDM) and a variety of widely-used models subsumed by the LCDM, including the DINA model, DINO model, additive-CDM (A-CDM), linear logistic model (LLM), reduced reparametrized unified model (RRUM), multiple-strategy DINA model for dichotomous responses
- Specifying customized prior distributions for parameters
- Computing can be achieved in parallel environments
- Estimating models within the LCDM model framework using user-specified design matrix
- Estimating rating scale DCM for ordinal and nominal responses
To install this package from source:
-
Users may need to install the rstan in order to execute the functions of StanDCM package.
-
Windows users should avoid using space when installing rstan.
-
After installing rstan package, users can use the lines beblow to install StanDCM package.
# the development version from GitHub
# install.packages("devtools")
devtools::install_github("JihongZ/StanDCM")
The parametric version of DCM R package named GDINA can be found in R CRAN at here
You can fit a LCDM model:
mod.LCDM <- StanLCDM.run(Qmatrix = Qmatrix,
response.matrix = respMatrix,
iter = 5000, warmup = 1000, chain.num = 5)
summary(mod.LCDM)
or you can fit a DINA model by simply using:
mod.DINA <- StanDINA.run(Qmatrix = Qmatrix,
response.matrix = respMatrix,
iter = 5000, warmup = 1000, chain.num = 5)
Posterior predictive model checking (PPMC) could be also conducted:
StanDCM.ppmc(mod.LCDM, respMatrix, n.sim = 500, n.burnin = 100)