This paper introduces the R package CDM for cognitive diagnosis models (CDMs).
The package implements parameter estimation procedures for two general CDM frameworks,
the generalized-deterministic input noisy-and-gate (G-DINA) and the general diagnostic
model (GDM). It contains additional functions for analyzing data under these
frameworks, like tools for simulating and plotting data, or for evaluating global model and
item fit. The paper describes the theoretical aspects of implemented CDM frameworks
and it illustrates the usage of the package with empirical data of the common fraction
subtraction test by Tatsuoka