make_mplus_code: Generate Mplus code for Thurstonian IRT models

Description Usage Arguments Value Examples

View source: R/mplus.R

Description

Generate Mplus code for Thurstonian IRT models

Usage

1
make_mplus_code(data, iter = 1000, eta_file = "eta.csv")

Arguments

data

An object of class 'TIRTdata'. see make_TIRT_data for documentation on how to create one.

iter

Maximum number of iterations of the model fitting algorithm.

eta_file

optional file name in which predicted trait scores should be stored.

Value

A list of Mplus code snippets to be interpreted by the MplusAutomation package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sim_data <- sim_TIRT_data(
  npersons = 100,
  ntraits = 3,
  nblocks_per_trait = 4,
  gamma = 0,
  lambda = c(runif(6, 0.5, 1), runif(6, -1, -0.5)),
  Phi = diag(3)
)

# show the created Mplus code
lapply(make_mplus_code(sim_data), cat)

thurstonianIRT documentation built on Aug. 9, 2019, 5:07 p.m.