This function generates data from a (multidimensional) PCM.
irtree_gen_pcm(
object = NULL,
N = NULL,
sigma = NULL,
theta = NULL,
itempar = NULL,
link = "logit",
na_okay = TRUE,
skip = FALSE
)
Object of class irtree_model
. See irtree_model for more
information.
Integer, the number of persons.
Either a matrix or a function that returns a matrix. This matrix
is the variance-covariance matrix of the person parameters that is passed
to MASS::mvrnorm()
. Note that the order of the person
parameters is taken from the section Processes in the model object
(see
irtree_model).
Optional numeric matrix of person parameters with one row per person and
one column per dimension (i.e., object$S
). If provided, this overrides
N
and sigma
.
Either a list or a function that returns a list. The list has
an element beta
and an element alpha
. Each of these is a
matrix of item parameters. Note that the order of items (rows) is taken from the
section Items and the order of processes (columns) is taken from the
section Processes in the model
(see irtree_model).
Character. Link function to use.
Logical indicating whether variables with unobserved response
categories are permitted. If FALSE
, rejection sampling
is used to ensure that all categories are observed.
Logical. Some features of the irtree_model syntax,
which are available for model fitting (e.g., Addendum
), are not
implemented for data generation. Those parts of the model are ignored if
skip = TRUE
.
A list with element data
containing the data and an
element spec
containing the true parameter values etc.