Dear Phil
First of all a huge thank you for mirt and the support and materials available, it is great and has helped me so much in my phd research!
I am currently redoing some DIF analysis I previously conducted and I am encountering a new error that I hadn't faced last time I ran this on the same data. I am testing for DIF with an item set that has mostly dichotomous items and a few polytomous items (0,1,2) so I've fitted the models with itemtype = 2PL for the dichotomous items and itemtype = gpcm for poly items.
Previously, after running a drop DIF I selected an anchor set and then for the second round of DIF testing I was running this code:
# Specify Itemtype
itemtype <- ifelse(max == 1, '2PL', 'gpcm')
# Constrained model 1 ----
conmod1 <- multipleGroup(items, 1, group=group, itemtype=itemtype,
invariance = c(colnames(items), 'free_means', 'free_var'))
# DIF test 1 ----
#The other items serve as the anchor items (i.e., the all-others-as-anchors model).
diftest <- DIF(conmod1, c('d','d1','d2'),
scheme = 'drop', seq_stat = .01, p.adjust = 'fdr')
# select anchors from DIF free items in DIF test 1
# load anchor set and test set values
load("Rdata/ancset.RData") # anchor set
load("Rdata/testset.RData") # test set
# Specify a New constrained Model using Anchor Items ----
# Run model
ancmod <- multipleGroup(items, 1, group = group, itemtype = itemtype, SE=T,
invariance = c(ancset, 'free_means', 'free_var'))
# DIF test 2 : DIF detection LR Tests ----
diftest2 <- DIF(ancmod, c('d','d1', 'd2'), items2test = testset, p.adjust = 'fdr')
Error in checkForRemoteErrors(val) :
7 nodes produced errors; first error: 'i' and 'j' must not contain NA
Previously it ran with no problems, but now I am encountering an error when I run diftest2. At first I assumed it was an error is because the polytomous items didnt have a 'd' value and only have d1 and d2. So I attempted:
diftest2 <- DIF(ancmod, c('d'), items2test = testset, p.adjust = 'fdr')
|++++++++++++++++++++++++++++++++++++++++ | 80% ~03m 48s Error in checkForRemoteErrors(val) :
one node produced an error: 'i' and 'j' must not contain NA
and again encountered a similar error. Which makes me think the problem is likely to be the mix of poly and dichotmous items as there are either d or d1/d2 values marked as NA. However, I am not sure why I didn't face this error when I ran this same code a few months ago as there were still a mix of itemtypes then.
Do I need to test the 2PL and GPCM items separately for DIF after setting the anchor?
Do you have any suggestions or ideas of what might be occurring?
Happy to share more detailed code/data if it would be helpful.
Thank you again for the great package and helpful forum!
Best,
Heather