# The gist

IRT is a latent variable model where the outcome variable is probability of a particular response on, e.g., test items. IRT is often used to model ability whilst controlling for differential item functioning. For instance it may be used to model the probability of getting the correct answer in an item as a function of item difficulty and person ability. There are also polytomous versions for predicting responses on, e.g., a Likert scale. It can also be used to diagnose problems with items, for instance allowing the discovery of a supposedly easy item in fact being too hard, and so on.

# Methods for fitting

## ltm package

The nice thing about the ltm package is that is gives you cross-tabulated descriptives which are useful to screen for the plausibility of this model.

```
library(ltm)
data(LSAT)
descript(LSAT)
fit1 <- rasch(LSAT, constraint = cbind(length(LSAT) + 1, 1))
summary(fit1)
# coefficients and conditional probabilities
coef(fit1, prob = TRUE, order = TRUE)
# Goodness-of-Fit using Bootstrap
GoF.rasch(fit1, B = 199)
# Goodness-of-Fit in the margins
margins(fit1)
margins(fit1, type = "three-way", nprint = 2)
```

Here's an example of the 3-parameter model, and a picture of the Item Characteristic Curves:

```
> M2 = tpm(LSAT, type = "latent", max.guessing = 1)
> M2
Call:
tpm(data = LSAT, type = "latent", max.guessing = 1)
Coefficients:
Gussng Dffclt Dscrmn
Item 1 0.088 -3.292 0.809
Item 2 0.043 -1.466 0.615
Item 3 0.301 0.289 27.580
Item 4 0.140 -1.776 0.588
Item 5 0.043 -3.547 0.553
Log.Lik: -2469
> plot(M2)
```

See this paper by Dimitris Rizopoulos for more info.

## lme4 package

You can also use the lme4 package (more info over here) to fit multilevel Rasch models with a dichotomous response (the Rasch model is just multilevel logistic regression). See Estimating the Multilevel Rasch Model: With the lme4 Package by Harold Doran, Douglas Bates, Paul Bliese, and Maritza Dowling. See p. 14 for how to extract item parameters and subject ability estimates.

# References

- Hambleton, R. K., Swaminathan, H., & Rogers, H. J. (1991). Fundamentals of Item Response Theory. Newbury Park, CA: Sage Press.