Hi Phil,
I am have trouble with understanding the DIF function, particularly the drop_sequential option. If I 'manually' recreate what is I think is going on in the loop, I get different results.
Let's say I first run a constrained model on 10 items between 2 groups (using invariance = c(colnames(data), 'free_means', 'free_var') ), and then find that item 1 through 4 are flagged as displaying DIF given seq_stat. I would guess that the next step in drop_sequential would be to run a new model, with item 5 through 10 as anchors, and then testing DIF again on items 1 through 4. I recreate this as follows:
itemnames <- colnames(data)
model_anchor<-multipleGroup(data, model = 1, group = group, invariance = c(itemnames[1:4], 'free_means', 'free_var'))
dif.anchor <- DIF(model_anchor, c('a1','d1'), items2test = 5:10)
etc. etc.
Following this procedure I arrive at other DIF items then the drop_sequential option. Also, the other way around; after running drop_sequential, a number of items are flagged as DIF (let's say item 8.through 10). If I then run a model with item 1 through 7 as anchors, subsequently test item 8 through 10 for DIF, then suddenly item 8 is not flagged for DIF anymore. Shouldn't this be impossible?
I have been looking at the source code but I am still confused. Could you tell me what happens next in the above example, perhaps using the multipleGroup and DIF?
Many thanks,
Dirk