Extended Rasch Modeling: The eRm Package for the Application of IRT Models in R

Item response theory models (IRT) are increasingly becoming established in social science research, particularly in the analysis of performance or attitudinal data in psychology, education, medicine, marketing and other ﬁelds where testing is relevant. We propose the R package eRm (extended Rasch modeling) for computing Rasch models and several extensions. A main characteristic of some IRT models, the Rasch model being the most prominent, concerns the separation of two kinds of parameters, one that describes qualities of the subject under investigation, and the other relates to qualities of the situation under which the response of a subject is observed. Using conditional maximum likelihood (CML) estimation both types of parameters may be estimated independently from each other. IRT models are well suited to cope with dichotomous and polytomous responses, where the response categories may be unordered as well as ordered. The incorporation of linear structures allows for modeling the eﬀects of covariates and enables the analysis of repeated categorical measurements. The eRm package ﬁts the following models: the Rasch model, the rating scale model (RSM), and the partial credit model (PCM) as well as linear reparameterizations through covariate structures like the linear logistic test model (LLTM), the linear rating scale model (LRSM), and the linear partial credit model (LPCM). We use an unitary, eﬃcient CML approach to estimate the item parameters and their standard errors. Graphical and numeric tools for assessing goodness-of-ﬁt are provided.


Introduction
claimed in his article that "even though the Rasch model has been existing for such a long time, 95% of the current tests in psychology are still constructed by using methods from classical test theory" (p. 140). Basically, he quotes the following reasons why the Rasch model is being rarely used: The Rasch model in its original form (Rasch 1960), which was limited to dichotomous items, is arguably too restrictive for practical testing purposes. Thus, researchers should focus on extended Rasch models. In addition, Rost argues that there is a lack of user-friendly software for the computation of such models. Hence, there is a need for a comprehensive, user-friendly software routine. Corresponding recent discussions can be found in Kubinger (2005) and Borsboom (2006).
The focus of this article is on the following Rasch model extensions that can be computed by means of the eRm package: the linear logistic test model (Scheiblechner 1972), the rating scale model (Andrich 1978), the linear rating scale model (Fischer and Parzer 1991), the partial credit model (Masters 1982), and the linear partial credit model (Glas and Verhelst 1989;Fischer and Ponocny 1994). These models and their main characteristics are presented in Section 2.
Concerning parameter estimation, these models have an important feature in common: Separability of item and person parameters. This implies that the item parameters β can be estimated without estimating the person parameters achieved by conditioning the likelihood on the sufficient person raw score. This conditional maximum likelihood (CML) approach is described in Section 3.
Finally, in Section 4, the corresponding implementation in R (R Development Core Team 2006) is described by means of several examples. The eRm package uses a design matrix approach which allows to the user to impose repeated measurement designs as well as group contrasts. By combining these types of contrasts one allows that the item parameter may differ over time with respect to certain subgroups. At this point it is already noted that it is not possible to allow for group contrasts without repeated measurement points since this contradicts to Rasch's claim for subgroup invariance. Note that it is certainly possible to impose any number of time contrasts time without regarding group differences in order to examine longitudinal hypotheses only. However, to illustrate the flexibility of the eRm package some examples are given to show how suitable design matrices can be constructed.

Extended Rasch models 2.1. General expressions
Briefly after the first publication of the basic Rasch Model (Rasch 1960), the author worked on polytomous generalizations which can be found in Rasch (1961). Andersen (1995) derived the representations below which are based on Rasch's general expression for polytomous data. The data matrix is denoted as X with the persons in the rows and the items in the columns. In total there are v = 1, ..., n persons and i = 1, ..., k items. A single element in the data matrix X is indexed by x vi . Furthermore, each item I i has a certain number of response categories, denoted by h = 0, ..., m i . The corresponding probability of response h on item i can be derived in terms of the following two expressions (Andersen 1995): or Here, φ h are scoring functions for the item parameters, θ v are the uni-dimensional person parameters, and β i are the item parameters. In Equation 1, ω h corresponds to category parameters, whereas in Equation 2 β ih are the item-category parameters. The meaning of these parameters will be discussed in detail below. Within the framework of these two equations, numerous models have been suggested that retain the basic properties of the Rasch model so that CML estimation can be applied.

Representation of extended Rasch models
For the ordinary Rasch model for dichotomous items, Equation 1 reduces to The main assumptions, which hold as well for the generalizations presented in this paper, are: uni-dimensionality of the latent trait, sufficiency of the raw score, local independence, and parallel item characteristic curves (ICCs). Corresponding explanations can be found, e.g., in Fischer (1974) and mathematical derivations and proofs in Fischer (1995a).
For dichotomous items, Scheiblechner (1972) proposed the (even more restricted) linear logistic test model (LLTM), later formalized by Fischer (1973), by splitting up the item parameters into the linear combination Scheiblechner (1972) explained the dissolving process of items in a test for logics ("Mengenrechentest") by so-called "cognitive operations" η j such as negation, disjunction, conjunction, sequence, intermediate result, permutation, and material. Note that the weights w ij for item i and operation j have to be fixed a priori. Further elaborations about the cognitive operations can be found in Fischer (1974, p. 361ff.). Thus, from this perspective the LLTM is more parsimonous than the Rasch model.
with k item parameters β 1 , ..., β k and m + 1 category parameters ω 0 , ..., ω m . This parameterization causes a scoring of the response categories C h which is constant over the single items. Again, the item parameters can be split up in a linear combination as in Equation 4. This leads to the LRSM proposed by Fischer and Parzer (1991).
Finally, the PCM developed by Masters (1982) and its linear extension, the LPCM (Fischer and Ponocny 1994), are presented. The PCM assigns one parameter β ih to each I i × C h combination for h = 0, ..., m i . Thus, the constant scoring property must not hold over the items and in addition, the items can have different numbers of response categories denoted by m i . Therefore, the PCM can be regarded as a generalization of the RSM and the probability for a response of person v on category h (item i) is defined as It is obvious that (6) is a simplification of (2) in terms of φ h = h. As for the LLTM and the LRSM, the LPCM is defined by reparameterizing the item parameters of the basic model, i.e., At this point it is important to point out the model hierarchy of these six models ( Figure  1). This hierarchy is the base for a unified CML approach presented in the next section. It is outlined again that the linear extension models can be regarded either as generalizations or as more restrictive formulations pertaining to the underlying base model. The hierarchy for the basic model is straightforward: The RM allows only items with two categories, thus each item is represented by one parameter β i . The RSM allows for more than two (ordinal) categories each represented by a category parameter ω h . Due to identifiability issues, ω 0 and ω 1 are restricted to 0. Hence, the RM can be seen as a special case of the RSM whereas, the RSM in turn, is a special case of the PCM. The latter model assigns the parameter β ih to each I i × C h combination.
To conclude, the most general model is the LPCM. All other models can be considered as simplifications of Equation 6 combined with Equation 7. As a consequence, once an estimation procedure is established for the LPCM, this approach can be used for any of the remaining models. This is what we quote as unified CML approach. The corresponding likelihood equations follow in Section 3.

