Pass the function a latent variable and IRT item parameters, the function will simulate J items with K categories

sim_irt_item(
  dat,
  J = NULL,
  K = NULL,
  item.param = NULL,
  latent.variable = "Y_comp",
  time.var = "Time"
)

Arguments

dat

dataframe with values

J

number of items

K

number of categories

item.param

option to pass the matrix of item parameters; you have to name the slope "slope" and the intercepts "intercept_1", "intercept_2" etc if you leave this empty, item parameters will be used

latent.variable

pass the latent variable that will be used in the IRT model to simulate the item responses

time.var

specify the time variable, this is used to standardize the latent variable based on the distribution at the first timepoint. That is, the latent variable at timepoint 1 will have a mean of zero and sd = 1

anchor

this is the anchor used to condition on the stable subset of subjects

Value

returns dataframe with J items in it, also returns the item parameters and a separate dataframe with just the item responses