0

I am trying to estimate a mmultilevel multidimensional item response theory (MMIRT) model in R by using mirt package (Chalmers, R. Philip. "mirt: A multidimensional item response theory package for the R environment." Journal of statistical Software 48 (2012): 1-29.). The function mixedmirt() is supposed to do this via the Metropolis-Hastings Robbins-Monro (MHRM) algorithm but, for some reason, I get the following message.

> library(mirt)

> 2l.model <- mixedmirt(data = my.data, model = EUR, itemtype = "graded", survey.weights = my.weights, fixed =~ 0, random =~ 1 | my.groups)
Error in ESTIMATION(data = data, model = model, group = rep("all", nrow(data)),  : 
  opts$method %in% c("EM", "QMCEM", "MCEM") non è TRUE

So, I tried to change the method as suggested by the error line. However, as clearly explained in the documentation of the function, this is not allowed (https://www.rdocumentation.org/packages/mirt/versions/1.37.1/topics/mixedmirt).

> 2l.model <- mixedmirt(data = my.data, model = my.model, itemtype = "graded", method = "QMCEM", survey.weights = my.weights, fixed =~ 0, random =~ 1 | my.groups)
Error: method cannot be changed in mixedmirt() function

Furthermore, I checked if the MHRM method worked for unilevel mirt models by using the function mirt(), which should be allowed according to the documentation (https://www.rdocumentation.org/packages/mirt/versions/1.37.1/topics/mirt). However, once again, I get the following message.

> mirt.model <- mirt(data = my.data, model = my.model, method = "MHRM", survey.weights = my.weights)
Error in ESTIMATION(data = data, model = model, group = rep("all", nrow(data)),  : 
  opts$method %in% c("EM", "QMCEM", "MCEM") non è TRUE

All this evidence led me to the conclusion that there is something wrong which prevent me to use the MHRM algorithm in my code or perhaps in my laptop. If so, is there a way to fix the problem and perform a estimation via the MHRM algorithm?

All the code was run in R 4.2.2 version.

  • Strange indeed. Do any of the examples run from the documentation. What version of mirt are you using? – philchalmers Mar 04 '23 at 17:06
  • Hi, all the examples from the documentation run as expected. May this problem depend on my data set? I am using version 1.37.1. – fedebacchi Mar 14 '23 at 09:02

0 Answers0