Hi Manolo,
Great to hear from you :). You were one of the first who actually got
to see the package prior to the CRAN release, so I'm glad to hear that
you are liking the new features. Indeed it has come a long way.
Just so that we are working on the same code base, I rewrote your code
to work better with the current CRAN/dev version, which supports
better syntax for constraints and also created a workable dataset.
####
library(mirt)
set.seed(12345)
d <- matrix(c(rep(-2, 5), rep(-1, 5), rep(-.5, 5), rep(.5, 5), rep(1,
5), rep(2, 5)))
a <- matrix(rlnorm(30, .2, .2))
data <- simdata(a, d, N=2000, itemtype = 'dich')
head(data)
model <- mirt.model('theta = 1-30
CONSTRAIN = (1-5, d), (6-10, d), (11-15, d),
(16-20, d), (21-25, d), (26-30, d)')
mod.1 <- mirt(data, model=1) #unconstrained model
mod.2 <- mirt(data, model=model) #constrained
anova(mod.1, mod.2) #ns, models are basically equivalent (give the
same likelihood, or in better terms 'are equally likely')
coef(mod.2) #shows me that the 'd' parameters have been constrained as requested
coef(mod.2, IRTpars=T) #shows me that there are all different 'b'
parameters within subsets, albeit different from coef(mod.1,
IRTpars=T)
####
The reason that constraining 'b' versus 'd' gives different results is
that when constraining the 'd' parameters (as mirt does) has no effect
on the item slope parameter a1. In the traditional IRT metric, where
logit(P) = a(θ - b) = aθ - ab = aθ + d, you can see that if you
constrain the 'd' parameter, which is just an intercept, then the a
parameter has no effect since it is an independent term.
However, if you constrain the 'b' parameter only, 'a' continues to
have an effect in the model since 'b' is also multiplied by 'a'. In a
sense, 'a' and 'b' are correlated in parameter space in the original
IRT model, but not so in the parametrization adopted by mirt (the
so-called slope intercept form). Therefore, if you are trying to model
the items to have equal difficulties in the original IRT
parametrizations you are actually simultaneously affecting the 'a'
parameters....which might not be something you want!
The only way that the two parametrization match up is when the slopes
for those respective item blocks are also constrained to be equal.
Hope that helps.
Phil
> --
> You received this message because you are subscribed to the Google Groups
> "mirt-package" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
mirt-package...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.