guIRT {lazy.girt}R Documentation

Parameter Estimation of the Generalized IRT Model

Description

Parameter Estimation of the Generalized IRT Model

Usage

guIRT(Uc, U = NULL, groupvar = NULL, idvar = NULL, ncat = NULL,
  type = NULL, itemname = NULL, DinP = 1, param = NULL, msn = NULL,
  fixeditems = NULL, baseform = 1, thetaphi = NULL, thphd = NULL,
  estmu = 0, estsigma = 0, npointth = 21, thmin = -4, thmax = 4,
  thdist = "NORMAL", thmean = 0, thstd = 1, npointph = 21, phmin = 0,
  phmax = 9, phdist = "GBETA", paramab = c(1, 3), maxiter = 200,
  eps = 1e-07, epsd = 1e-06, maxiter2 = 20, eps2 = 1e-04, nstrict = 9,
  maxiter22 = 5, minp1 = 0.1, maxabsparam = 20, SQUAREM = 3,
  nSQUAREM = 1, minalpha = -999, maxalpha = -1, always = 1,
  reset1 = 0, reset2 = 1, print = 2, plot = 0, smallP = 0,
  debug = 0)

Arguments

Uc

n x nitems+1 or +2 compressed item resopnse data frame in BILOG-MG's expanded format. (idvar and groupvar)

U

n x sum(ncat)+1 or +2 uncompressed irem response data frame

groupvar

name of the grouping varible contained as a column of Uc or NULL.

idvar

name of the id varible contained as a column of Uc or NULL

ncat

nitems x 1 # of categories for each item or NULL.

type

nitems x 1 vector of item types consisting of: "Bn" | "G" | "PN" | "P"
If NULL, P will be used.

itemname

nitems x 1 vector of item names or NULL.

DinP

= 0 to exclude 1.7 from logistic function.

param

nitems x max(ncat) initial value data frame for item param
Only the subset of the items can be given.
param$name and the colname(Uc) will be used to match the items.

msn

nG x 3 initial value matrix of (mean, std, n) for each group

fixeditems

list of items whose item parameters are to be fixed
to the values given in the param data frame.
Item numbers or item names

baseform

base form number whose theta distribution is fixed at the values given in msn[baseform,]
If there are fixed items, the values of the item paramters given in the param data frame must be on the baseform scale.

thetaphi

Discrete theta-phi grid values.
When NULL, thetaphi will be generated according to npointth etc.

thphd

pdf of theta-phi normalized to sum to unity.
When NULL,thphd will be generated according to npointth etc.

estmu

= 1 to estimate multigroup theta means

estsigma

= 1 to estimate mul tigroup theta std

npointth

# of discrete points for theta.

thmin

Minimum value of discrete thata value.

thmax

Maximum value of discrete thata value.

thdist

theta distribution "NORMAL" or "UNIFORM"

thmean

The prior mean of normal theta distribution.

npointph

# of discrete points for phi.

phmin

Minimum value of discrete phi value.

phmax

Maximum value of discrete phi value.

phdist

phi distribution "GBETA"

paramab

The prior param for the phi distribution.

maxiter

max # of iterations

eps

eps for the relative improvement of lmlh

epsd

eps for the max. abs. diff. of msn
Seems this is important.

maxiter2

max # of iterations for ordinal_reg and smn when llll <= nstrict.

eps2

eps for the relative improvement of llh in ordinal_reg and smn.

nstrict

maxiter2 will be reduced to maxiter22 after nstrict iterations.

maxiter22

max # of iterations for ordinal_reg and smn when llll > nstrict.

minp1

Minimum value of p1 parameter for type != "N" items.

maxabsparam

Maximum absolute value of parameters.

SQUAREM

= 3 : See the help of iSQUAREM in lazy.accel package.

nSQUAREM

when to star iSQUAREM

minalpha

= -999 : See the help of iSQUAREM in lazy.accel package.

maxalpha

= -1 : See the help of iSQUAREM in lazy.accel package.

always

= 0 : See the help of iSQUAREM in lazy.accel package.

reset1

= 1 : See the help of iSQUAREM in lazy.accel package.

reset2

= 2 : See the help of iSQUAREM in lazy.accel package.

print

= 1 to print the result

plot

= 1 to plot the estimated theta distributions

smallP

= Minimum value of P

debug

= 1 to print intermediate result

theta

npoints x 1 discrete theta points

thd

NOT used.

thsd

The prior standard deviation of normal theta distribution.

Examples


set.seed(1701)

# 30 binary items
param=paramBr
# one obs per 500 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

# item parameter estimation
res1=guIRT( Uc=Uc1, ncat=param$ncat, type=param$type
            , npointth=21, npointph=5, phmin=0, phmax=2
            , paramab=c(1,4), print=2 )

Print( cor( thetaphi_ORG1,res1$EAP ),
       cor( param[,c("p1","p2")], res1$param[,c("p1","p2")] ) )
plot( res1$EAP[,1], res1$EAP[,2])
dummy=freqdist1( res1$EAP[,1], npoints=101, plot=1 )
dummy=freqdist1( res1$EAP[,2], npoints=101, plot=1 )




set.seed(1701)

# 4 binary + 8 graded items
param=paramBG
# one obs per 500 random theta-phi
resg <- gendata_gIRT( 1, param, thdist="NORMAL", phdist="GBETA", compress=1
                      , npoint=500, phmin=0, phmax=2, paramab=c(1,4) )
Uc2=as.data.frame( resg$U )
thetaphi_ORG2=resg$thetaphi

# paramter estimation
res2=guIRT( Uc=Uc2, ncat=param$ncat, type=param$type
            , npointth=21, npointph=5, phmin=0, phmax=2
            , paramab=c(1,4), print=2 )

Print( cor( thetaphi_ORG2,res2$EAP ),
       param[,4:7]-res2$param[,4:7] )
plot( res2$EAP[,1], res2$EAP[,2])
dummy=freqdist1( res2$EAP[,1], npoints=101, plot=1 )
dummy=freqdist1( res2$EAP[,2], npoints=101, plot=1 )


[Package lazy.girt version 0.1.3 Index]