sim_subject_attributes: Simulate Subject Latent Attribute Profiles \mathbf{alpha}_c

Description Usage Arguments Value Author(s) See Also Examples

View source: R/RcppExports.R

Description

Generate a sample from the \mathbf{α}_c = (α_{c1}, …, α_{cK})' attribute profile matrix for members of class c such that α_{ck} ' is 1 if members of class c possess skill k and zero otherwise.

Usage

1

Arguments

N

Number of Observations

K

Number of Skills

probs

A vector of probabilities that sum to 1.

Value

A N by K matrix of latent classes corresponding to entry c of pi based upon mastery and nonmastery of the K skills.

Author(s)

James Joseph Balamuta and Steven Andrew Culpepper

See Also

simcdm::attribute_classes() and simcdm::attribute_inv_bijection()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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)

simcdm documentation built on May 2, 2019, 9:09 a.m.