gendata_gIRT {lazy.girt}R Documentation

Generation of Simulated Item Response Data under gIRT Model

Description

Generation of Simulated Item Response Data under gIRT Model

Usage

gendata_gIRT(Ntot, param, DinP = 1, Nmat = NULL, thetaphi = NULL,
  npoint = NULL, theta = NULL, npointth = 7, thmin = -3, thmax = 3,
  phi = NULL, npointph = 5, phmin = 0, phmax = 5, thd = NULL,
  thdist = "NORMAL", thmean = 0, thstd = 1, phd = NULL,
  phdist = "GBETA", paramab = c(1, 3), nomiss = 0, compress = 0,
  sort = 1, thetaname = NULL)

Arguments

Ntot

# of total observations to be generated If Ntot == 1, one observation per each theta point will be generated,
otherwize, the # of observations per each theta point is
proportional to round(Ntot*thd) where thd is
the npoint x 1 vector of theta distribution.
Therefore, Ntot must be large enough.

param

Item Parameter Data Frame

DinP

= 1 to include D=1.7 in logistic function

Nmat

npoints x nitems matrix consisting of # of trials, or NULL. This will be used only when Ntot=1 and compress=0.

theta

Discrete theta values

thmin

Minimum value of discrete thata value

thmax

Maximum value of discrete thata value

thd

theta distribution probability vector

thdist

= "NORMAL" or "UNIFORM" or "rnorm" or "runif"
When "NORMAL" or "rnorm",
thmean and thstd will be used to generate thd.
When "UNIFORM" or "runif",
thmin and thmax will be used to generate thd.
When "rnorm" or "runif", theta will be generated using
npoints random numbers and thd and Ntot is set equal to 1.

thmean

mean of theta distribution

thstd

std of theta distribution

nomiss

= 1 to exclude those theta points with N = 0.

compress

= 1 to compress the data when Ntot = 1.

sort

= 1 to sort the result according to theta.

thetaname

= Name of the variable which will contain theta value or NULL.

npoints

# of discrete points for theta, or # of random variables

Value

A list of
U, N, npoints, theta, thd, Ntot, fromP, toP, type, ncat, thmean, thstd , compress, sort


where

If compress = 0 and Ntot is large,
U is npoints x sum of ncat[j]
U[,fromP[j]:toP[j]] is npoints x ncat[j]
U[,fromP[j]:toP[j]][i,k] contains # of responses to
the k-th category (k=0,1,...,ncat[j]) at theta[i]
to which N[i]=round(Ntot*thd[i]) observations belong.


If compress = 1 and Ntot = 1,
U is npoints x nitems
U[i,j] contains the response to the j-th item at theta[i]
where 0 <= U[i,j] <= ncat[j]-1.
In this case, fromP and toP are not compressed.

(theta, thd, N) are npoints x 1
N[i] is the # of observations at theta[i]

Examples

set.seed(1701)
# 30 binary items
param=paramBr
# one obs per random theta-phi
resg <- gendata_gIRT( 1, param, thdist="NORMAL", phdist="GBETA", compress=1
                     , npoint=500, phmin=0, phmax=2, paramab=c(1,4) )
Uc1=as.data.frame( resg$U )
thetaphi_ORG1=resg$thetaphi

set.seed(1701)
param=paramBG
# one obs per theta-phi grid
resg <- gendata_gIRT( 1, param, thdist="NORMAL", phdist="GBETA", compress=1
                     , npointth=501, thmin=-4, thmax=4
                     , npointph=3, phmin=0, phmax=2 )
Uc2=as.data.frame( resg$U )
thetaphi_ORG2=resg$thetaphi



[Package lazy.girt version 0.1.3 Index]