uLRT {lazy.irt}R Documentation

Item Parameter Estimation of Unidimensional LRT

Description

Marginal likelihood will be maximized by the EM algorithm using ordinal_reg funcion and smn function in the M-step.

Usage

uLRT(
  Uc,
  U = NULL,
  groupvar = NULL,
  idvar = NULL,
  ncat = NULL,
  type = NULL,
  itemname = NULL,
  nclass = 5,
  V = NULL,
  fixeditems = NULL,
  baseform = 1,
  monotone = 0,
  rho = NULL,
  estrho = 0,
  alpha = rep(1, nclass),
  vmin = 1e-04,
  vmax = 1 - vmin,
  maxiter = 200,
  eps = 1e-07,
  epsd = 1e-06,
  maxiter2 = 1,
  eps2 = 0,
  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 fNULL.

type

nitems x 1 vector of item types consisting of: "Bn" | "G" | "PN" | "P"
If NULL, P will be used.
*** Currently, polytomous items are not allowed.

itemname

nitems x 1 vector of item names or NULL.

nclass

# of classes

V

npoitns x sum(ncat) initial value 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.

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
*** Currently, this option is not available.

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.

monotone

= 1 to enforce monotonicity

rho

initial value of probability vector of each latent class.

estrho

= 1 to estimate multigroup theta means

alpha

= vector of Dirichle parameters of length nclass
or a number A to set alpha=rep(A,nclass)
or a negative number -A to set alpha=A*normal pdf

vmin

minimum value of V

vmax

maximum value of V

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

Details

*** Currently, polytomous items are not allowed. ******
*** Currently, multi-group analysis is not available.

Uc is the compressed data if it is n x nitems.
U is the uncompressed data if it is n x sum(ncat).

When U, instead of Uc, is given:
Item names come from itemname or paste("Q",1:nitems,sep="").
ncat must be given.

When Uc is given:
Item name comes from colnames(Uc) or itemname.
ncat can be calculated from Uc.


Note on the iSQUAREM:
Try always=1 with maxalpha=-1 or less first.
Changing to reset1=1 and reset2=2 or increasing nSQUAREM may help.
If it seems not working, use always=0 with maxalpha=1 or less.
Changing to reset1=1 and reset2=2 may help.
If all of the above fail, be patient and use SQUAREM=0.

Value

A list of: V Estimated Item Parameters in a data frame
rho Class distribution
converged = 1 if converged, = 0 otherwise.
lmlh Log Marginal LIkelihood maximized
iter_hist A list of iteration history
H Posterior distribution of theta given U.
id Id variable

References

Varadhan, R. and Roland, C.(2007) Simple and Globally Convergent Methods for Accelerating the Convergence of Any EM Algorithm. Scandinavian Journal of Statistics, Vol. 35: 335-353.
Shojima, K. (2008a) Neural test theory. In K. Shigemasu, A. Okada, T. Imaizumi, & T. Hoshino (Eds.) New trends in psychometrics. Universal Academy Press, Inc

Examples

#
#### In the following examples, maxiter is set to 20 which is
#### not large enough to obtain convergence.
####
#
#
#
set.seed(1701)

param=paramB1[c(1:3,7:9,13:15),]
thmin=-2; thmax=2; npoint=5
N=1000

# discrete theta
# theta0=seq(thmin,thmax,length=npoint)
theta0=c(-2, -1, 0, 2, 3)
theta=unlist(lapply( theta0, rep, round(N/npoint) ))
res2 <- gendataIRT( 1, paramB1, theta=theta, compress=1 )
Uc=as.data.frame(res2$U)
ncat=res2$ncat
type=res2$type

nclass=5
res1 <- uLRT( Uc, nclass=nclass, estrho=1, monotone=1, alpha=20
, maxiter=20, plot=1, print=1 )

# normal theta
Uc2 <- gendataIRT( 1, paramB1, npoints=N, thdist="rnorm", compress=1 )$U
Uc2 <- as.data.frame(Uc2)

nclass=5
res1 <- uLRT( Uc2, nclass=nclass, estrho=1, monotone=1
, maxiter=20, plot=1, print=1 )


[Package lazy.irt version 0.1.6 ]