1

I am having some issues with the multipleGroup() function in R and I really hope there's someone who can help me out.
I want to create first an independent, not constrained model where all the parameters may vary for both groups, but I am getting the following error message:

Error: Multiple Group model will not be identified without proper constraints (groups contain missing data patterns where item responses have been completely omitted or, alternatively, the number of categories within each group is not equal to the total number of categories)

Below you'll see an example code (also for polytomous data) which is running fine and further down I show my code and some infos about my data. I cannot see what's missing in my code... Is anyone out there who could give me a little tipp?

The example code for this is the following:

lsat <- expand.table(LSAT7)
set.seed(1234)
group <- sample(c('group.1', 'group.2'), 1000, replace=TRUE)
xtabs(~group)

mod <- multipleGroup(lsat, model=1, group=group)

And my code, producing the mentioned error message, is this:

Tdata <- import(here::here("test_data.xlsx"))
group <- c(rep('group1',25),rep('group2',25))
xtabs(~group)
Tdata <- Tdata %>% dplyr::select(item1, item2, item3, item4, item5)

multipleGroup(Tdata, model = 1, group = group)

To show you details to my data:

> head(Tdata)
  item1 item2 item3 item4 item5
1     1     2     1     2     1
2     2     2     1     2     3
3     3     4     3     3     3
4     3     4     5     4     5
5     2     1     2     1     2
6     2     2     1     2     2

> summary(Tdata)
     item1          item2          item3          item4          item5    
 Min.   :1.00   Min.   :1.00   Min.   :1.00   Min.   :1.00   Min.   :1.0  
 1st Qu.:2.00   1st Qu.:2.00   1st Qu.:2.00   1st Qu.:2.00   1st Qu.:2.0  
 Median :2.00   Median :3.00   Median :3.00   Median :3.00   Median :3.0  
 Mean   :2.70   Mean   :2.88   Mean   :2.82   Mean   :2.92   Mean   :2.9  
 3rd Qu.:3.75   3rd Qu.:4.00   3rd Qu.:4.00   3rd Qu.:4.00   3rd Qu.:4.0  
 Max.   :5.00   Max.   :5.00   Max.   :5.00   Max.   :5.00   Max.   :5.0  

> class(Tdata)
[1] "data.frame"

> class(Tdata$item1)
[1] "numeric"

> any(is.na(Tdata))
[1] FALSE

Let me know if you need any further information. Thank you so much in advance!!

Gretaku
  • 11
  • 1

0 Answers0