# Is there an R package which implements weighted maximum likelihood for Rasch models?

Is there a package in R which implements the weighted maximum likelihood method (Warm, 1996) for estimating the person parameters in Rasch Models?

Looks like I'm quite late to the game here, but the mirt package package can estimate WLE scores for dichotomous and polytomous models. You start by fitting, say, a graded response model to your data (or whatever your model may be, PCM, generalised PCM, nominal, rating scale, etc; see ?mirt for the possible options) then compute either a table summary of the factor scores or a complete dataset using the option full.scores = TRUE (the default):

#E.g. with 4-item Science data
> library('mirt')
> (mod <- mirt(Science, 1))

Call:
mirt(data = Science, model = 1)

Full-information item factor analysis with 1 factor(s).
Converged within 1e-04 tolerance after 36 EM iterations.
mirt version: 1.23
M-step optimizer: BFGS
EM acceleration: Ramsay

Log-likelihood = -1608.87
Estimated parameters: 16
AIC = 3249.739; AICc = 3251.19
BIC = 3313.279; SABIC = 3262.512
G2 (239) = 213.56, p = 0.8804
RMSEA = 0, CFI = 1, TLI = 1.193

> tablescores <- fscores(mod, method='WLE', full.scores=FALSE)

Comfort Work Future Benefit         F1     SE_F1
[1,]       1    1      1       1 -5.6980733 1.5782656
[2,]       1    3      2       1 -2.1191038 0.6332802
[3,]       1    4      2       3 -1.1387624 0.6557002
[4,]       1    4      3       1 -0.8489387 0.7000115
[5,]       2    1      1       1 -4.0112458 1.1423935
[6,]       2    1      2       4 -1.8957020 0.6698434


There also is the more traditional ML, MAP, and EAP scores too, in case you wanted to compare.

To the best of my knowledge (though I would be happy to be corrected) the main package in R for Rasch models is eRm, which fits the person and item parameters through conditional maximum likelihood. It interfaces to nlm, which is a general function for non linear optimisation so you might be able to code up the method yourself. If you install eRm and run the vignette("eRm") you'll get quite a readable introduction.

If you are just looking for IRT methods (not specifically Rasch models) you could check out ltm, which does 2 and 3 parameter models, and mokken which carries out non parametric IRT. I believe there is a package mirt which fits multivariate IRT models, but I have not used it so I cannot say too much about it.

Also, if you need to find a particular function in R, use the sos package. Install it from the usual sources, load it and then use the findFn() command.

For example, findFn("mixed Rasch") brings up quite a number of results, some of which may be useful to you.

• I was unable to turn up anything as well. To the OP: the Task View on psychometric models may be of interest: cran.r-project.org/web/views/Psychometrics.html It doesn't seem that "weighted maximum likelihood" is mentioned anywhere in the packages' documentations, but I'm not an expert on this matter, so I may be missing something. Aug 16, 2011 at 11:52
• By the way, the eRm vignette mentions that the Warm (1989) approach will be added to a future version - see p. 11 of cran.r-project.org/web/packages/eRm/vignettes/eRm.pdf. Aug 16, 2011 at 11:54
• @Iterator - thanks I had a feeling that i'd heard the term somewhere in the R documentation before. Aug 16, 2011 at 13:56
• @richiemorrisroe - Thank you very much for your help, I think there isn't really any package for weighted MLE, I've checked all the packages in the Task View. So I really might have to code up the method myself. Aug 17, 2011 at 7:19
• Also I haven't found any library for mixed-Rasch in and Hybrid Models- Is it really possible that there isn't anything in R for these useful and rather common models? Aug 17, 2011 at 7:27

Indeed WCML is very interessant for estimation of CAT results when perfect are possible (for the first items).

So weighted maximum likelihood method for ability estimation has been written by David Magis in his package for simulation of CATs in R.

The function is called thetaEst in his package catR. Estimation is possible for one to 4 parameters models. I advice you to use his package(s).

But WCML can lead to misestimation of ability. See for example Precision of Warm’s Weighted Likelihood Estimation of Ability for a Polytomous Model in CAT, Shudong Wang and Tianyou Wang, ACT Research Reports (1999)

• Unfortunately thetaEst only estimates person parameters for dichotomous data... my data is polytomous. Aug 18, 2011 at 15:04