sim_rrum_items {simcdm} | R Documentation |
Generate data from the rRUM
Description
Randomly generate response data according to the reduced Reparameterized Unified Model (rRUM).
Usage
sim_rrum_items(Q, rstar, pistar, alpha)
Arguments
Q |
A |
rstar |
A |
pistar |
A |
alpha |
A |
Value
Y A matrix
with rows and
columns indicating
the indviduals' responses to each of the items, where
represents the number of items.
Author(s)
Steven Andrew Culpepper, Aaron Hudson, and James Joseph Balamuta
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.
Examples
# 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)