est_thetaphi {lazy.girt}R Documentation

Estimation of Theta and Phi

Description

Estimation of Theta and Phi

Usage

est_thetaphi(Uc = NULL, U = NULL, param = NULL, method = "EAP",
  thetaphi = NULL, npoint = NULL, theta = NULL, npointth = 21,
  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), print = 0,
  plot = 0)

Arguments

Uc

The compressed item response data.

U

The uncompressed item response data.

param

The parameter data frame.

method

= "EAP", "MAP" or "ML" or combinations of these.

thetaphi

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

npointth

# of discrete points for theta.

thmin

Minimum value of discrete thata value.

thmax

Maximum value of discrete thata value.

npointph

# of discrete points for phi.

phmin

Minimum value of discrete phi value.

phmax

Maximum value of discrete phi value.

thdist

theta distribution "NORMAL" or "UNIFORM"

thmean

The prior mean of normal theta distribution.

phdist

phi distribution "GBETA"

paramab

The prior param for the phi distribution.

print

= 1 to print the result.

thphd

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

thsd

The prior standard deviation of normal theta distribution.

Details

The core part of EAP is as follows:

  ULP=U
  eULP=exp(ULP)*matrix(1,nrow(ULP))
  H=eULP/rowSums(eULP)
  thphhat=H

where logP is the log of irf, U is the un-compressed item response, and thphd is the normalized prior theta-phi pdf.
The second line calculates product over (jk) of P_ijk(theta)^U_ijk times the prior pdf of theta-phi, which is proportional to the post dist.
The third line normalizes the above to obtain the proper post dist.
The fourth line calculates the posterior mean.

Value

A list of
thphhat Estimated theta valuesr
thetaphi Theta-phi grid values used
thphd Theta-phi disrtibution for EAP
method
npoints # of grid points

Examples


# all possible item response patterns of a five item test
param=param_EQS5
Uc=Uc_5

paramab=c(1,2)
resthph=est_thetaphi( Uc=Uc, param=param, print=1, plot=1
                     , method=c("MAP","ML"), npointth=11
                     , phmin=0, phmax=3, paramab=paramab, npointph=11 )

# 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 )

# estimate theta and phi
resthph=est_thetaphi( Uc=Uc1, param=res1$param, print=1,
                      , method="EAP", npointth=11
                      , phmin=0, phmax=3, paramab=c(1,2), npointph=11 )
plot( resthph$thphhat )
Print( cor( thetaphi_ORG1, resthph$thphhat ) )




[Package lazy.girt version 0.1.3 Index]