# NOT RUN {
if(requireNamespace("simcdm", quietly = TRUE)) {
# Set a seed for reproducibility
set.seed(1512)
# Setup data simulation parameters
N = 1 # Number of Examinees / Subjects
J = 10 # Number of Items
K = 2 # Number of Skills / Attributes
# Note:
# Sample size and attributes have been reduced to create a minimally
# viable example that can be run during CRAN's automatic check.
# Please make sure to have a larger sample size...
# Assign slipping and guessing values for each item
ss = gs = rep(.2, J)
# Simulate an identifiable Q matrix
Q = simcdm::sim_q_matrix(J, K)
# Simulate subject attributes
subject_alphas = simcdm::sim_subject_attributes(N, K)
# Simulate items under the DINA model
items_dina = simcdm::sim_dina_items(subject_alphas, Q, ss, gs)
# Compute the edina model
edina_model = edina(items_dina, k = K)
# Display results
edina_model
# Provide a summary overview
summary(edina_model)
}
# }
Run the code above in your browser using DataLab