# NOT RUN {
n_item <- 10 # sample(8:12, 1)
n_theta <- 50 # sample(100:200, 1)
raw_resp <- matrix(sample(LETTERS[1:4], n_item * n_theta, replace = TRUE),
nrow = n_theta, ncol = n_item,
dimnames = list(paste0("Examinee-", 1:n_theta),
paste0("Item-", 1:n_item)))
# Add some missing responses
raw_resp[sample(1:length(raw_resp), round(length(raw_resp)*.1))] <- NA
# Prepare answer key
key <- sample(LETTERS[1:4], n_item, replace = TRUE)
# Run distractor analysis:
da <- distractor_analysis(raw_resp = raw_resp, key = key)
# }
Run the code above in your browser using DataLab