make_sem_data: Prepare data for Thurstonian IRT models fitted with lavaan or...

Description Usage Arguments Value Examples

View source: R/data-helpers.R

Description

Prepare data for Thurstonian IRT models fitted with lavaan or Mplus

Usage

1

Arguments

data

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

Value

A data.frame ready to be passed to lavaan or Mplus.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# simulate some data
sdata <- 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)
)

# create data ready for use in SEM software
sem_data <- make_sem_data(sdata)
head(sem_data)

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