Learn R Programming

GDINA Package for Cognitively Diagnostic Analyses

How to cite the package

Ma, W. & de la Torre, J. (2020). GDINA: An R Package for Cognitive Diagnosis Modeling. Journal of Statistical Software, 93(14), 1-26. https://doi.org/10.18637/jss.v093.i14

Visit the package website https://wenchao-ma.github.io/GDINA/ for examples, tutorials and more information.

Learning resources

Features of the package

  • Estimating G-DINA model and a variety of widely-used models subsumed by the G-DINA model, 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
  • Estimating models within the G-DINA model framework using user-specified design matrix and link functions
  • Estimating Bugs-DINA, DINO and G-DINA models for dichotomous responses
  • Estimating sequential G-DINA model for ordinal and nominal responses
  • Estimating the generalized multiple-strategy cognitive diagnosis models (experimental)
  • Estimating the diagnostic tree model (experimental)
  • Estimating multiple-choice models
  • Modelling independent, saturated, higher-order, loglinear smoothed, and structured joint attribute distribution
  • Accommodating multiple-group model analysis
  • Imposing monotonic constrained success probabilities
  • Accommodating binary and polytomous attributes
  • Validating Q-matrix under the general model framework
  • Evaluating absolute and relative item and model fit
  • Comparing models at the test and item levels
  • Detecting differential item functioning using Wald and likelihood ratio test
  • Simulating data based on all aforementioned CDMs
  • Providing graphical user interface for users less familiar with R

Installation

The stable version of GDINA should be installed from R CRAN at here

To install this package from source:

  1. Windows users may need to install the Rtools and include the checkbox option of installing Rtools to their path for easier command line usage. Mac users will have to download the necessary tools from the Xcode and its related command line tools (found within Xcode’s Preference Pane under Downloads/Components); most Linux distributions should already have up to date compilers (or if not they can be updated easily).

  2. Install the devtools package (if necessary), and install the package from the Github source code.

# install.packages("devtools")
devtools::install_github("Wenchao-Ma/GDINA")

Copy Link

Version

Install

install.packages('GDINA')

Monthly Downloads

961

Version

2.9.9

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Wenchao Ma

Last Published

May 1st, 2025

Functions in GDINA (2.9.9)

Qval

Q-matrix validation
ClassRate

Classification Rate Evaluation
DTM

Experimental function for diagnostic multiple-strategy CDMs
GDINA

CDM calibration under the G-DINA model framework
CA

Calculate classification accuracy
GDINA-package

The Generalized DINA Model Framework
LC2LG

Transformation between latent classes and latent groups
MCmodel

Multiple-choice models
ILCA

Iterative latent-class analysis
GMSCDM

Estimating multiple-strategy cognitive diagnosis models
bdiagMatrix

Create a block diagonal matrix
att.structure

Generate hierarchical attribute structures
bootSE

Calculating standard errors and variance-covariance matrix using bootstrap methods
ecpe

Examination for the Certificate of Proficiency in English (ECPE) data
modelfit

Model fit statistics
cjoint

Combine R Objects by Columns
designmatrix

Generate design matrix
extract

extract elements from objects of various classes
attributepattern

Generate all possible attribute patterns
dif

Differential item functioning for cognitive diagnosis models
autoGDINA

Q-matrix validation, model selection and calibration in one run
indlogPost

Extract log posterior for each individual
plot.itemfit

Item fit plots
npar

Calculate the number of parameters
itemfit

Item fit statistics
monocheck

This function checks if monotonicity is violated
rowMatch

Count the frequency of a row vector in a data frame
frac20

Tatsuoka's fraction subtraction data
indlogLik

Extract log-likelihood for each individual
itemparm

extract item parameters (deprecated)
plot.GDINA

Create plots for GDINA estimates
modelcomp

Item-level model comparison using Wald, LR or LM tests
score

Score function
tan2023

Mental health symptom profiles data
tan2023p25

Mental health symptom profiles data (polytomous data)
unrestrQ

Generate unrestricted Qc matrix from an restricted Qc matrix
plot.Qval

Mesa plot for Q-matrix validation
sim10GDINA

Simulated data (10 items, G-DINA model)
sim30GDINA

Simulated data (30 items, G-DINA model)
sim30DINA

Simulated data (30 items, DINA model)
startGDINA

Graphical user interface of the GDINA function
simGDINA

Data simulation based on the G-DINA models
tan2023p50

Mental health symptom profiles data (polytomous data)
unique_only

Unique values in a vector
sim10MCDINA

Simulated data (10 items, MC-DINA model)
sim10MCDINA2

Simulated data (10 items, MC-DINA model)
personparm

calculate person (incidental) parameters
simDTM

Simulating data for diagnostic tree model
sim30pGDINA

Simulated data (30 items, polytomous G-DINA model)
sim21seqDINA

Simulated data (21 items, sequential DINA model)
sim20seqGDINA

Simulated data (20 items, sequential G-DINA model)