Error preventing item fit from being calculated for Multiple Group Estimation model

36 views
Skip to first unread message

Daniel McKelvey

unread,
May 19, 2018, 7:36:41 PM5/19/18
to mirt-package
Hi Phil,

I've encountered a new error for me that is preventing me from calculating item fit for an MGE that I am using to test for DIF:

> HetvGB_config_itemfit = itemfit(HetvGB_config)
Error in scores[match(sfulldata, stabdata2), , drop = FALSE] : 
  subscript out of bounds

The instrument is a 21 item measure with 7 response categories per item. I've listwise deleted any participant with missing data, so that should not be the issue. I also modeled each group separately and calculated item fit that way with no errors, so I'm not sure what has happened.

Thanks for your time,
Daniel

Phil Chalmers

unread,
May 19, 2018, 8:25:36 PM5/19/18
to Daniel McKelvey, mirt-package
This one looks less familiar to me. Could you send me simple reproducible code and data?

Phil


--
You received this message because you are subscribed to the Google Groups "mirt-package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel McKelvey

unread,
May 19, 2018, 9:07:07 PM5/19/18
to mirt-package
Sure! Here is my code:

##Group A Data
M_GrpA = read.csv("M_GRPA.csv", header = T)
M_GrpA_Items = M_GrpA[ ,  c(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)]
M_GrpA_Items = na.omit(M_GrpA_Items)

##Group B Data
M_GrpB = read.csv("M_GRPB.csv", header = T)
M_GrpB_Items = M_GrpB[ , c(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)]
M_GrpB_Items = na.omit(M_GrpB_Items)

##Binding retrieved data into single file
M_GrpAvB_items = rbind(M_GrpA_Items, M_GrpB_Items)
groups = c(rep('A',1820), rep('B', 481))
model ='TMI = 1-21'

#Configural invariance model
AvB_config = multipleGroup(M_GrpAvB_items, model, group = groups,
                               technical = list(NCYCLES=5000))
itemfit(AvB_config)

Thank you for your help!
M_GRPA.csv
M_GRPB.csv

Phil Chalmers

unread,
May 19, 2018, 9:20:11 PM5/19/18
to Daniel McKelvey, mirt-package
Thanks. Must be a patched bug already. I get this as the output:

> itemfit(AvB_config)
$A
   item    S_X2 df.S_X2 p.S_X2
1    M1 281.902     287  0.574
2    M2 243.500     213  0.074
3    M3 216.339     186  0.063
4    M4 293.353     269  0.147
5    M5 182.969     178  0.384
6    M6 368.740     329  0.065
7    M7 380.132     328  0.025
8    M8 280.581     251  0.097
9    M9 334.016     298  0.074
10  M10 322.960     255  0.003
11  M11 267.844     255  0.278
12  M12 195.113     171  0.100
13  M13 280.260     280  0.484
14  M14 438.646     390  0.045
15  M15 249.173     230  0.184
16  M16 345.818     299  0.032
17  M17 483.532     399  0.002
18  M18 268.736     291  0.821
19  M19 382.624     351  0.118
20  M20 357.672     333  0.169
21  M21 352.490     299  0.018

$B
   item    S_X2 df.S_X2 p.S_X2
1    M1  60.585      61  0.491
2    M2  71.686      51  0.030
3    M3  93.884      57  0.002
4    M4  85.268      70  0.103
5    M5  57.735      47  0.136
6    M6 153.409     130  0.079
7    M7 112.257     132  0.893
8    M8 112.839      88  0.038
9    M9 104.579     100  0.357
10  M10  65.712      88  0.964
11  M11 103.360      90  0.159
12  M12  83.759      60  0.023
13  M13 115.591      80  0.006
14  M14 162.109     145  0.157
15  M15  71.247      76  0.633
16  M16 107.948     110  0.538
17  M17 166.898     155  0.243
18  M18 134.316     117  0.131
19  M19 156.265     141  0.179
20  M20 140.450     142  0.521
21  M21 106.344     113  0.658

I'm submitting a new version of mirt tonight, so you should see an updated version on CRAN soon.

Phil

Reply all
Reply to author
Forward
0 new messages