ordinal_reg {lazy.irt} | R Documentation |
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)
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
)
R |
A matrix consisting of frequency of criterion variable:
lenght(x) x 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 |
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)
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
# 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 )