[R-sig-ME] IRT: discrimination parameters from LMER?
Doran, Harold
HDoran at air.org
Mon Nov 8 19:05:58 CET 2010
Paul,
Just a quick example of what I meant if you want to compare item parameters between lmer and rasch with discrimination estimated at some value other than 1. I figured I might as well make this thread more replicable.
Here is some code to simulate the data.
Nitems <- 20
Nperson <- 500
set.seed(12345)
dat <- simRasch(Nperson, Nitems)
itemDat <- dat$data
### Fit data using rasch in LTM
fm1 <- rasch(itemDat)
### Fit using lmer
itemDat$id <- 1:nrow(itemDat)
### reshape into long format
testScores <- reshape(itemDat, idvar='id', varying=list(names(itemDat)[1:Nitems]), v.names=c('answer'), timevar='question', direction='long')
# Treat items as fixed but students as random
fm2 <- lmer(answer ~ factor(question) - 1 + (1|id), testScores, family = binomial(link='logit'))
Now, if you do:
> coef(fm1)
> fixef(fm2)
The estimates are different. I won't paste all the output here since the code is replicable and the seed is set so we can compare output. Now, the discrimination value from rasch in this case is .949 and the standard deviation of the random effects from lmer is .946. Now, the log-likelihood under rasch and lmer is -4630.15799618799 and -4631.25819268, respectively. So, the sd and the log-like are pretty much the same between the different functions, so good so far. But, the item difficulties appear different. Why is this?
If you think about the parameterization of the rasch model, you have an "a" parameter, which is the slope of the item. Under lmer, that value is fixed at 1 for all items. But, for rasch, it is estimated (the value is .949) and it is common across all items.
So now, if you want to compare the difficulties between rasch and lmer when the discrimination is not 1 under rasch, then you need to do:
> coef(fm1)[,1] * coef(fm1)[,2]
V1 V2 V3 V4 V5 V6 V7
-2.4363375076723894 2.1282095647448513 -3.2456020170777404 -0.9922074612193649 1.0940596551348656 -1.4747653022333751 -1.9674236315390756
V8 V9 V10 V11 V12 V13 V14
1.1286690341041918 3.0183007620878102 2.7669665964796186 -0.5520550496701296 2.2850817917913258 0.6125781984255096 -0.8937278122026954
V15 V16 V17 V18 V19 V20
1.7286473472431816 0.0286736514649762 -2.7387309033941731 1.2960560094822793 -0.6529545363519687 1.3839487252561851
Now if we look at the lmer difficulties we have
> fixef(fm2)
factor(question)1 factor(question)2 factor(question)3 factor(question)4 factor(question)5 factor(question)6 factor(question)7
2.4361348266711036 -2.1291740694356793 3.2416948820925300 0.9945299229893042 -1.0961119907031844 1.4771362900874057 1.9688762349930169
factor(question)8 factor(question)9 factor(question)10 factor(question)11 factor(question)12 factor(question)13 factor(question)14
-1.1307455947353959 -3.0161274136566423 -2.7657709971218583 0.5536329523565644 -2.2855834341023469 -0.6139641860890157 0.8959339499969335
factor(question)15 factor(question)16 factor(question)17 factor(question)18 factor(question)19 factor(question)20
-1.7304539905559007 -0.0286143300422378 2.7371985048319152 -1.2981830712160072 0.6547480328455485 -1.3866471195258758
So, we can see that lmer and rasch generate the same estimates of all parameters. Is this helpful?
> -----Original Message-----
> From: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-
> bounces at r-project.org] On Behalf Of Doran, Harold
> Sent: Monday, November 08, 2010 12:39 PM
> To: Paul Johnson
> Cc: R-SIG-Mixed-Models at r-project.org
> Subject: Re: [R-sig-ME] IRT: discrimination parameters from LMER?
>
> I can't speak to the error below, perhaps the package author/maintainer can do
> so. I'm not sure I follow this last thread exactly. But, here is what you
> should be seeing, if not I too think there is an issue.
>
> 1) When you use lmer to fit the rasch model, you get b-parameters for the item
> (difficulties) and a population distribution that is N(0, s^2)
> 2) When you use the rasch function in ltm and the discrimination is not set at
> 1, then the items have a common slope. This common slope should be equivalent
> to s (the standard deviation from lmer). The parameter estimates will differ
> because they are identified differently. I think if you want to compare the
> difficulties from ltm to lmer then you need b/s where b is the difficulty of
> the item.
>
> Dimitris, does rasch use D = 1 or 1.7 when the discrimination is not 1?
More information about the R-sig-mixed-models
mailing list