philchalmers / mirt

Multidimensional item response theory
https://philchalmers.github.io/mirt/
199 stars 75 forks source link

is it a bug with bfactor in MIRT package #162

Closed elynlu closed 5 years ago

elynlu commented 5 years ago

hi, I have a really big data (over 100,000 test takers with about 80 items). I tried the testlet model, but it gives met the following results

$cov G S1 S2 S3 S4 S5 S6 S7 S8 G 1 NA NA NA NA NA NA NA NA S1 0 0.098 NA NA NA NA NA NA NA S2 0 0.000 0.1 NA NA NA NA NA NA S3 0 0.000 0.0 1.00 NA NA NA NA NA S4 0 0.000 0.0 0.25 1 NA NA NA NA S5 0 0.000 0.0 0.00 0 0.093 NA NA NA S6 0 0.000 0.0 0.00 0 0.000 0.106 NA NA S7 0 0.000 0.0 0.00 0 0.000 0.000 0.142 NA S8 0 0.000 0.0 0.00 0 0.000 0.000 0.000 0.092

the covariance estimate for (S3, S4) is .25. I try the same code with another set of data, got the same covariance estimates for the third and fourth testlets. could you please take a look.

thanks

philchalmers commented 5 years ago

The bifactor function does not allow for correlated specific factors due to the dimension reduction integration technique. You'd have to setup this correlated structure through the two-tier commands, where in this case S5 and S6 are declared using the mirt.model() interface, along with their correlation, and passed through the model input.

elynlu commented 5 years ago

no, I did not set any correlated structures. That is why the covariance of .25 surprised me.

I have the following code:

model <- "G = 1-78 CONSTRAIN = (1, a1, a2), (2, a1, a2), (3, a1, a2), (4, a1, a2), (5, a1, a2), (6, a1, a2), (7, a1, a2), (8, a1, a2), (9, a1, a2), (10, a1, a2), (11, a1, a3), (12, a1, a3), (13, a1, a3), (14, a1, a3), (15, a1, a3), (16, a1, a3), (17, a1, a3), (18, a1, a3), (19, a1, a3), (20, a1, a3), (21, a1, a4), (22, a1, a4), (23, a1, a4), (24, a1, a4), (25, a1, a4), (26, a1, a4), (27, a1, a4), (28, a1, a4), (29, a1, a4), (30, a1, a4), (31, a1, a5), (32, a1, a5), (33, a1, a5), (34, a1, a5), (35, a1, a5), (36, a1, a5), (37, a1, a5), (38, a1, a5), (39, a1, a5), (40, a1, a5), (41, a1, a6), (42, a1, a6), (43, a1, a6), (44, a1, a6), (45, a1, a6), (46, a1, a6), (47, a1, a6), (48, a1, a6), (49, a1, a6), (50, a1, a6), (51, a1, a7), (52, a1, a7), (53, a1, a7), (54, a1, a7), (55, a1, a7), (56, a1, a7), (57, a1, a7), (58, a1, a7), (59, a1, a7), (60, a1, a7), (61, a1, a8), (62, a1, a8), (63, a1, a8), (64, a1, a8), (65, a1, a8), (66, a1, a8), (67, a1, a8), (68, a1, a8), (69, a1, a9), (70, a1, a9),(71, a1, a9),(72, a1, a9), (73, a1, a9), (74, a1, a9), (75, a1, a9),(76, a1, a9),(77, a1, a9), (78, a1, a9) COV = S1S1, S2S2, S3S3 S4S4, S5S5, S6S6,S7S7, S8S8 "

simmod2 <- bfactor(res, specific, model, quadpts=60,itemtype=type, technical=list(NCYCLES=2000))

what I really want is a simple testlet model and wants to know the variance of the specific factors. could you please let me know where went wrong.

Thanks!