philchalmers / mirt

Multidimensional item response theory
199 stars 75 forks source link

specifying item subsets in `empirical_ES` #243

Closed akaat closed 9 months ago

akaat commented 9 months ago

I was trying to get DIF impact measures using empirical_ES() after an anchored run. Specifying focal_items, however, fails.

Attached is a reproducible example building upon the example on the help page. mirt_bugIssue_ex.txt

Looking at the code, I think the following need to change: lines 198 & 199 - change to extract.item(..., focal_item[i]) line 245 - remove the row references; change it to return(df.item.output)

Lines 198 & 199 are the biggest issues, though, because they affect both the item table that gets returned, and the plots. When item subsets get plotted, it is plotting the first n items, even though they get the item labels for the focal_items. As shown in the code, the plots give 4 items, none of which exhibit DIF, but when not requesting focal_items, all 4 of them exhibit DIF and have different plots.

philchalmers commented 9 months ago

Thanks, should be patched now. Feel free to re-open if you see any other issues related to this.