cdCAT provides a session-based engine for Cognitive
Diagnostic Computerized Adaptive Testing (CD-CAT). It supports DINA,
DINO, and GDINA models with multiple item selection criteria and
attribute estimation methods.
The typical workflow has four steps:
cdcat_items()CdcatSession$new()session$result()The item bank requires a Q-matrix and item parameters. The Q-matrix is a binary matrix where rows are items and columns are attributes. An entry of 1 means the item requires that attribute.
# Q-matrix: 5 items, 2 attributes
Q <- matrix(c(
1, 0,
0, 1,
1, 0,
0, 1,
1, 1
), nrow = 5, ncol = 2, byrow = TRUE)
# DINA model parameters
items <- cdcat_items(
q_matrix = Q,
model = "DINA",
slip = c(0.10, 0.10, 0.15, 0.10, 0.10),
guess = c(0.20, 0.20, 0.15, 0.20, 0.15)
)
print(items)
#> cdCAT Item Bank
#> Model : DINA
#> Items : 5
#> Attrs : 2# Start session
session <- CdcatSession$new(
items = items,
method = "MAP",
criterion = "PWKL",
min_items = 2L,
max_items = 5L,
threshold = 0.8
)
# Simulate responses (1 = correct, 0 = incorrect)
simulated_responses <- c(1, 1, 0, 1, 0)
repeat {
item <- session$next_item()
if (item == 0) break
session$update(item, simulated_responses[item])
}res <- session$result()
cat("Estimated profile :", res$alpha_hat, "\n")
#> Estimated profile : 1 1
cat("Items administered:", res$administered, "\n")
#> Items administered: 1 2
cat("Responses :", res$responses, "\n")
#> Responses : 1 1
cat("N items :", res$n_items, "\n")
#> N items : 2
cat("Stop reason :", res$stop_reason, "\n")
#> Stop reason : single threshold reached
cat("Posterior :", round(res$posterior, 3), "\n")
#> Posterior : 0.033 0.149 0.149 0.669All adaptive criteria below are designed for single attribute profile estimation — they select the item that best discriminates the full latent attribute profile α.
| Criterion | Full Name |
|---|---|
"KL" |
Kullback-Leibler Information (KL) Method |
"PWKL" |
Posterior-Weighted Kullback-Leibler (PWKL) Method |
"MPWKL" |
Modified Posterior-Weighted Kullback-Leibler (MPWKL) Method |
"SHE" |
Shannon Entropy (SHE) Method |
"SEQ" |
Sequential (non-adaptive) |
"RANDOM" |
Random selection |
# DINO model
items_dino <- cdcat_items(Q, "DINO", slip = slip, guess = guess)
# GDINA model
gdina_params <- list(
list("0" = 0.1, "1" = 0.9),
list("0" = 0.1, "1" = 0.9),
list("00" = 0.1, "10" = 0.5, "01" = 0.5, "11" = 0.9)
)
items_gdina <- cdcat_items(Q[1:3, ], "GDINA", gdina_params = gdina_params)Three attribute estimation methods are available via the
method argument:
"MAP" — Maximum A Posteriori (default)"MLE" — Maximum Likelihood Estimation"EAP" — Expected A Posteriori