Error: group input provided is not valid -earlier solutions in thread not helpful

15 views
Skip to first unread message

Vas

unread,
Feb 27, 2025, 9:58:05 AMFeb 27
to mirt-package
Hi
please help me on the below
bifactor_model <- '
G = 1-11  # General factor loads on all items
f1 = 1-4  # Specific factor for items 1-4
f2 = 5-7  # Specific factor for items 5-8
f3 = 8-11 # Specific factor for items 9-12
'
I have found this model to have the best fit to the data. As a next step i want to test the dif for this model with gender as the factor/grouping variable.

> str(data)
spc_tbl_ [400 × 12] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
 $ item1  : num [1:400] 6 5 5  ...
 $ item2 : num [1:400]  6 5 6   ...
 $ item3  : num [1:400] 6 4 5  ...
 $ item4 : num [1:400] 6 5 5  ...
 $ item5  : num [1:400] 6 5 5  ...
 $ item6  : num [1:400] 6 4 5  ...
 $ item7  : num [1:400] 6 4 5  ...
 $ item8: num [1:400] 6 5 5  ...
 $ item9: num [1:400] 6 5 5  ...
 $ item10: num [1:400] 6 4 5  ...
 $ item11 : num [1:400] 6 5 5  ...
 $ gender : chr [1:400] "1" "2" "2" "1" ...


MGmodel <- multipleGroup(data, model = bifactor, group = "gender",
                         itemtype = 'graded', method = 'QMCEM', SE = TRUE)
 Error: group input provided is not valid                  
                  OR
MGmodel <- multipleGroup(data, model = bifactor_model, group = "gender")


Error: group input provided is not valid

Can you help me with this? I understand that there were earlier questions on this error, but this error persists even after I convert gender as a chr.
Thanks in advance for your thanks and consideration
vas

Phil Chalmers

unread,
Mar 2, 2025, 12:53:04 PMMar 2
to Vas, mirt-package
Using group = 'gender' does not pass the gender variable, but rather a character vector with only one element. You probably want something like group = dat$gender, or something that points to the grouping variable explicitly.

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.
To view this discussion visit https://groups.google.com/d/msgid/mirt-package/017ca972-ea3b-4b53-a039-779d72843130n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages