The main purpose of the irtpp package is to estimate item parameters according to a IRT model, to begin the paremeter estimation for a test, use the function irtpp
library(IRTpp)
tst = simulateTest(model="3PL")
## Calibrate this test with a 2PL model.
est = irtpp(tst$test,"1PL")
Now est
holds the return of the estimation procedure
names(est)
## [1] "z" "iterations" "LL" "r" "f"
## [6] "theta" "weights" "prob_mat"
est$z
## $a
## [1] 1 1 1 1 1 1 1 1 1 1
##
## $b
## [1] 0.4228378 3.5734951 -0.1095724 -0.1000711 0.6134229 -1.3379907
## [7] 0.4424767 1.0190568 -0.5044763 0.1355186
##
## $c
## [1] 0 0 0 0 0 0 0 0 0 0
est$LL
## [1] 5370.869
in est$z
there is a named list of the IRT parameters calibrated for this test. It is also easy to visualize all the Item Caracteristic Curves (ICC) of the test, with the function test.plot
, this is a visual resume of the parameters.
test.plot(est$z)
Alternatively , irtpp
offers other options such as displaying loglikelihood based statistics , reading from files or changing the initial values of the estimation procedure (for advanced uses).
## Calibrating the same test under a 3PL model and displaying the AIC and BIC statistics
est = irtpp(tst$test,"3PL", loglikflag=T)
## [1] "Loglikelihood : NaN"
## [1] "AIC : NaN"
## [1] "BIC : NaN"
The item caracteristic curve of all the items of the test can be drawn to compare between IRT models.
test.plot(est$z)
Or for an specific item:
test.plot(est$z,2)
IRTpp package also supports estimating latent traits of individuals according to IRT methodologies. User the function individual.traits
to estimate the individual latent traits for a test.
zz = parameter.matrix(est$z,byrow = F)
th = individual.traits(model="3PL", itempars = zz,method = "EAP",dataset = tst$test, probability_matrix = est$prob_mat)
##The latent traits.
hist(th[,ncol(th)],breaks=40)