hltsim: Simulate the HLT model

View source: R/sim.R

hltsimR Documentation

Simulate the HLT model

Description

Simulate the HLT model

Usage

hltsim(type, n, ntheta, lambda, id, dL, nB, beta = NULL)

Arguments

type

type of model to simulate. 'type = "1p"' for the partial credit model. 'type = "2p"' for the generalized partial credit model.

n

number of observations

ntheta

number first-level of latent dimensions

lambda

latent factor coefficients

id

number of questions

dL

number of levels for each question

nB

number of regression parameters. nB = ncol(z).

beta

what value to set the regression parameters.

Value

a 'list' containing

  • x - matrix of simulated item responses

  • theta - matrix of true latent ability

  • id - I.Ds for item membership to each dimension

  • namesx - vector of column names for each item

  • s.cor - true correlations between latent ability dimensions

  • s.delta - true difficulty parameters

  • s.lambda - true loading parameters

  • s.alpha - true discrimination parameters

Examples

xdat = hltsim(n = 250, type = "2p", ntheta = 4, 
              lambda = c(0.5, 0.8, 0.9, 0.4), id = c(rep(0, 15),         
              rep(1, 15), rep(2, 15), rep(3, 15)), dL = 2)
mod1 = hlt(x = xdat$x, id = xdat$id, iter = 12e1, 
           burn = 6e1, delta = 0.023)

xdat = hltsim(n = 250, type = "2p", ntheta = 4, 
              lambda = c(0.5, 0.8, 0.9, 0.4), id = c(rep(0, 15),         
              rep(1, 15), rep(2, 15), rep(3, 15)), dL = 2,
              beta = c(0.5, -0.7), nB = 2)
mod2 = hlt(x = xdat$x, id = xdat$id, z = xdat$z, 
           iter = 12e1, burn = 6e1, delta = 0.023, nchains = 1)



hlt documentation built on Aug. 22, 2022, 5:06 p.m.

Related to hltsim in hlt...