Update: I was able to designate dimensionality (2 factors) and constrain a1, a2, and d parameters on some items by running mirt.model and then multipleGroup calling that model. So my current question is this.... Building the constraints with CONSTRAIN in mirt.model and then running that model in multipleGroup then constrains the parameters within groups, across items. I can be fairly certain that that constraining parameters in mirt.model is producing a decent model with good fit indices. However, I am not sure that those constraints are applicable for BOTH reference and focal groups (note: I am not using CONSTRAINB, so I'm not talking about constraining across groups).
However the M2 stats also look good for multipleGroup when CONSTRAIN holds parameters across items, within groups, so maybe this does make sense. However since 2-dim DIF is the goal, I'm not at all sure the constraining of parameters across items within groups make sense....For example one item (number 13) that had all three parameters constrained in the original mirt.model did not show any differences between groups at all. (p=1).
I think I am pretty turned around here in terms of the steps with this so would love any advice the forum could offer! I am trying to use the help manual... but am still uncertain. Essentially I am unsure if I should ever place constraints on items that I will test (in mirt.model, below called Two_dim_c).
Two_dim_c <- '
F1 = 1-30
F2 = 1-29
CONSTRAIN=(18,4,19,26,a1), (2,3,5,17, a1), (21,8,13,10,11,9,a1), (24,6,22,7,25, a1),
(2,17,11,12,13,a2), (10,22,1,21,24,26,29,a2), (15,14,28,a2),
(22,8,11,d), (27,9,13,d), (25,30,20,d)
'
xmirt5<-mirt(read_mirt, Two_dim_c, SE=TRUE)
model_anchor1 <- multipleGroup(read_mirt, model = Two_dim_c,
group = group,
invariance = c(itemnames[1:11], 'free_means', 'free_var'))
anchor <- DIF(model_anchor1, c('a1','a2', 'd'), items2test = 12:29)