Closed ysuh09 closed 9 months ago
Thanks for the report, should be patched now. I modified your example to verify that it was working correctly (you had some repeated elements in the example that seemed incorrect in this context), so here's the code that I used.
library(mirt)
set.seed(12345)
nitems <- 20
a1 <- matrix(.50, ncol=1, nrow=nitems)
a2 <- matrix(1.0, ncol=1, nrow=nitems)
a3 <- matrix(2, ncol=1, nrow=nitems)
d1 <- matrix(rnorm(nitems,0,1),ncol=1)
d2 <- matrix(rnorm(nitems,0,1),ncol=1)
d3 <- matrix(rnorm(nitems,0,1),ncol=1)
itemtype <- rep('2PL', nrow(a1))
N1 <- 1000
N2 <- N3 <- N1*2 # second class twice as large
dataset1 <- simdata(a1, d1, N1, itemtype)
dataset2 <- simdata(a2, d2, N2, itemtype)
dataset3 <- simdata(a3, d3, N3, itemtype)
dat <- rbind(dataset1, dataset2, dataset3)
# group <- c(rep('D1', N1), rep('D2', N2), rep('D3',N3))
models <- 'F1 = 1-20
CONSTRAIN = (1-20, a1)'
mod_mix_SE <- multipleGroup(dat, models, dentype = 'mixture-3', SE=T, GenRandomPars = TRUE)
coef(mod_mix_SE, printSE=TRUE)
coef(mod_mix_SE, simplify=TRUE)
summary(mod_mix_SE)
Hi Phil,
Thank you so much for all your work with the MIRT package. We've been noticing that when using the multipleGroup function with SE=T and dentype="mixture-h" where h is more than 2, the standard errors are not calculated and causes the R program itself to shut down (Once in a blue moon when I first open R or Rstudio and try to run things for a first time, it works, but from the second try, the R program shuts down). Here is an example:
Created on 2023-12-05 with reprex v2.0.2
mod_mix without the SE=T, runs fine but mod_mix_SE results in a fatal error with R session being aborted
Here is a screenshot:
Just in case it helps, here I paste the sessioninfo as well.
Session info
``` r sessionInfo() #> R version 4.3.2 (2023-10-31 ucrt) #> Platform: x86_64-w64-mingw32/x64 (64-bit) #> Running under: Windows 10 x64 (build 19045) #> #> Matrix products: default #> #> #> locale: #> [1] LC_COLLATE=English_United States.utf8 #> [2] LC_CTYPE=English_United States.utf8 #> [3] LC_MONETARY=English_United States.utf8 #> [4] LC_NUMERIC=C #> [5] LC_TIME=English_United States.utf8 #> #> time zone: America/Los_Angeles #> tzcode source: internal #> #> attached base packages: #> [1] stats4 stats graphics grDevices utils datasets methods #> [8] base #> #> other attached packages: #> [1] mirt_1.41 lattice_0.21-9 #> #> loaded via a namespace (and not attached): #> [1] permute_0.9-7 nlme_3.1-163 cli_3.6.1 #> [4] knitr_1.45 rlang_1.1.2 xfun_0.41 #> [7] GPArotation_2023.11-1 glue_1.6.2 htmltools_0.5.7 #> [10] gridExtra_2.3 rmarkdown_2.25 grid_4.3.2 #> [13] evaluate_0.23 MASS_7.3-60 fastmap_1.1.1 #> [16] yaml_2.3.7 lifecycle_1.0.4 cluster_2.1.4 #> [19] compiler_4.3.2 fs_1.6.3 Rcpp_1.0.11 #> [22] dcurver_0.9.2 Deriv_4.1.3 vegan_2.6-4 #> [25] mgcv_1.9-0 pbapply_1.7-2 rstudioapi_0.15.0 #> [28] digest_0.6.33 reprex_2.0.2 parallel_4.3.2 #> [31] splines_4.3.2 Matrix_1.6-1.1 gtable_0.3.4 #> [34] tools_4.3.2 withr_2.5.2 ```Could you please help us solve this issue? Thank you.