ordinal_reg {lazy.irt}R Documentation

Oridinal Regression

Description

This program regresses R on x where R is the length(x) x ncat frequency matrix and x is the univariate regressor vector.
Japanese help file: (ordinal_reg_JPH)

Usage

ordinal_reg(
  R,
  x,
  type = "P",
  param = NULL,
  maxiter = 100,
  eps = 1e-08,
  epsd = 1e-05,
  smallP = 0,
  DinP = 1,
  minp1 = 0.01,
  maxabsparam = 20,
  print = 1
)

Arguments

R

A matrix consisting of frequency of criterion variable: lenght(x) x ncat
R[,1] = Frequency of the zero-th category at x, R[,2] = Frequency of the first category at x, up to R[,ncat]

x

A vector or matrix of unidimensional regressor variable

type

Item type "B", "B3", "G", "P", "PN", "N"

param

A data frame containing the initial value of parameters, or NULL

maxiter

Max # of iterations

eps

Criterion for convergence in llh

epsd

Criterion for convergence in absolute value of parameter value

smallP

Smallest value of probability

DinP

= 0 to omit 1.7

minp1

Min value of the slope parameter for type != "N" items.

maxabsparam

Max value of parameters

print

= 0 to surpress output

Details

Let R be n x ncat matrix, and x, n x 1.
This function maximizes the following log likelihood w.r.t. item parameters param.
llh = \sum_{i=1}^{n} \sum_{k=1}^{ncat}R[i,k] log( P_k(x[i]|param)
where P_k(x[i]|param) is the item response function defined by type argument and param is its item parameters.
When P_k is 3PLM, c parameters will be transformed to y=logit(c) and llh will be maximized w.r.t. y.
Note that
d llh / d y = d llh / d c \times c(1-c),
where d logistic(y) / d y = c(1-c)

Value

A list of:
param Parameter data frame
llh Maximized log likelihood
P Probability at x
x input
g gradient
R input
maxag Maximum of absolute gradient values

Examples

# binary data
set.seed(1701)
theta=seq(-4,4,length.out=51)
resg=gendataIRT( 500, paramS1[1,], theta=theta, thdist="NORMAL", thd=NULL
               , thmean=0, thstd=1, compress=0 )
testdata=as.matrix( resg$U )

# 3PLM
res=ordinal_reg( testdata, theta, type="B3", param=NULL, print=1 )
# 2PLM
res=ordinal_reg( testdata, theta, type="B", param=NULL, print=1 )
res=ordinal_reg( testdata, theta, type="P", param=NULL, print=1 )
# 2PLM with nonzero c parameter
initp=paramS1[2,]; initp$type="B"
res=ordinal_reg( testdata, theta, type="B", param=initp, print=1 )


# polytomous data
set.seed(1701)
theta=seq(-4,4,length.out=51)
resg=gendataIRT( 500, paramS1[3,], theta=theta, thdist="NORMAL", thd=NULL
                 , thmean=0, thstd=1, compress=0 )
testdata=as.matrix( resg$U )

# graded response model
res=ordinal_reg( testdata, theta, type="G", param=NULL, print=1 )
# partial credit model
res=ordinal_reg( testdata, theta, type="P", param=NULL, print=1 )
res=ordinal_reg( testdata, theta, type="PN", param=NULL, print=1 )



[Package lazy.irt version 0.1.6 ]