I have a paper which has utilised IRT on a revised scale of paranoia (R-GPTS). The scale comprises 10 items and there are 5 response options:
In the above highlighted responses, this scores 3 / 40. The item parameters are for the persecution subscale:
I am trying to get an ability estimate but I can tell that I'm missing something.
This is the IRT model the authors used:
A two-parameter graded response model (GRM) was fitted to the items (Samejima, 1969).
These are the packages they used:
All analyses were conducted in R, version 3.5 (R Core Team, 2013). Packages used included ‘psych’ >(Revelle, 2018), ‘mirt’ (Chalmers, 2012), ‘pROC’ (Robin et al., 2011), and ‘optimumCutpoints’ (Lopez-Raton et al., 2014).
In Estimating ability using IRT when the model parameters are known there is a response by philchalmers who wrote mirt
, the very package used in the study. Taking his code I have come up with the following:
#generates set of random response patterns for 10 items
dat <- matrix(sample(c(0,1,2,3,4), 20000, TRUE), ncol=10)
colnames(dat)<-paste0('Item', 1:10)
library(mirt)
#2PL polytomous or graded response model from Samejima 1969
sv<-mirt(dat, 1, itemtype= 'graded', pars = 'values')
#item parameters from Freeman et al. 2019
sv$value[sv$name == 'a'] <- c(2.95,2.87,2.43,3.68,4.25,3.15,4.45,3.99,3.54,3.59)
sv$value[sv$name == 'b1'] <- c(0.20,0.75,−0.10,0.79,0.78,0.65,0.77,0.40,0.35,0.63)
sv$value[sv$name == 'b2'] <- c(0.71,1.14,0.46,1.08,1.08,1.02,1.07,0.79,0.79,0.98)
sv$value[sv$name == 'b3'] <- c(1.28,1.58,1.08,1.43,1.39,1.49,1.40,1.21,1.24,1.35)
sv$value[sv$name == 'b4'] <- c(1.70,2.02,1.61,1.75,1.68,1.89,1.75,1.59,1.63,1.69)
#set item parameters as fixed
sv$est<-FALSE
mod<-mirt(dat, 1, pars=sv)
Then, I use fscores()
for ability estimate:
# response pattern #1
fscores(mod,response.pattern=c(1,0,1,0,0,0,0,0,1,0))
# response #2
fscores(mod,response.pattern=c(4,0,4,4,3,3,4,4,4,4))
# response #3
fscores(mod,response.pattern=c(4,0,4,4,4,4,4,4,4,4))
The output I get is as follows:
> # response pattern #1
> fscores(mod,response.pattern=c(1,0,1,0,0,0,0,0,1,0))
Item1 Item2 Item3 Item4 Item5 Item6 Item7 Item8 Item9 Item10 F1 SE_F1
[1,] 1 0 1 0 0 0 0 0 1 0 -2.078653 0.5700438
>
> # response #2
> fscores(mod,response.pattern=c(4,0,4,4,3,3,4,4,4,4))
Item1 Item2 Item3 Item4 Item5 Item6 Item7 Item8 Item9 Item10 F1 SE_F1
[1,] 4 0 4 4 3 3 4 4 4 4 1.856076 0.5946364
>
> # response #3
> fscores(mod,response.pattern=c(4,0,4,4,4,4,4,4,4,4))
Item1 Item2 Item3 Item4 Item5 Item6 Item7 Item8 Item9 Item10 F1 SE_F1
[1,] 4 0 4 4 4 4 4 4 4 4 2.352869 0.63262
Now, although the #2 and #3 look about right, the whole problem is that I really don't think #1 should have $\theta$ = -2.0. In their study the authors report a mean score of about 2.3 I should be getting closer to $\theta$ = 0.
However, the strangest thing is that in abovementioned post there is a suggestion to use catR
. Using this package I'm getting ability estimates that I think are correct.
Here is my code:
library(catR)
pars<-data.frame(a=c(2.95,2.87,2.43,3.68,4.25,3.15,4.45,3.99,3.54,3.59),
b1=c(0.20,0.75,−0.10,0.79,0.78,0.65,0.77,0.40,0.35,0.63),
b2=c(0.71,1.14,0.46,1.08,1.08,1.02,1.07,0.79,0.79,0.98),
b3=c(1.28,1.58,1.08,1.43,1.39,1.49,1.40,1.21,1.24,1.35),
b4=c(1.70,2.02,1.61,1.75,1.68,1.89,1.75,1.59,1.63,1.69))
#item parameters from Freeman et al. 2019
pars
#estimate for response pattern #1
thetaEst(pars, c(1,0,1,0,0,0,0,0,1,0), model = "GRM", method = "EAP")
#estimate for response pattern #2
thetaEst(pars, c(4,0,4,4,3,3,4,4,4,4), model = "GRM", method = "EAP")
#estimate for response pattern #3
thetaEst(pars, c(4,0,4,4,4,4,4,4,4,4), model = "GRM", method = "EAP")
These are the estimates I'm getting:
> #estimate for response pattern #1
> thetaEst(pars, c(1,0,1,0,0,0,0,0,1,0), model = "GRM", method = "EAP")
[1] 0.08901428
>
> #estimate for response pattern #2
> thetaEst(pars, c(4,0,4,4,3,3,4,4,4,4), model = "GRM", method = "EAP")
[1] 1.907622
>
> #estimate for response pattern #3
> thetaEst(pars, c(4,0,4,4,4,4,4,4,4,4), model = "GRM", method = "EAP")
[1] 2.253911
I'm getting $\theta$ = 0.09 which looks about right to me.
So can anyone tell my what it is that I'm doing wrong with the original mirt code?
sv$value[sv$name == 'b1']
these lines shouldn't do anything, since there are nob
parameters used in the package (these look like classical difficulty parameters, while mirt uses intercepts throughout). Try usingcoef(mod, simplify=TRUE, IRTpars = TRUE)
to see what parameter mirt is using at the time of your factor score computations. $\endgroup$