data_gen: Generate data from the one-parameter RSC model.

Description Usage Arguments Value

Description

This is a wrapper for sim_RSC that saves the data generating parms and allows for multple response patterns per group. To generate data from a 2PL model, set theta1 = theta2 and w = 1/2.

Usage

1
2
data_gen(n_reps, u, parms, theta1, theta2, theta1_se = NULL,
  theta2_se = NULL, NA_pattern = NULL)

Arguments

n_reps

integer indicating how many datasets to generate.

u

the logit of the weight parameter of the RSC model.

parms

a data.frame with columns parms$alpha and parms$beta corresponding to the discrimination and difficulty parameters of the 2PL model, respectively.

theta1

the latent trait for member 1.

theta2

the latent trait for member 2.

theta1_se

the standard error of the latent trait for member 1 (optional). If included, data generation samples n_reps values from rnorm(theta1, theta1_se).

theta2_se

the standard error of the latent trait for member 2 (optional). If included, data generation samples n_reps values from rnorm(theta2, theta2_se).

NA_pattern

an (optional) length(u) by nrow(parms) data.frame with NA entries denoting missing data. The missing values are preserved in the generated data.

Value

A data.frame with length(u) rows containing an id variable for each pair and each sample, the data generating values of u, theta1, and theta2, and the simulated response patterns.


peterhalpin/cirt documentation built on May 25, 2019, 1:50 a.m.