Extract a single group from an object defined by multipleGroup
.
extract.group(x, group)
mirt model of class 'MultipleGroupClass'
the name of the group to extract
Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29. doi:10.18637/jss.v048.i06
# \donttest{
set.seed(12345)
a <- matrix(abs(rnorm(15,1,.3)), ncol=1)
d <- matrix(rnorm(15,0,.7),ncol=1)
itemtype <- rep('2PL', nrow(a))
N <- 1000
dataset1 <- simdata(a, d, N, itemtype)
dataset2 <- simdata(a, d, N, itemtype, mu = .1, sigma = matrix(1.5))
dat <- rbind(dataset1, dataset2)
group <- c(rep('D1', N), rep('D2', N))
models <- 'F1 = 1-15'
mod_configural <- multipleGroup(dat, models, group = group)
group.1 <- extract.group(mod_configural, 'D1') #extract first group
summary(group.1)
#> F1 h2
#> Item_1 0.532 0.2835
#> Item_2 0.582 0.3383
#> Item_3 0.487 0.2371
#> Item_4 0.466 0.2176
#> Item_5 0.542 0.2935
#> Item_6 0.315 0.0992
#> Item_7 0.599 0.3592
#> Item_8 0.477 0.2280
#> Item_9 0.464 0.2148
#> Item_10 0.391 0.1529
#> Item_11 0.438 0.1923
#> Item_12 0.655 0.4291
#> Item_13 0.604 0.3650
#> Item_14 0.519 0.2699
#> Item_15 0.453 0.2048
#>
#> SS loadings: 3.885
#> Proportion Var: 0.259
#>
#> Factor correlations:
#>
#> F1
#> F1 1
plot(group.1)
# }