simulate_dawid_skene_model {rater} | R Documentation |
Simulate data from the Dawid-Skene model
Description
Simulate data from the Dawid-Skene model
Usage
simulate_dawid_skene_model(pi, theta, sim_data, seed = NULL)
Arguments
pi |
The pi parameter of the Dawid-Skene model. |
theta |
The theta parameter of the Dawid-Skene model. |
sim_data |
Data to guide the simulation. The data must be in the long
data format used in
|
seed |
An optional random seed to use. |
Details
The number of raters implied by the entries in the rater column must match the number of raters implied by the passed theta parameter.
This function can also be used to simulate from the class-conditional Dawid-Skene model by specifying theta in the required form (i.e where all off-diagonal entries of the error matrices are equal.)
Value
The passed sim_data
augmented with columns:
-
"z"
containing the latent class of each item, -
"rating"
containing the simulated ratings.
Examples
J <- 5
K <- 4
pi <- rep(1 / K, K)
theta <- make_theta(0.7, J, K)
sim_data <- data.frame(item = rep(1:2, each = 5), rater = rep(1:5, 2))
simulations <- simulate_dawid_skene_model(pi, theta, sim_data)
simulations