philchalmers / mirt

Multidimensional item response theory
199 stars 75 forks source link

Slope-intercept to traditional parametrization works even for complex structure items #237

Closed netique closed 1 year ago

netique commented 1 year ago

I have a model where every single item has 2 non-zero slopes. It is considered as complex and coef(model, IRTpars = TRUE) issues an error. However, model given in the example in ?mirt (see the details below for the code), where only one item has 2 non-zero slopes, it returns the coefs without hesitation. In the source code, its apparent that a model has to have at least one simple-structure item in order to parameters to be transformed. Is that intentional? Why is that so?

Details

```r #simulate data a <- matrix(c( 1.5,NA, 0.5,NA, 1.0,NA, 1.0,0.5, NA,1.5, NA,0.5, NA,1.0, NA,1.0),ncol=2,byrow=TRUE) d <- matrix(c( -1.0,NA,NA, -1.5,NA,NA, 1.5,NA,NA, 0.0,NA,NA, 3.0,2.0,-0.5, 2.5,1.0,-1, 2.0,0.0,NA, 1.0,NA,NA),ncol=3,byrow=TRUE) sigma <- diag(2) sigma[1,2] <- sigma[2,1] <- .4 items <- c(rep('2PL',4), rep('graded',3), '2PL') dataset <- simdata(a,d,2000,items,sigma) #analyses #CIFA for 2 factor crossed structure model.1 <- ' F1 = 1-4 F2 = 4-8 COV = F1*F2' #compute model, and use parallel computation of the log-likelihood if(interactive()) mirtCluster() mod1 <- mirt(dataset, model.1, method = 'MHRM') ```

philchalmers commented 1 year ago

This is intentional. It's to let users know that their model does not have any classical parameterization due to lack of simple structures. If one or more items can be transformed, however, then the output returns the transformation for the given item; otherwise, the slope-intercept form is retained. Though I agree an error message is perhaps the wrong intensity. I'll switch this to a warning instead.

netique commented 1 year ago

Since I didn't compare the coefs for the example model with and without IRTpars = TRUE I didn’t notice that complex-structure items are left untransformed. Switching to warning is welcomed for me. Maybe I would further refine the message in a way to stress that the original parameters are returned for complex-structure items, so people don’t mistakingly assume that any transformation took place (but, well, they would have to notice at some point). Maybe this could generalize to models with any non-zero number of complex-structure items pointing out that some items were left untransformed.