est_theta {lazy.irt} | R Documentation |
Estimation of Theta
est_theta(
Uc = NULL,
U = NULL,
param = NULL,
method = "EAP",
min_theta = -7,
max_theta = 7,
theta = NULL,
thd = NULL,
thdist = "NORMAL",
thmin = -4,
thmax = 4,
npoints = 21,
thmean = 0,
thstd = 1,
print = 0,
plot = 0
)
Uc |
The compressed item response data. |
U |
The uncompressed item response data. |
param |
The parameter data frame. |
method |
= "EAP", "MAP" or "ML" |
min_theta |
Minimum value of theta for method="MLE" or "MAP". |
max_theta |
Maximum value of theta for method="MLE" or "MAP". |
theta |
Discrete theta values. |
thd |
pdf of theta normalized to sum to unity. |
thdist |
= "NORMAL" or "UNIFORM" |
thmin |
Minimum value of discrete thata value. |
thmax |
Maximum value of discrete thata value. |
npoints |
# of discrete points for theta. |
thmean |
The prior mean of normal theta distribution. |
thstd |
The prior standard deviation of normal theta distribution. |
print |
= 2 to print the result. |
plot |
= 1 to show the histogram of theta. |
The core part of EAP is as follows:
ULP=U%*%t(logP) eULP=exp(ULP)*matrix(1,nrow(ULP))%*%t(thd) rseULP=rowSums(eULP) H=eULP/rseULP thetahat=H%*%theta
where logP
is the log of irf matrix (ntheta x sum(ncat)),
U
is the un-compressed item response matrix( N x sum(ncat)),
and thd
is the normalized prior theta pdf vector (ntheta).
Therefore, H
is N x ntheta matrix of normalized posterior pdf
First two lines calculate the unnormalized joint pdf of U and theta.
The next line line normalizes the posterior distribution of theta
given U
stored in H
matrix.
The last line calculates the posterior mean.
When thd
is a scalar, the locally uniform theta distribution
is used.
method = "ML" or method ="MAP" use native optimize function and
may be very slow.
When method is EAP or ML, the posterior standard deviation of theta or the standard error of theta will be calculated.
A list of
thetahat Estimated theta values
thetastd Standard Deviation of the Estimated theta values
theta Theta values for EAP
thd Theta disrtibution for EAP
method
thdist
thmin and thmax
npoints
thmean
thstd
min_theta and max_theta
# compressed item response at equally spaced 21 theta points in [-3,3]
set.seed(1701)
resg <- gendataIRT( 1, paramS3, npoints=21, compress=1 )
Uc <- resg$U
theta <- resg$theta
thetaEAP <- est_theta( Uc, param=paramS3, print=1 )$thetahat
thetaMAP <- est_theta( Uc, param=paramS3, print=1, method="MAP" )$thetahat
thetaML <- est_theta( Uc, param=paramS3, print=1, method="ML" )$thetahat
cor( cbind(theta,thetaEAP,thetaMAP,thetaML) )
plot(theta, thetaEAP)
# uncompressed item response at equally spaced 101 theta points in [-3,3]
set.seed(1701)
resg <- gendataIRT( 1, paramS3, npoints=101, compress=0 )
U <- resg$U
theta <- resg$theta
res <- est_theta( U=U, param=paramS3, print=1 )
plot(theta,res$thetahat)
# 100 normally distriuted theta
set.seed(1701)
resg <- gendataIRT( 1, paramS3, npoints=100, compress=1, thdist="rnorm" )
Uc <- resg$U
theta <- resg$theta
res <- est_theta( Uc=Uc, param=paramS3, print=1 )
plot(theta,res$thetahat)