irtree_gen_tree: Generate data from an IR-tree model

Description Usage Arguments Value

View source: R/generate-data.R

Description

This function generates data from an IR-tree model.

Usage

1
2
3
4
5
6
7
8
9
irtree_gen_tree(
  object = NULL,
  N = NULL,
  sigma = NULL,
  theta = NULL,
  itempar = NULL,
  link = c("logit", "probit"),
  na_okay = TRUE
)

Arguments

object

Object of class irtree_model. See irtree_model for more information.

N

Integer, the number of persons.

sigma

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).

theta

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.

itempar

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).

link

Character. Link function to use.

na_okay

Logical indicating whether variables with unobserved response categories are permitted. If FALSE, rejection sampling is used to ensure that all categories are observed.

Value

A list with element data containing the data and an element spec containing the true parameter values etc.


ItemResponseTrees documentation built on July 2, 2020, 2:25 a.m.