multiple group bfactor - focal group hyperparameters for G

37 views
Skip to first unread message

Mike Imanaga II

unread,
Jun 15, 2024, 4:28:27 PM (4 days ago) Jun 15
to mirt-package
Hi, I am not sure if this behavior is expected with the bfactor function when performing multiple groups analysis. I am finding that only the mean -- not the variance -- of the general factor in the focal group is being estimated. I was expecting both of these hyperparameters to be freed. Reprex shown below, based on some of the example code from ?bfactor.

Thanks

``` r
library(mirt)
#> Loading required package: stats4
#> Loading required package: lattice



### load SAT12 and compute bifactor model with 3 specific factors
data(SAT12)
data <- key2binary(SAT12,
                   key = c(1,4,5,2,3,1,2,1,3,1,2,4,2,1,5,3,4,4,1,4,3,3,4,1,3,5,1,3,1,5,4,5))
specific <- c(2,3,2,3,3,2,1,2,1,1,1,3,1,3,1,2,1,1,3,3,1,1,3,1,3,3,1,3,2,3,1,2)
set.seed(456)
group <- sample(c("G1", "G2"), nrow(data), replace = TRUE)
data <- data.frame(data)
mod1 <- bfactor(data, specific,
                group = group,
                invariance = c("free_means", "free_vars", names(data)),
                technical = list(NCYCLES = 5000),
                verbose = FALSE)
sapply(coef(mod1, printSE = TRUE), "[", "GroupPars")
#> $G1.GroupPars
#>     MEAN_1 MEAN_2 MEAN_3 MEAN_4 COV_11 COV_21 COV_31 COV_41 COV_22 COV_32
#> par      0      0      0      0      1      0      0      0      1      0
#>     COV_42 COV_33 COV_43 COV_44
#> par      0      1      0      1
#>
#> $G2.GroupPars
#>         MEAN_1 MEAN_2 MEAN_3 MEAN_4 COV_11 COV_21 COV_31 COV_41 COV_22 COV_32
#> par 0.08768718      0      0      0      1      0      0      0      1      0
#>     COV_42 COV_33 COV_43 COV_44
#> par      0      1      0      1

```

<sup>Created on 2024-06-15 with [reprex v2.1.0](https://reprex.tidyverse.org)</sup>
Reply all
Reply to author
Forward
0 new messages