R/RcppExports.R
sim_subject_attributes.Rd
Generate a sample from the \(\mathbf{\alpha}_c = (\alpha_{c1}, \ldots, \alpha_{cK})'\) attribute profile matrix for members of class \(c\) such that \(\alpha_{ck}\) ' is 1 if members of class \(c\) possess skill \(k\) and zero otherwise.
sim_subject_attributes(N, K, probs = NULL)
Number of Observations
Number of Skills
A vector
of probabilities that sum to 1.
A \(N\) by \(K\)
matrix
of latent classes
corresponding to entry \(c\) of \(pi\) based upon
mastery and nonmastery of the \(K\) skills.
# Define number of subjects and attributes
N = 100
K = 3
# Generate a sample from the Latent Attribute Profile (Alpha) Matrix
# By default, we sample from a uniform distribution weighting of classes.
alphas_builtin = sim_subject_attributes(N, K)
# Generate a sample using custom probabilities from the
# Latent Attribute Profile (Alpha) Matrix
probs = rep(1 / (2 ^ K), 2 ^ K)
alphas_custom = sim_subject_attributes(N, K, probs)