I want to do a multilevel IRT analysis considering unidimensional and multidimensional underlying ability. I have two data sets: student and school level data.
Student level data contains responses of about 80000 students to 45 questions and two covariates(e.g. s1 & s2). School level data contains information for 116 schools on eight variables (e.g. w1-w8).
I want to do a random intercept model with covraiates on both levels using one underlying factor and then two (additive model) underlying factors for item responses.
1) can I do this analysis in mirt?
2) if yes, would you please give me some sense of its syntax?
3) Do school level data need to be repeated for each student?
I think this is enough for this post.We can discuss more later.
Thanks,
Amin.
In a multilevel IRT considering our example, level1 and level2 covariates are regressed on estimated abilities as (in a random intercept model):
Ability= B0j +B1*s1+B2*s2 +e (level1 equation,j is cluster indicator)
B0j= G0 +G1*w1+G2*w2 +u0j (level2 equations. u is error)
B1= u1
B2= u2
Indeed I Want to implement this model in mirt in which abilities are estimated by mirt().So
1) I need to have a data frame containing s1,s2,w1,w2 and clust for covariates in a form like:
covdata<-data.frame(clust,s1,s2,w1.w2)
correct?
2) Will the covariates be regressed on estimated abilities?If no, on what will they be regressed?
3) Assuming that covariates are regressed to estimated abilities, a fixed and random formulas for a random intercept model witht level1 and level2 covariates can be like these:
fixed=~0+s1+s2+w1+w2 (I don't know what's the role of 0 in this formula)
random= ~1|clust (the same as 0 in previous formula about 1 in this one)
are those formulas correct?
4) can mixedmirt() give me variance components of the model?
5) For IRT model, all I need is to define the model using confmirt.model(), right?
Sorry for this much of questions, I'm not very familiar with R and just trying to implement my knowledge based on examples in mirt.
Thanks,
Amin.
1) you're right.with "Abilities" I meant for an empty model without covariates
2) I don't have any item design (and I'm not exactly sure what you mean by "item design") and just want to use 2PL model for analyzing data. Do I need to change fixed and random formulas as I'm not going to use Rasch model?
3) So using, say,
model<-confmirt.model(1,itemtype="2PL")
is enough for model specification in case of one(or two) dimensional 2PL IRT model?
Amin.
So, for instance for a two dimensional model it would be enough just to use:
model<-2
or do I need to specify a model like(e.g. for 10 items):
model<-confmirt.model()
f1=1-10 #as I don't know the underlying structure
f2=1-10 #as I don't know the underlying structure
COV=f1*f2
which one is correct?
I used "mlirt" package for analyzing PISA data but it's designed for unidimensional models.I'm goining to compare output of your package with mlirt to see how mirt works.I'll post the results here.
Amin.
Another thing,in the output of mixedmirt() for random effects, what are these:
[note: I ran this model
mixedmirt(data = y, covdata = cov, model = model, fixed = ~0 +items, random = ~1 | group, cl = cl) as a random intercept model without any covariate, is it correct?]
$Theta
F1
F1 4.91
$group
COV_group
COV_group 0.000123
and how can I find information about level1 (i.e. sigma) anf level2 (i.e. tau) variances? I use multilevel terminology.
Thanks,
Amin.
Hi Amin,
I just released that you can actually change the identification
yourself. Here's an example of fixing the slope parameter and freeing
the variance term:
####
library(mirt)
set.seed(1234)
N <- 750
a <- matrix(rlnorm(10,.3,1),10,1)
a[1] <- 1
d <- matrix(rnorm(10), 10)
Theta <- matrix(sort(rnorm(N)))
pseudoIQ <- Theta * 5 + 100 + rnorm(N, 0 , 5)
group <- factor(rep(c('G1','G2','G3'), each = N/3))
data <- simdata(a,d,N, itemtype = rep('dich',10), Theta=Theta)
covdata <- data.frame(group, pseudoIQ)
model <- 1
pars <- mixedmirt(data, covdata, model, fixed = ~ 0 + group + items,
itemtype = '2PL', pars = 'values')
pars$value[which(pars$name == 'a1')[1L]] <- 1
pars$est[which(pars$name == 'a1')[1L]] <- FALSE
pars$est[which(pars$name == 'COV_11')] <- TRUE
mod <- mixedmirt(data, covdata, model, fixed = ~ 0 + group + items,
itemtype = '2PL', pars = pars)
summary(mod)
coef(mod)
#normal way
mod2 <- mixedmirt(data, covdata, model, fixed = ~ 0 + group + items,
itemtype = '2PL')
summary(mod2)
coef(mod2)
####
So that should make life a little easier (hopefully). Cheers.
Phil
On Mon, Jul 22, 2013 at 8:28 PM, Phil Chalmers
<rphilip....@gmail.com> wrote:
> On Mon, Jul 22, 2013 at 8:24 PM, Amin Mousavi <stte...@gmail.com> wrote:
>> 1) That's right.I'm interested on the variances more that G00 but is there
>> anyway to let it be estimated in mixedmirt()?
>
> Currently, no, but I could probably add an option for it with a little
> work. The problem is how to track identifiablitiy for multidimensional
> models. Unidimensional is easy, just set the first slope equal to one
> and free the latent variance parameter. I might add this in the future
> but only for 1 factor models.
>
>>
>> 2)Are you saying that in mlirt some item parameters are fixed to 1 and 0 for
>> discriminant and difficulty parameters?
>> I estimates item parameters for all items and as far as I know and worked
>> with mlirt, it doesn't constrain item parameters.
>
> It must, the problem is exactly the same as estimating 2PL models. You
> either have to fix a slope to one in order to estimate the latent
> variance, or set an intercept to 0 to estimate the latent mean. It's
> probably either the first or last item, so check those closely.
>
> Phil
>
>
>>
>> Amin.
>>
>>
>> On Mon, Jul 22, 2013 at 6:16 PM, Phil Chalmers <rphilip....@gmail.com>
>> wrote:
>>>
>>> On Mon, Jul 22, 2013 at 8:03 PM, Amin Mousavi <stte...@gmail.com> wrote:
>>> > Phil,
>>> >
>>> > if I use ~ + 0 instead of ~ + 1 , there won't be any fixed effect for
>>> > empty
>>> > model.In other words, there won't be any estimate for G00. Using ~ + 1
>>> > will
>>> > assume a fixed intercept for each item and basically that -0.603 is the
>>> > 'd'
>>> > value for the fist item and consequently d valus for other items equals
>>> > -0.603+d* (i.e. d* is item's difficulty parameter when using ~ + 0)
>>> So far so good.
>>>
>>> > but in
>>> > my model G00 refers to the intercept of the estimated ability.
>>>
>>> mirt assumes this to be fixed @0, just like any other random effect
>>> (where u ~ N(0, sigma^2)). Random effects are naturally deviations
>>> about zero to which we are interested in their variances. mlirt
>>> probably estimates this by constraining some item slopes and
>>> intercepts to 1 and 0 respectively, allowing these hyper parameters to
>>> be estimated. I didn't like that identification format since it's much
>>> harder to work with mixed item types and polytomous items, so I opted
>>> to fix the mean to 0 and variance to 1 for models that require it. You
>>> really aren't 'estimating' these values though since they are just
>>> arbitrary parameterizations defined by the items that are constrained
>>> to d=0 and a1=1....you could always change the item used to constrain
>>> the model to get wildly different means and variances. I just avoid
>>> that entirely since it just seems like an artifact and the method I
>>> used will be the same regardless of the item ordering.
>>>
>>> > In mlirt package, simga^2 is the variance of e and tau is the variance
>>> > of u0
>>> > across groups. in mlirt package, like mixedmirt() I think, the dependent
>>> > variable is probability of correct answer or its logit but the package
>>> > returns person and group (or school) level variances as sigma^2 and tau
>>> > respectively.
>>>
>>> Yes, and again mlirt probably constrains item parameters for
>>> identification rather than setting sigma ~ N(0,1
>>>
>>> >
>>> > Put differently, the model in mlirt package should be seen as a
>>> > three-level
>>> > model in which items are nested within persons and persons are nested
>>> > within
>>> > groups. am right?if so, how can I implement this three-level model in
>>> > mixedmirt()?
>>>
>>> The format you've been trying is this already, that's how.
>>>
>>> >
>>> > It's becoming complicated!!
>>> >
>>> > Amin.
>>> >
>>> >
>>> > On Mon, Jul 22, 2013 at 4:13 PM, Phil Chalmers
>>> >> You received this message because you are subscribed to a topic in the
>>> >> Google Groups "mirt-package" group.
>>> >> To unsubscribe from this topic, visit
>>> >> https://groups.google.com/d/topic/mirt-package/gN0JeJVHoQA/unsubscribe.
>>> >> To unsubscribe from this group and all its topics, send an email to