I have 3PL model parameters (guessing, difficulty and discrimination item parameters).
Is there any function with which I can estimate individual ability from item response data?
I tried the function factor.score
in the package ltm, but it seems to require the whole data from which the parameters were estimated, which I don't have.
-
2$\begingroup$ You say "but it seems to require the whole data from which the parameters were estimated, which I don't have". Do you have the individual responses to the items? $\endgroup$– MomoCommented Aug 11, 2012 at 10:15
-
$\begingroup$ Yes, I got responses of a handful of testees to estimate the latent abilities. And I have estimates for model parameters from the previous research and I want to use them to estimate the latent abilities. $\endgroup$– KH KimCommented Aug 11, 2012 at 11:04
2 Answers
I can't find a way to do this in the ltm
package, though it's relatively straightforward if you are willing to use the mirt
package.
First, write out some arbitrary matrix or data frame consisting of possible but random response patterns. You can include the actual response patterns you are interested in as well for later use.
dat <- matrix(sample(c(0,1), 10000, TRUE), ncol = 5)
colnames(dat) <- paste0('item', 1:5)
Use this as the data input and to mirt()
and give the option pars = 'values'
to return a data frame containing parameter names, numbers, starting values, etc. Edit this object to contain the values you want for the intercepts, slopes, or whatever else, and set all the estimation logical to FALSE
. This will cause the model to instantly converge with the parameters that you want.
library(mirt)
sv <- mirt(dat, 1, itemtype = '3PL', pars = 'values')
#custom discrimination, easiness, and guessing values
sv$value[sv$name == 'a1'] <- c(1,.9,.8,1,1.1)
sv$value[sv$name == 'd'] <- c(-1,0,1.5,-1.5,0)
sv$value[sv$name == 'g'] <- c(.2,.15,.17,.19,.15)
#set the parameters as fixed
sv$est <- FALSE
Finally, (arbitrarily) estimate this model by using pars = sv
, and use the returned object to calculate the factor scores. If you included the response patterns you are interested in then using fscores()
directly work, otherwise use the response.pattern
option to estimate the patterns directly.
mod <- mirt(dat, 1, pars = sv)
fscores(mod)
#more interested in pattern: 0, 1, 1, 0, 1
fscores(mod, response.pattern = c(0,1,1,0,1))
Hope that's helpful.
EDIT: Since I posted this answer a while back, the mirtCAT
package was developed as an extension to mirt
and contains a helper function called generate.mirt_object()
for setting up a suitable mirt
model with known coefficients.
Here's how that can be done using the parameters above.
library(mirtCAT)
pars <- data.frame(a1 = c(1,.9,.8,1,1.1),
d = c(-1,0,1.5,-1.5,0),
g = c(.2,.15,.17,.19,.15))
mod <- generate.mirt_object(pars, itemtype = '3PL')
# trait scores for pattern: 0, 1, 1, 0, 1
fscores(mod, response.pattern = c(0,1,1,0,1))
I think the wrapper version is less error prone, and certainly nicer to look at and understand.
-
$\begingroup$ Does
mirt()
result equal toltm()
?I found a problem that results are different when calculate same model by different package.stats.stackexchange.com/questions/401968/… $\endgroup$ Commented Apr 9, 2019 at 8:05 -
$\begingroup$ @kittygirl they use the same estimators, so in theory they should be identical. $\endgroup$ Commented Apr 9, 2019 at 13:26
Try thetaEst from catR.
From the manual: This command returns the ability estimate for a given response pattern and a given matrix of item parameters.