sim_rrum_items {simcdm} | R Documentation |
Randomly generate response data according to the reduced Reparameterized Unified Model (rRUM).
sim_rrum_items(Q, rstar, pistar, alpha)
Q |
A |
rstar |
A |
pistar |
A |
alpha |
A |
Y A matrix
with N rows and J columns indicating
the indviduals' responses to each of the items, where J
represents the number of items.
Steven Andrew Culpepper, Aaron Hudson, and James Joseph Balamuta
Culpepper, S. A. & Hudson, A. (In Press). An improved strategy for Bayesian estimation of the reduced reparameterized unified model. Applied Psychological Measurement.
Hudson, A., Culpepper, S. A., & Douglas, J. (2016, July). Bayesian estimation of the generalized NIDA model with Gibbs sampling. Paper presented at the annual International Meeting of the Psychometric Society, Asheville, North Carolina.
# Set seed for reproducibility set.seed(217) # Define Simulation Parameters N = 1000 # number of individuals J = 6 # number of items K = 2 # number of attributes # Matrix where rows represent attribute classes As = attribute_classes(K) # Latent Class probabilities pis = c(.1, .2, .3, .4) # Q Matrix Q = rbind(c(1, 0), c(0, 1), c(1, 0), c(0, 1), c(1, 1), c(1, 1) ) # The probabiliies of answering each item correctly for individuals # who do not lack any required attribute pistar = rep(.9, J) # Penalties for failing to have each of the required attributes rstar = .5 * Q # Randomized alpha profiles alpha = As[sample(1:(K ^ 2), N, replace = TRUE, pis),] # Simulate data rrum_items = sim_rrum_items(Q, rstar, pistar, alpha)