Randomly generate response data according to the reduced Reparameterized Unified Model (rRUM).
sim_rrum_items(Q, rstar, pistar, alpha)
Arguments
Q: A matrix with J rows and K columns indicating which attributes are required to answer each of the items, where J represents the number of items and K the number of attributes. An entry of 1 indicates attribute k is required to answer item j. An entry of one indicates attribute k is not required.
rstar: A matrix a matrix with J rows and K columns indicating the penalties for failing to have each of the required attributes, where J represents the number of items and K the number of attributes. rstar and Q
must share the same 0 entries.
pistar: A vector of length J indicating the probabiliies of answering each item correctly for individuals who do not lack any required attribute, where J represents the number of items.
alpha: A matrix with N rows and K columns indicating the subjects attribute acquisition, where K represents the number of attributes. An entry of 1 indicates individual i has attained attribute k. An entry of 0 indicates the attribute has not been attained.
Returns
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.
Examples
# Set seed for reproducibilityset.seed(217)# Define Simulation ParametersN =1000# number of individualsJ =6# number of itemsK =2# number of attributes# Matrix where rows represent attribute classesAs = attribute_classes(K)# Latent Class probabilitiespis = c(.1,.2,.3,.4)# Q MatrixQ = 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 attributepistar = rep(.9, J)# Penalties for failing to have each of the required attributesrstar =.5* Q
# Randomized alpha profilesalpha = As[sample(1:(K ^2), N, replace =TRUE, pis),]# Simulate datarrum_items = sim_rrum_items(Q, rstar, pistar, alpha)
References
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.
Author(s)
Steven Andrew Culpepper, Aaron Hudson, and James Joseph Balamuta