In this article, the JAGS software program is systematically introduced to fit common Bayesian cognitive diagnosis models (CDMs), including the deterministic inputs, noisy "and" gate (DINA) model, the deterministic inputs, noisy "or" gate (DINO) model, the linear logistic model, the reduced reparameterized unified model (rRUM), and the log-linear CDM (LCDM).The unstructured latent structural model and the higher-order latent structural model are both introduced. We also show how to extend those models to consider the polytomous attributes, the testlet effect, and the longitudinal diagnosis. Finally, an empirical example is presented as a tutorial to illustrate how to use the JAGS codes in R.
Keywords: cognitive diagnosis modeling, Bayesian estimation, Markov chain Monte Carlo, DINA model, DINO model, rRUM, testlet, longitudinal diagnosis, polytomous attributes 2013), their commercialization prevents unauthorized users especially students from accessing these software without purchasing. In this article, we demonstrate how to use the freeware, JAGS, to fit several popular CDMs and present the code. It is expected that the researchers can adapt the code to fit extended CDMs,which cannot be fitted in existing software or packages for their research or application purposes. In general, JAGS makes it easy to construct a Markov chain for parameters. It does not require users to derive the posterior distribution of the model parameters by hand. Movereover,, the R2jags package (Version 0.5-7; Su & Yajima, 2015) in R could be easily used to call the JAGS. Furthermore, It should be noted that the JAGS code presented in this study can be generalized easily to other BUGS software programs by minor editing including WinBUGS and OpenBUGS 2 . The following sections first illustrate JAGS codes for five CDMs: (1) the DINA model; (2) the DINO model; (3) the LLM; (4) the rRUM, and (5) the LCDM. Besides those five models, which are based on the unstructured (or saturated) latent structuralels, the higher-order latent structural model (de la Torre & Douglas, 2004) is also demonstrated. Further, the extensions to the polytomous attributes, the testlet effect, and the longitudinal diagnosis using JAGS are presentedas well. Lastly, an empirical example analysis is conductedto illustrate how to use the R2jags package to run the JAGS code.