< a quantity that can be divided into another a whole number of time />

Fitting Rasch model with R lme4

March 12, 2011

The last issue of the Journal of Statistical Software features an article on The Estimation of Item Response Models with the lmer function from the lme4 Package in R, by De Boeck and coll. As the title suggests, this article is about fitting IRT models with a mixed-effects model approach.

This is an interesting article because I’ve been working on that some four years ago now. The code I produced at that time was based on the De Boeck’s book: Paul De Boeck & Mark Wilson, Explanatory Item Response Models: A Generalized Linear and Nonlinear Approach (Springer, 2004).

but, due to lack of time, was never pursued to its end (maybe like most of tutorials I wrote actually). Also, I started writing a short note on fitting Rasch models in R (using classical CML- or MML-based approaches, JAGS, Poisson model, etc.). I will link to it at a later time.

Back to De Boeck’s article. It all starts with the idea of applying an GLMM to the matrix of items responses, with additional indicators for item- or subject-specific cofactors. Using an GLMM has already been described by Doug Bates in an older issue, Doran, H, Bates, D, Bliese, P, and Downling, M. (2007). Estimating the Multilevel Rasch Model: With the lme4 Package, JSS 20(2), and also in some of his talk at UseR! or elsewhere, see e.g. the slides section on RForge.

The Rasch model (RM) takes the form

$$ \eta_{pi}=\theta_pX_{i0}+\sum_{i=1}^K\beta_iX_{ik} $$

where i and p are indexes for items and persons, and X is the design matrix where $X_{ik} = 1$, if $i = k$ ($i=1, \dots, K)$, and $X_{i0} = 1$ for all items. The distribution of ability is gaussian with SD $σ_\theta$. In a simplified form, we find the well-known formulation of the RM as denoting an interactive effect of subject’s ability and item difficulty on the logit scale:

$$ \eta_{pi}=\theta_p+\beta_i $$

Of course, we can use a different link function, such as the probit if we want the so-called normal ogive model.

A general formula interface for such a model under lme4 reads

lmer(resp ~ -1 + it + (1|id), family=binomial("logit"))

where everything that follows the ~ operator stands for the linear component described in the first equation above.

More interestingly, De Boeck’s et al. then give detailed explanations on how to fit more customized IRT models.

Here is a short memo of common R notation for the main models used in psychometric research.

In conclusion, this article might be very useful for extending the class of IRT models available under R. With the recent development of packages dedicated to structural equation modeling, like lavaan or OpenMx, R will probably become the de facto standard in IRT modeling.

psychometrics rstats

See Also

» Psychoco 2011 » Applications of Latent Trait and Latent Class Models in the Social Sciences » Visualizing What Random Forests Really Do » The 6th CARME conference » A bunch of paper on multivariate data analysis