The concept of virtual items
When operating with longitudinal models, the main research question is whether an individual's test performance changes over time. The most intuitive way would be to look at the shift in ability θ v across time points. Such models are presented e.g. in Mislevy (1985), Glas (1992), and discussed by Hoijtink (1995).
Yet there exists another look onto time dependent changes, as presented in Fischer (1995b, p 158ff.): The person parameters are fixed over time and instead of them the item parameters change. The basic idea is that one item I i is presented at two different times to the same person S v is regarded as a pair of virtual items. Within the framework of extended Rasch models, any change in θ v occuring between the testing occasions can be described without loss of generality as a change of the item parameters, instead of describing change in terms of the person parameter. Thus, with only two measurement points, I i with the corresponding parameter β i generates two virtual items I r and I s with associated item parameters β * r and β * s . For the first measurement point β * r = β i , whereas for the second β * s = β i +τ . In this linear combination the β * -parameters are composed additively by means of the real item parameters β and the treatment effects τ . This concept extends to an arbitrary number of time points or testing occasions.
Correspondingly, for each measurement point t we have a vector of virtual item parameters β * (t) of length k. These are linear reparameterizations of the original β (t) , and thus the CML approach can be used for estimation. In general, for a simple LLTM with two measurement points the design matrix W is of the form as given in Table 1.
The parameter vector β * (1) represents the item parameters for the first test occasion, β * (2) the parameters for the second occasion. It might be of interest whether these vectors differ. The corresponding trend contrast is η k+1 . Due to this contrast, the number of original βparameters is doubled by introducing the 2k virtual item parameters. If we assume a constant shift for all item parameters, it is only necessary to estimate η = ( η 1 , ..., η k+1 ) where η k+1 gives the amount of shift. Since according to (4), the vector β * is just a linear combination of η.
As mentioned in the former section, when using models with linear extensions it is possible to impose group contrasts. By doing this, one allows that the item difficulties are different across subgroups. However, this is possible only for models with repeated measurements and virtual items since otherwise the introduction of a group contrast leads to overparameterization and the group effect cannot be estimated by using CML.
1 0 0 1 1 Table 1: A design matrix for an LLTM with two timepoints. Table 2 gives an example for a repeated measurement design where the effect of a treatment is to be evaluated by comparing item difficulties regarding a control and a treatment group. The number of virtual parameters is doubled compared to the model matrix given in Table  1.
Again, η k+1 is the parameter that refers to the time contrast, and η k+2 is a group effect within measurement point 2. More examples are given in Section 4 and further explanations can be found in Fischer (1995b), Fischer and Ponocny (1994), and in the software manual for the LPCM-Win program by Fischer and Ponocny-Seliger (1998).

The likelihood expressions
Generally, there are several approaches to estimate parameters in IRT models, see, e.g., Baker and Kim (2004). For Rasch models, the commonly used approaches are either conditional maximum likelihood (CML) or marginal maximum likelihood (MML) estimation which are asymptotically equivalent and provide consistent estimators (Pfanzagl 1994). Using the MML approach, the user has to specify a density function for the person parameters, i.e. f (θ), and if this specification is wrong, MML is inferior to CML. However, there exist also some nonparametric approaches to specify f (θ) (de Leeuw and Verhelst 1986). Furthermore, a pseudo-ML estimation has been proposed as well (Anderson, Li, and Vermunt 2007).
In the eRm package, CML is used because, apart from the desirable properties of the estimators, it stays close to the concept of specific objectivity (Rasch 1960(Rasch , 1977Fisher Jr. 1992), proposed by Rasch and well-founded from a epistemological point of view. Furthermore, using the CML approach, LR-tests can be carried out immediately.
The main idea behind the CML estimation is that the person's raw score r v = k i=1 x vi is a sufficient statistic. Thus, by conditioning the likelihood onto r = (r 1 , ..., r n ), the person parameters θ, which in this context are nuisance parameters, vanish from the likelihood equation, thus, leading to consistently estimated item parameters β.
1 0 0 1 1 1 Some restrictions have to be imposed on the parameters to ensure identifiability. This can be achieved, e.g., by setting certain parameters to zero depending on the model. In the Rasch model one item parameter has to be fixed to 0. This parameter may be considered as baseline difficulty. In addition, in the RSM the category parameters ω 0 and ω 1 are also constrained to 0. In the PCM all parameters representing the first category, i.e. β i0 with i = 1, . . . , k, and one additional item-category parameter, e.g., β 11 have to be fixed. For the linear extensions it holds that the β-parameters that are fixed within a certain condition (e.g. first measurement point, control group etc.) are also constrained in the other conditions (e.g. second measurement point, treatment group etc.).
At this point, for the LPCM the likelihood equations with corresponding first and second order derivatives are presented (i.e. unified CML equations). In the first version of the eRm package numerical approximations of the Hessian matrix are used. However, to ensure numerical accuracy and to speed up the estimation process, it is planned to implement the analytical solution as given below.
The conditional log-likelihood equation for the LPCM is The maximal raw score is denoted by r max whereas the number of subjects with the same raw score is quoted as n r . Alternatively, by going down to an individual level, the last sum over r can be replaced by n v=1 log γ rv . It is straightforward to show that the LPCM as well as the other extended Rasch models, define an exponential family (Andersen 1983). Thus, the raw score r v is minimally sufficient for θ v and the item totals x .ih are minimally sufficient for β ih .
Crucial expressions are the γ-terms which are known as elementary symmetric functions. An elaborated derivation of these terms for the ordinary RM can be found in Fischer (1974) and an overview of various computation algorithms is given in Liou (1994). However, in the eRm package the numerically stable summation algorithm as suggested by Andersen (1972) is implemented. Fischer and Ponocny (1994) adopted this algorithm for the LPCM and devised also the first order derivative for computing the corresponding derivative of log L c : It is important to mention that for the CML-representation, the multiplicative Rasch expression is used throughout equations 1 to 7, i.e., i = exp(−β i ) for the person parameter. Therefore, ih corresponds to the reparameterized item × category parameter whereas ih > 0. Furthermore, γ r are the first order derivatives of the γ-functions with respect to item i. The index a in η a denotes the first derivative with respect to the a th parameter.
For the second order derivative of log L c , two cases have to be distinguished: the derivatives for the off-diagonal elements and the derivatives for the main diagonal elements. The item categories with respect to the item index i are coded with h i , and those referring to item l with h l . The second order derivatives of the γ-functions with respect to items i and l are denoted by γ (i,l) r . The corresponding likelihood expressions are To solve the likelihood equations with respect to η, a Newton-Raphson algorithm is applied. The update within each iteration step s is performed by The starting values are η 0 = 0. H −1 s−1 is the inverse of the Hessian matrix composed by the elements given in Equation 10 and 11 and δ s−1 is the gradient at iteration s − 1 as specified in Equation 9. The iteration stops if the likelihood difference log L (s) where ϕ is a predefined (small) iteration limit. Note that in the current version (v0.3.2) H is approximated numerically by using the nlm Newton-type algorithm provided in the stats package. The analytical solution as given in Equation 10 and 11 will be implemented in the subsequent version of eRm.

Testing for goodness of fit
In the eRm package the likelihood ratio test statistic LR, initially proposed by Andersen (1973) is computed for the RM, the RSM, and the PCM. For the models with linear extensions, LR has to be computed separately for each measurement point and subgroup.
The underlying principle of this test statistic is that of subgroup homogeneity in Rasch models: for arbitrary disjoint subgroups g = 1, ..., G the parameter estimates η g have to be the same.
LR is asymptotically χ 2 -distributed with df equal to the number of parameters estimated in the subgroups minus the number of parameters in the total data set. For the sake of computational efficiency, the eRm package performs a person raw score median split into two subgroups. In addition, a graphical model test (Rasch 1960) based on these estimates is produced by plotting β 1 against β 2 . Thus, critical items (i.e. those fairly apart from the diagonal) can be identified and eliminated. Further elaborations and additional test statistics for polytomous Rasch models can be found, e.g., in Glas and Verhelst (1995).

The eRm package and application examples
The underlying idea of the eRm package is to provide a user-friendly flexible tool to compute extended Rasch models. This implies, amongst others, an automatic generation of the design matrix W. However, in order to test specific hypotheses the user may specify W allowing the package to be flexible enough for computing IRT-models beyond their regular applications. Note that the IRT package ltm (Rizopoulos 2006) focuses on different models such as Birnbaum models and Graded Response models by using MML. In the following subsections, three examples are provided pertaining to different model and design matrix scenarios. Due to intelligibility matters, the artificial data sets are kept rather small.

LLTM as a restricted RM
As mentioned in Section 2.2, also the models with the linear extensions on the item parameters can be seen as special cases of their underlying basic model. In fact, the LLTM as presented below and following the original idea by Scheiblechner (1972), is a restricted RM, i.e. the number of item parameters is smaller. The data matrix X consists of n = 15 persons and k = 5 items and is given by The design matrix W (user-defined) following Equation 4 with specific weight elements w ij fixed a priori is R> W <-matrix(c (1, 2, 1, 3, 2, 2, 2, 1, 1, 1 In order to test for goodness-of-fit it is be necessary to test the fit of the regular RM on these data and furthermore, to test the restrictions on the item parameters graphically by plotting β In the graphical model check in Figure 2 which is produced by using the command

R> plotGOF(lrres)
the sample is split into two halves according to the mean. For both subsamples, the βparameters are computed (normalized to sum-zero). In the case of a poor model fit this type of plot could be used to detect and consequently eliminate non-complying items.

An ordinary RSM example
Again, we provide an artificial data set with n = 20 persons and k = 6 items; each of them with m + 1 = 4 categories: R> data("rsmdat") R> head(rsmdat) The design matrix W consists of k − 1 = 5 item contrasts and (m + 1) − 2 = 2 item-category parameters. Thus, the vector η of the basic parameters estimated in the CML-routine consists of 6 elements. The vector β representing all estimable item × category parameters is the linear combination β = W η and has a total length of 18.
The summary method provides the log-likelihood value with corrsponding information criteria as well as the β-estimates. The LR-test, as described in Section 3.2, is carried out using the LRtest statement.

R> summary(resrsm)
Results of RSM fit: Log-likelihood: -107.5618 to the first test occasion, the next k columns for the second, etc. In total, there are n = 20 subjects. Among these, the first 10 persons belong to the first group (e.g., control), and the next 10 persons to the second group (e.g., treatment). This is specified by a group vector: R> data("lpcmdat") R> grouplpcm <-rep(1:2, each = 10) Again, W is generated automatically. In general, for such designs the generation of W consists first of the item contrasts, followed by the time contrasts and finally by the group main effects except for the first measurement point (due to identifiability issues, as already described  The parameter estimates are the following: Testing whether the η-parameters equal 0 is mostly not of relevance for those parameters referring to the items (in this example η 1 , ..., η 8 ). But for the remaining contrasts, H 0 : η 9 = 0 (implying no general time effect) can not be rejected (p = .44), whereas hypothesis H 0 : η 10 = 0 has to be rejected (p = .004) when applying a z-test. This suggests that there is a significant treatment effect over the measurement points. If a user wants to perform additional tests such as a Wald test for the equivalence of two η-parameters, the vcov method can be applied to get the variance-covariance matrix.

Discussion and outlook
In this paper some theoretical as well as practical considerations have been presented with respect to the application of the eRm package. All the presented models fulfill the basic Rasch properties and are estimable by using a unified CML approach. If missing values occur in X they are coded as NA. For each subgroup due to the NA structure, the likelihood value is computed separately. The corresponding theoretical treatment can be found in Fischer and Ponocny (1994).
A further implication refers to the estimation of the person parameters. Due to the mentioned separability of item and person parameters, they do not need to be estimated simultaneously with the item parameters. If no assumptions are posed on the latent distribution f (θ), Andersen (1995) gives a general formulation of the ML estimate of θ with r v = r and θ v = θ: The CML estimates for η are inserted into Equation 7 in order to obtain the β-parameters. Thus, considering all β ih to be known, Equation 14 can be solved with respect to θ by using the Newton-Raphson method. This is carried out by using the function person.parameter In addition residuals and consequently, itemfit and personfit statistics are implemented as well as plot routines to visualize both empirical and estimated ICCs.
The last remark concerns additional models whose implementation in the eRm package could be an issue of future work. The linear logistic model with relaxed assumptions (Fischer 1977), abbreviated to LLRA, dispenses the uni-dimensionality requirement of the RM. The reparameterization θ v − β i =: θ vi leads to a generalization of the RM with θ vi as independent trait parameters. Applications of this model for the analysis of change as well as the formal equivalence of the LLRA and the LLTM (by introducing the concept if virtual persons) are described in Fischer (1995b). Due to this equivalence, CML estimation can be applied. This estimation approach, in combination with the EM-algorithm, can also be used to estimate mixed Rasch models (MIRA). The basic idea behind such models is that the extended Rasch model holds within subpopulations of individuals, but with different parameter values for each subgroup. Corresponding elaborations are given in Rost and von Davier (1995).
To conclude, the eRm package is a tool to estimate extended Rasch models for unidimensional traits. The generalizations towards different numbers of item categories, linear extensions in terms of trend and group contrasts are important issues when examining item behavior and person performances in tests. This improves the feasibility of IRT models with respect to a wide variety of application areas.