This function computes a set of RMSD "badness-of-fit" statistics when investing DIF across a set of grouping variables. In a first step, a (potentially highly constrained) multiple group model is fitted, while in a second step the item (and person) parameters are estimated based on all examines across all groups. Category level DIF is assessed based on how well the pseudo-table of counts match the (constrained) probability functions implied by the original multiple group model (while also weighing across the implied density function of the latent traits). If the RSMD fit is poor, indicating non-ignorable DIF, then the multiple-group model should be adjusted to better account for the large response bias due to using a pooled model. See Lee and von Davier (2020) and Buchholz and Hartig (2019) for details.
Arguments
- pooled_mod
a multiple-group model (used to compute the model-implied probability in the goodness-of-fit test)
- flag
a numeric value used as a cut-off to help flag larger RMSD values (e.g.,
flag = .03
will highlight only categories with RMSD values greater than .03)- probfun
logical; use probability functions to compute RMSD? If FALSE, the expected score functions will be integrated instead, which may be useful for collapsing across the categories in polytomous items
- dentype
density to use for the latent trait. Can be
'norm'
to use a normal Gaussian density where the mean/variance are extracted from the model object(default),'snorm'
for a standard normal distribution, or'empirical'
to use the density estimate obtained via the E-table
References
Buchholz, J., and Hartig, J. (2019). Comparing Attitudes Across Groups: An IRT-Based Item-Fit Statistic for the Analysis of Measurement Invariance. Applied Psychological Measurement, 43(3), 241-250. doi:10.1177/0146621617748323
Lee, S. S., and von Davier, M. (2020). Improving measurement properties of the PISA home possessions scale through partial invariance modeling. Psychological test and assessment modeling, 62(1):55-83.
Author
Phil Chalmers rphilip.chalmers@gmail.com
Examples
# \donttest{
#----- generate some data
set.seed(12345)
a <- a2 <- matrix(abs(rnorm(15,1,.3)), ncol=1)
d <- d2 <- matrix(rnorm(15,0,.7),ncol=1)
# item 1 has DIF
d2[1] <- d[1] - .5
a2[1] <- a[1] + 1
itemtype <- rep('2PL', nrow(a))
N <- 1000
dataset1 <- simdata(a, d, N, itemtype)
dataset2 <- simdata(a2, d2, N, itemtype)
dat <- rbind(dataset1, dataset2)
group <- c(rep('D1', N), rep('D2', N))
#-----
# fully pooled model
pooled_mod <- multipleGroup(dat, 1, group=group,
invariance = c(colnames(dat), 'free_mean', 'free_var'))
#>
Iteration: 1, Log-Lik: -18331.382, Max-Change: 0.30076
Iteration: 2, Log-Lik: -18227.700, Max-Change: 0.14013
Iteration: 3, Log-Lik: -18213.683, Max-Change: 0.06367
Iteration: 4, Log-Lik: -18211.749, Max-Change: 0.03010
Iteration: 5, Log-Lik: -18211.361, Max-Change: 0.01526
Iteration: 6, Log-Lik: -18211.209, Max-Change: 0.00940
Iteration: 7, Log-Lik: -18211.070, Max-Change: 0.01221
Iteration: 8, Log-Lik: -18211.005, Max-Change: 0.00812
Iteration: 9, Log-Lik: -18210.960, Max-Change: 0.00647
Iteration: 10, Log-Lik: -18210.928, Max-Change: 0.01568
Iteration: 11, Log-Lik: -18210.848, Max-Change: 0.00583
Iteration: 12, Log-Lik: -18210.837, Max-Change: 0.00325
Iteration: 13, Log-Lik: -18210.831, Max-Change: 0.00262
Iteration: 14, Log-Lik: -18210.827, Max-Change: 0.00201
Iteration: 15, Log-Lik: -18210.824, Max-Change: 0.00169
Iteration: 16, Log-Lik: -18210.822, Max-Change: 0.00425
Iteration: 17, Log-Lik: -18210.816, Max-Change: 0.00159
Iteration: 18, Log-Lik: -18210.815, Max-Change: 0.00089
Iteration: 19, Log-Lik: -18210.815, Max-Change: 0.00070
Iteration: 20, Log-Lik: -18210.815, Max-Change: 0.00054
Iteration: 21, Log-Lik: -18210.815, Max-Change: 0.00046
Iteration: 22, Log-Lik: -18210.814, Max-Change: 0.00117
Iteration: 23, Log-Lik: -18210.814, Max-Change: 0.00043
Iteration: 24, Log-Lik: -18210.814, Max-Change: 0.00024
Iteration: 25, Log-Lik: -18210.814, Max-Change: 0.00019
Iteration: 26, Log-Lik: -18210.814, Max-Change: 0.00015
Iteration: 27, Log-Lik: -18210.814, Max-Change: 0.00013
Iteration: 28, Log-Lik: -18210.814, Max-Change: 0.00032
Iteration: 29, Log-Lik: -18210.814, Max-Change: 0.00012
Iteration: 30, Log-Lik: -18210.814, Max-Change: 0.00007
coef(pooled_mod, simplify=TRUE)
#> $D1
#> $items
#> a1 d g u
#> Item_1 1.440 0.358 0 1
#> Item_2 1.136 -0.590 0 1
#> Item_3 0.996 -0.237 0 1
#> Item_4 0.902 0.921 0 1
#> Item_5 1.060 0.153 0 1
#> Item_6 0.440 0.637 0 1
#> Item_7 1.170 1.023 0 1
#> Item_8 0.904 -0.353 0 1
#> Item_9 0.875 -0.978 0 1
#> Item_10 0.665 -1.120 0 1
#> Item_11 0.939 1.243 0 1
#> Item_12 1.336 -0.194 0 1
#> Item_13 1.249 0.481 0 1
#> Item_14 1.050 0.444 0 1
#> Item_15 0.778 -0.064 0 1
#>
#> $means
#> F1
#> 0
#>
#> $cov
#> F1
#> F1 1
#>
#>
#> $D2
#> $items
#> a1 d g u
#> Item_1 1.440 0.358 0 1
#> Item_2 1.136 -0.590 0 1
#> Item_3 0.996 -0.237 0 1
#> Item_4 0.902 0.921 0 1
#> Item_5 1.060 0.153 0 1
#> Item_6 0.440 0.637 0 1
#> Item_7 1.170 1.023 0 1
#> Item_8 0.904 -0.353 0 1
#> Item_9 0.875 -0.978 0 1
#> Item_10 0.665 -1.120 0 1
#> Item_11 0.939 1.243 0 1
#> Item_12 1.336 -0.194 0 1
#> Item_13 1.249 0.481 0 1
#> Item_14 1.050 0.444 0 1
#> Item_15 0.778 -0.064 0 1
#>
#> $means
#> F1
#> -0.08
#>
#> $cov
#> F1
#> F1 1.167
#>
#>
RMSD_DIF(pooled_mod)
#>
#>
#> $D1
#> P.0 P.1
#> Item_1 0.056 0.056
#> Item_2 0.018 0.018
#> Item_3 0.014 0.014
#> Item_4 0.019 0.019
#> Item_5 0.010 0.010
#> Item_6 0.021 0.021
#> Item_7 0.016 0.016
#> Item_8 0.017 0.017
#> Item_9 0.019 0.019
#> Item_10 0.018 0.018
#> Item_11 0.013 0.013
#> Item_12 0.014 0.014
#> Item_13 0.018 0.018
#> Item_14 0.009 0.009
#> Item_15 0.011 0.011
#>
#> $D2
#> P.0 P.1
#> Item_1 0.053 0.053
#> Item_2 0.021 0.021
#> Item_3 0.013 0.013
#> Item_4 0.016 0.016
#> Item_5 0.008 0.008
#> Item_6 0.022 0.022
#> Item_7 0.017 0.017
#> Item_8 0.016 0.016
#> Item_9 0.017 0.017
#> Item_10 0.014 0.014
#> Item_11 0.021 0.021
#> Item_12 0.013 0.013
#> Item_13 0.011 0.011
#> Item_14 0.004 0.004
#> Item_15 0.014 0.014
#>
RMSD_DIF(pooled_mod, dentype = 'empirical')
#>
#>
#> $D1
#> P.0 P.1
#> Item_1 0.056 0.056
#> Item_2 0.018 0.018
#> Item_3 0.014 0.014
#> Item_4 0.019 0.019
#> Item_5 0.010 0.010
#> Item_6 0.021 0.021
#> Item_7 0.016 0.016
#> Item_8 0.017 0.017
#> Item_9 0.019 0.019
#> Item_10 0.018 0.018
#> Item_11 0.013 0.013
#> Item_12 0.014 0.014
#> Item_13 0.018 0.018
#> Item_14 0.009 0.009
#> Item_15 0.011 0.011
#>
#> $D2
#> P.0 P.1
#> Item_1 0.052 0.052
#> Item_2 0.021 0.021
#> Item_3 0.013 0.013
#> Item_4 0.016 0.016
#> Item_5 0.009 0.009
#> Item_6 0.022 0.022
#> Item_7 0.017 0.017
#> Item_8 0.016 0.016
#> Item_9 0.017 0.017
#> Item_10 0.014 0.014
#> Item_11 0.021 0.021
#> Item_12 0.013 0.013
#> Item_13 0.011 0.011
#> Item_14 0.004 0.004
#> Item_15 0.014 0.014
#>
RMSD_DIF(pooled_mod, flag = .03)
#>
#>
#> $D1
#> P.0 P.1
#> Item_1 0.056 0.056
#> Item_2 NA NA
#> Item_3 NA NA
#> Item_4 NA NA
#> Item_5 NA NA
#> Item_6 NA NA
#> Item_7 NA NA
#> Item_8 NA NA
#> Item_9 NA NA
#> Item_10 NA NA
#> Item_11 NA NA
#> Item_12 NA NA
#> Item_13 NA NA
#> Item_14 NA NA
#> Item_15 NA NA
#>
#> $D2
#> P.0 P.1
#> Item_1 0.053 0.053
#> Item_2 NA NA
#> Item_3 NA NA
#> Item_4 NA NA
#> Item_5 NA NA
#> Item_6 NA NA
#> Item_7 NA NA
#> Item_8 NA NA
#> Item_9 NA NA
#> Item_10 NA NA
#> Item_11 NA NA
#> Item_12 NA NA
#> Item_13 NA NA
#> Item_14 NA NA
#> Item_15 NA NA
#>
# more freely estimated model (item 1 has 2 parameters estimated)
MGmod <- multipleGroup(dat, 1, group=group,
invariance = c(colnames(dat)[-1], 'free_mean', 'free_var'))
#>
Iteration: 1, Log-Lik: -18331.382, Max-Change: 0.55608
Iteration: 2, Log-Lik: -18208.393, Max-Change: 0.25575
Iteration: 3, Log-Lik: -18193.185, Max-Change: 0.12654
Iteration: 4, Log-Lik: -18190.763, Max-Change: 0.07036
Iteration: 5, Log-Lik: -18190.028, Max-Change: 0.04379
Iteration: 6, Log-Lik: -18189.615, Max-Change: 0.03021
Iteration: 7, Log-Lik: -18189.156, Max-Change: 0.02971
Iteration: 8, Log-Lik: -18188.894, Max-Change: 0.01634
Iteration: 9, Log-Lik: -18188.756, Max-Change: 0.01211
Iteration: 10, Log-Lik: -18188.629, Max-Change: 0.02415
Iteration: 11, Log-Lik: -18188.451, Max-Change: 0.01019
Iteration: 12, Log-Lik: -18188.409, Max-Change: 0.00648
Iteration: 13, Log-Lik: -18188.371, Max-Change: 0.00717
Iteration: 14, Log-Lik: -18188.350, Max-Change: 0.00459
Iteration: 15, Log-Lik: -18188.335, Max-Change: 0.00387
Iteration: 16, Log-Lik: -18188.327, Max-Change: 0.00886
Iteration: 17, Log-Lik: -18188.300, Max-Change: 0.00341
Iteration: 18, Log-Lik: -18188.295, Max-Change: 0.00198
Iteration: 19, Log-Lik: -18188.293, Max-Change: 0.00165
Iteration: 20, Log-Lik: -18188.291, Max-Change: 0.00137
Iteration: 21, Log-Lik: -18188.289, Max-Change: 0.00125
Iteration: 22, Log-Lik: -18188.289, Max-Change: 0.00273
Iteration: 23, Log-Lik: -18188.286, Max-Change: 0.00105
Iteration: 24, Log-Lik: -18188.286, Max-Change: 0.00061
Iteration: 25, Log-Lik: -18188.285, Max-Change: 0.00050
Iteration: 26, Log-Lik: -18188.285, Max-Change: 0.00041
Iteration: 27, Log-Lik: -18188.285, Max-Change: 0.00038
Iteration: 28, Log-Lik: -18188.285, Max-Change: 0.00083
Iteration: 29, Log-Lik: -18188.285, Max-Change: 0.00032
Iteration: 30, Log-Lik: -18188.285, Max-Change: 0.00018
Iteration: 31, Log-Lik: -18188.285, Max-Change: 0.00015
Iteration: 32, Log-Lik: -18188.285, Max-Change: 0.00013
Iteration: 33, Log-Lik: -18188.285, Max-Change: 0.00012
Iteration: 34, Log-Lik: -18188.285, Max-Change: 0.00025
Iteration: 35, Log-Lik: -18188.285, Max-Change: 0.00010
Iteration: 36, Log-Lik: -18188.285, Max-Change: 0.00006
coef(MGmod, simplify=TRUE)
#> $D1
#> $items
#> a1 d g u
#> Item_1 1.071 0.525 0 1
#> Item_2 1.178 -0.615 0 1
#> Item_3 1.031 -0.258 0 1
#> Item_4 0.933 0.902 0 1
#> Item_5 1.099 0.130 0 1
#> Item_6 0.455 0.627 0 1
#> Item_7 1.217 1.001 0 1
#> Item_8 0.926 -0.372 0 1
#> Item_9 0.905 -0.997 0 1
#> Item_10 0.692 -1.136 0 1
#> Item_11 0.967 1.222 0 1
#> Item_12 1.373 -0.222 0 1
#> Item_13 1.302 0.456 0 1
#> Item_14 1.079 0.421 0 1
#> Item_15 0.804 -0.080 0 1
#>
#> $means
#> F1
#> 0
#>
#> $cov
#> F1
#> F1 1
#>
#>
#> $D2
#> $items
#> a1 d g u
#> Item_1 2.100 0.083 0 1
#> Item_2 1.178 -0.615 0 1
#> Item_3 1.031 -0.258 0 1
#> Item_4 0.933 0.902 0 1
#> Item_5 1.099 0.130 0 1
#> Item_6 0.455 0.627 0 1
#> Item_7 1.217 1.001 0 1
#> Item_8 0.926 -0.372 0 1
#> Item_9 0.905 -0.997 0 1
#> Item_10 0.692 -1.136 0 1
#> Item_11 0.967 1.222 0 1
#> Item_12 1.373 -0.222 0 1
#> Item_13 1.302 0.456 0 1
#> Item_14 1.079 0.421 0 1
#> Item_15 0.804 -0.080 0 1
#>
#> $means
#> F1
#> -0.036
#>
#> $cov
#> F1
#> F1 1.033
#>
#>
# RMSD in item.1 now reduced (MG model accounts for DIF)
RMSD_DIF(MGmod)
#>
#>
#> $D1
#> P.0 P.1
#> Item_1 0.007 0.007
#> Item_2 0.015 0.015
#> Item_3 0.017 0.017
#> Item_4 0.015 0.015
#> Item_5 0.009 0.009
#> Item_6 0.020 0.020
#> Item_7 0.010 0.010
#> Item_8 0.020 0.020
#> Item_9 0.017 0.017
#> Item_10 0.018 0.018
#> Item_11 0.017 0.017
#> Item_12 0.010 0.010
#> Item_13 0.017 0.017
#> Item_14 0.013 0.013
#> Item_15 0.011 0.011
#>
#> $D2
#> P.0 P.1
#> Item_1 0.005 0.005
#> Item_2 0.020 0.020
#> Item_3 0.018 0.018
#> Item_4 0.011 0.011
#> Item_5 0.007 0.007
#> Item_6 0.022 0.022
#> Item_7 0.011 0.011
#> Item_8 0.017 0.017
#> Item_9 0.016 0.016
#> Item_10 0.016 0.016
#> Item_11 0.022 0.022
#> Item_12 0.008 0.008
#> Item_13 0.006 0.006
#> Item_14 0.009 0.009
#> Item_15 0.014 0.014
#>
RMSD_DIF(MGmod, flag = .03)
#>
#>
#> $D1
#> P.0 P.1
#> Item_1 NA NA
#> Item_2 NA NA
#> Item_3 NA NA
#> Item_4 NA NA
#> Item_5 NA NA
#> Item_6 NA NA
#> Item_7 NA NA
#> Item_8 NA NA
#> Item_9 NA NA
#> Item_10 NA NA
#> Item_11 NA NA
#> Item_12 NA NA
#> Item_13 NA NA
#> Item_14 NA NA
#> Item_15 NA NA
#>
#> $D2
#> P.0 P.1
#> Item_1 NA NA
#> Item_2 NA NA
#> Item_3 NA NA
#> Item_4 NA NA
#> Item_5 NA NA
#> Item_6 NA NA
#> Item_7 NA NA
#> Item_8 NA NA
#> Item_9 NA NA
#> Item_10 NA NA
#> Item_11 NA NA
#> Item_12 NA NA
#> Item_13 NA NA
#> Item_14 NA NA
#> Item_15 NA NA
#>
#################
# NA placeholders included when groups do not respond to specific items
a1 <- a2 <- rlnorm(20)
d <- d2 <- rnorm(20)
# item 5 contains DIF
a2[5] <- a1[5] + 1
d2[5] <- d[5] - 1/2
g <- rbeta(20, 5, 17)
dat1 <- simdata(a1, d, guess = g, N=1000, itemtype = '3PL')
dat1[, 11:13] <- NA # items 11:13 items NA for g1
dat2 <- simdata(a2, d2, guess = g, N=1000, itemtype = '3PL',
mu=1/4, sigma=matrix(.75))
dat2[,1:3] <- NA # items 1:3 items NA for g2
dat <- rbind(dat1, dat2)
group <- c(rep('g1', 1000), rep('g2', 1000))
mod <- multipleGroup(dat, "Theta = 1-20
PRIOR = (1-20, g, norm, -1, 0.5)",
group=group, itemtype='3PL',
invariance = c(colnames(dat), 'free_mean', 'free_var'))
#>
Iteration: 1, Log-Lik: -21884.168, Max-Change: 1.61382
Iteration: 2, Log-Lik: -20409.493, Max-Change: 0.40807
Iteration: 3, Log-Lik: -20272.212, Max-Change: 0.25413
Iteration: 4, Log-Lik: -20228.469, Max-Change: 0.16155
Iteration: 5, Log-Lik: -20205.615, Max-Change: 0.11590
Iteration: 6, Log-Lik: -20190.352, Max-Change: 0.11385
Iteration: 7, Log-Lik: -20178.951, Max-Change: 0.10215
Iteration: 8, Log-Lik: -20170.270, Max-Change: 0.09386
Iteration: 9, Log-Lik: -20163.454, Max-Change: 0.08167
Iteration: 10, Log-Lik: -20158.068, Max-Change: 0.08075
Iteration: 11, Log-Lik: -20153.683, Max-Change: 0.07296
Iteration: 12, Log-Lik: -20150.220, Max-Change: 0.05975
Iteration: 13, Log-Lik: -20144.567, Max-Change: 0.04992
Iteration: 14, Log-Lik: -20142.039, Max-Change: 0.04108
Iteration: 15, Log-Lik: -20140.785, Max-Change: 0.03961
Iteration: 16, Log-Lik: -20138.752, Max-Change: 0.04866
Iteration: 17, Log-Lik: -20136.745, Max-Change: 0.01487
Iteration: 18, Log-Lik: -20136.412, Max-Change: 0.01870
Iteration: 19, Log-Lik: -20136.028, Max-Change: 0.01421
Iteration: 20, Log-Lik: -20135.837, Max-Change: 0.01551
Iteration: 21, Log-Lik: -20135.702, Max-Change: 0.01495
Iteration: 22, Log-Lik: -20135.497, Max-Change: 0.01517
Iteration: 23, Log-Lik: -20135.266, Max-Change: 0.00530
Iteration: 24, Log-Lik: -20135.226, Max-Change: 0.00649
Iteration: 25, Log-Lik: -20135.180, Max-Change: 0.00478
Iteration: 26, Log-Lik: -20135.157, Max-Change: 0.00538
Iteration: 27, Log-Lik: -20135.141, Max-Change: 0.00528
Iteration: 28, Log-Lik: -20135.118, Max-Change: 0.00480
Iteration: 29, Log-Lik: -20135.091, Max-Change: 0.00192
Iteration: 30, Log-Lik: -20135.085, Max-Change: 0.00229
Iteration: 31, Log-Lik: -20135.079, Max-Change: 0.00174
Iteration: 32, Log-Lik: -20135.076, Max-Change: 0.00198
Iteration: 33, Log-Lik: -20135.074, Max-Change: 0.00191
Iteration: 34, Log-Lik: -20135.071, Max-Change: 0.00154
Iteration: 35, Log-Lik: -20135.068, Max-Change: 0.00080
Iteration: 36, Log-Lik: -20135.067, Max-Change: 0.00086
Iteration: 37, Log-Lik: -20135.066, Max-Change: 0.00063
Iteration: 38, Log-Lik: -20135.066, Max-Change: 0.00075
Iteration: 39, Log-Lik: -20135.065, Max-Change: 0.00073
Iteration: 40, Log-Lik: -20135.065, Max-Change: 0.00066
Iteration: 41, Log-Lik: -20135.064, Max-Change: 0.00037
Iteration: 42, Log-Lik: -20135.064, Max-Change: 0.00034
Iteration: 43, Log-Lik: -20135.064, Max-Change: 0.00027
Iteration: 44, Log-Lik: -20135.064, Max-Change: 0.00032
Iteration: 45, Log-Lik: -20135.064, Max-Change: 0.00038
Iteration: 46, Log-Lik: -20135.064, Max-Change: 0.00032
Iteration: 47, Log-Lik: -20135.064, Max-Change: 0.00017
Iteration: 48, Log-Lik: -20135.064, Max-Change: 0.00014
Iteration: 49, Log-Lik: -20135.064, Max-Change: 0.00013
Iteration: 50, Log-Lik: -20135.064, Max-Change: 0.00016
Iteration: 51, Log-Lik: -20135.064, Max-Change: 0.00013
Iteration: 52, Log-Lik: -20135.064, Max-Change: 0.00013
Iteration: 53, Log-Lik: -20135.064, Max-Change: 0.00009
coef(mod, simplify = TRUE)
#> $g1
#> $items
#> a1 d g u
#> Item_1 0.958 0.962 0.281 1
#> Item_2 0.476 -1.243 0.223 1
#> Item_3 1.459 -1.321 0.331 1
#> Item_4 1.685 0.851 0.227 1
#> Item_5 3.014 -0.148 0.264 1
#> Item_6 0.436 -1.155 0.254 1
#> Item_7 2.134 -2.246 0.145 1
#> Item_8 0.532 0.633 0.262 1
#> Item_9 1.011 0.449 0.258 1
#> Item_10 2.458 -0.681 0.176 1
#> Item_11 1.398 -0.124 0.252 1
#> Item_12 0.180 0.329 0.269 1
#> Item_13 0.809 0.736 0.292 1
#> Item_14 0.674 0.518 0.270 1
#> Item_15 2.931 -1.035 0.280 1
#> Item_16 0.418 0.595 0.256 1
#> Item_17 0.413 -0.241 0.253 1
#> Item_18 2.136 0.899 0.287 1
#> Item_19 -0.208 -2.328 0.277 1
#> Item_20 0.538 -0.132 0.262 1
#>
#> $means
#> Theta
#> 0
#>
#> $cov
#> Theta
#> Theta 1
#>
#>
#> $g2
#> $items
#> a1 d g u
#> Item_1 0.958 0.962 0.281 1
#> Item_2 0.476 -1.243 0.223 1
#> Item_3 1.459 -1.321 0.331 1
#> Item_4 1.685 0.851 0.227 1
#> Item_5 3.014 -0.148 0.264 1
#> Item_6 0.436 -1.155 0.254 1
#> Item_7 2.134 -2.246 0.145 1
#> Item_8 0.532 0.633 0.262 1
#> Item_9 1.011 0.449 0.258 1
#> Item_10 2.458 -0.681 0.176 1
#> Item_11 1.398 -0.124 0.252 1
#> Item_12 0.180 0.329 0.269 1
#> Item_13 0.809 0.736 0.292 1
#> Item_14 0.674 0.518 0.270 1
#> Item_15 2.931 -1.035 0.280 1
#> Item_16 0.418 0.595 0.256 1
#> Item_17 0.413 -0.241 0.253 1
#> Item_18 2.136 0.899 0.287 1
#> Item_19 -0.208 -2.328 0.277 1
#> Item_20 0.538 -0.132 0.262 1
#>
#> $means
#> Theta
#> 0.294
#>
#> $cov
#> Theta
#> Theta 0.744
#>
#>
RMSD_DIF(mod)
#>
#>
#> $g1
#> P.0 P.1
#> Item_1 0.004 0.004
#> Item_2 0.020 0.020
#> Item_3 0.009 0.009
#> Item_4 0.014 0.014
#> Item_5 0.028 0.028
#> Item_6 0.018 0.018
#> Item_7 0.019 0.019
#> Item_8 0.017 0.017
#> Item_9 0.016 0.016
#> Item_10 0.006 0.006
#> Item_11 NA NA
#> Item_12 NA NA
#> Item_13 NA NA
#> Item_14 0.009 0.009
#> Item_15 0.013 0.013
#> Item_16 0.020 0.020
#> Item_17 0.023 0.023
#> Item_18 0.004 0.004
#> Item_19 0.027 0.027
#> Item_20 0.009 0.009
#>
#> $g2
#> P.0 P.1
#> Item_1 NA NA
#> Item_2 NA NA
#> Item_3 NA NA
#> Item_4 0.014 0.014
#> Item_5 0.029 0.029
#> Item_6 0.014 0.014
#> Item_7 0.020 0.020
#> Item_8 0.019 0.019
#> Item_9 0.018 0.018
#> Item_10 0.011 0.011
#> Item_11 0.005 0.005
#> Item_12 0.007 0.007
#> Item_13 0.014 0.014
#> Item_14 0.006 0.006
#> Item_15 0.014 0.014
#> Item_16 0.026 0.026
#> Item_17 0.023 0.023
#> Item_18 0.008 0.008
#> Item_19 0.014 0.014
#> Item_20 0.010 0.010
#>
RMSD_DIF(mod, flag = .03)
#>
#>
#> $g1
#> P.0 P.1
#> Item_1 NA NA
#> Item_2 NA NA
#> Item_3 NA NA
#> Item_4 NA NA
#> Item_5 NA NA
#> Item_6 NA NA
#> Item_7 NA NA
#> Item_8 NA NA
#> Item_9 NA NA
#> Item_10 NA NA
#> Item_11 NA NA
#> Item_12 NA NA
#> Item_13 NA NA
#> Item_14 NA NA
#> Item_15 NA NA
#> Item_16 NA NA
#> Item_17 NA NA
#> Item_18 NA NA
#> Item_19 NA NA
#> Item_20 NA NA
#>
#> $g2
#> P.0 P.1
#> Item_1 NA NA
#> Item_2 NA NA
#> Item_3 NA NA
#> Item_4 NA NA
#> Item_5 NA NA
#> Item_6 NA NA
#> Item_7 NA NA
#> Item_8 NA NA
#> Item_9 NA NA
#> Item_10 NA NA
#> Item_11 NA NA
#> Item_12 NA NA
#> Item_13 NA NA
#> Item_14 NA NA
#> Item_15 NA NA
#> Item_16 NA NA
#> Item_17 NA NA
#> Item_18 NA NA
#> Item_19 NA NA
#> Item_20 NA NA
#>
#################
# polytomous example
set.seed(12345)
a <- a2 <- matrix(rlnorm(20,.2,.3))
# for the graded model, ensure that there is enough space between the intercepts,
# otherwise closer categories will not be selected often (minimum distance of 0.3 here)
diffs <- t(apply(matrix(runif(20*4, .3, 1), 20), 1, cumsum))
diffs <- -(diffs - rowMeans(diffs))
d <- d2 <- diffs + rnorm(20)
# item 1 has slope + dif for first intercept parameter
d2[1] <- d[1] - .5
a2[1] <- a[1] + 1
itemtype <- rep('graded', nrow(a))
N <- 1000
dataset1 <- simdata(a, d, N, itemtype)
dataset2 <- simdata(a2, d2, N, itemtype)
dat <- rbind(dataset1, dataset2)
group <- c(rep('D1', N), rep('D2', N))
#-----
# fully pooled model
pooled_mod <- multipleGroup(dat, 1, group=group,
invariance = c(colnames(dat), 'free_mean', 'free_var'))
#>
Iteration: 1, Log-Lik: -48773.929, Max-Change: 0.62112
Iteration: 2, Log-Lik: -48318.453, Max-Change: 0.18568
Iteration: 3, Log-Lik: -48291.828, Max-Change: 0.07475
Iteration: 4, Log-Lik: -48285.904, Max-Change: 0.05773
Iteration: 5, Log-Lik: -48281.996, Max-Change: 0.05445
Iteration: 6, Log-Lik: -48278.941, Max-Change: 0.04783
Iteration: 7, Log-Lik: -48273.282, Max-Change: 0.17679
Iteration: 8, Log-Lik: -48269.018, Max-Change: 0.03458
Iteration: 9, Log-Lik: -48268.510, Max-Change: 0.01775
Iteration: 10, Log-Lik: -48267.866, Max-Change: 0.02561
Iteration: 11, Log-Lik: -48267.597, Max-Change: 0.01236
Iteration: 12, Log-Lik: -48267.409, Max-Change: 0.00980
Iteration: 13, Log-Lik: -48267.043, Max-Change: 0.03808
Iteration: 14, Log-Lik: -48266.763, Max-Change: 0.00830
Iteration: 15, Log-Lik: -48266.727, Max-Change: 0.00433
Iteration: 16, Log-Lik: -48266.677, Max-Change: 0.00707
Iteration: 17, Log-Lik: -48266.657, Max-Change: 0.00315
Iteration: 18, Log-Lik: -48266.644, Max-Change: 0.00244
Iteration: 19, Log-Lik: -48266.619, Max-Change: 0.00960
Iteration: 20, Log-Lik: -48266.600, Max-Change: 0.00215
Iteration: 21, Log-Lik: -48266.597, Max-Change: 0.00113
Iteration: 22, Log-Lik: -48266.593, Max-Change: 0.00190
Iteration: 23, Log-Lik: -48266.592, Max-Change: 0.00083
Iteration: 24, Log-Lik: -48266.591, Max-Change: 0.00064
Iteration: 25, Log-Lik: -48266.589, Max-Change: 0.00252
Iteration: 26, Log-Lik: -48266.588, Max-Change: 0.00057
Iteration: 27, Log-Lik: -48266.588, Max-Change: 0.00030
Iteration: 28, Log-Lik: -48266.587, Max-Change: 0.00051
Iteration: 29, Log-Lik: -48266.587, Max-Change: 0.00022
Iteration: 30, Log-Lik: -48266.587, Max-Change: 0.00017
Iteration: 31, Log-Lik: -48266.587, Max-Change: 0.00067
Iteration: 32, Log-Lik: -48266.587, Max-Change: 0.00015
Iteration: 33, Log-Lik: -48266.587, Max-Change: 0.00008
coef(pooled_mod, simplify=TRUE)
#> $D1
#> $items
#> a1 d1 d2 d3 d4
#> Item_1 1.708 1.205 0.527 -0.453 -0.948
#> Item_2 1.517 -0.518 -0.992 -1.653 -2.434
#> Item_3 1.187 1.757 0.681 0.375 -0.638
#> Item_4 1.167 2.719 1.868 1.539 0.808
#> Item_5 1.410 0.485 -0.466 -0.867 -1.581
#> Item_6 0.683 -0.984 -1.396 -1.940 -2.910
#> Item_7 1.387 2.128 1.234 0.341 -0.386
#> Item_8 0.985 2.332 1.994 1.374 0.440
#> Item_9 1.043 1.597 0.850 0.024 -0.373
#> Item_10 0.906 -0.284 -1.281 -1.573 -2.038
#> Item_11 1.128 1.269 0.470 -0.460 -1.184
#> Item_12 2.016 0.268 -0.318 -1.128 -1.716
#> Item_13 1.356 -0.202 -0.835 -1.233 -2.016
#> Item_14 1.261 3.169 2.582 1.916 1.334
#> Item_15 0.928 2.307 1.957 1.151 0.268
#> Item_16 1.479 2.080 1.345 0.682 -0.305
#> Item_17 0.815 2.163 1.208 0.410 -0.557
#> Item_18 1.113 0.333 -0.481 -1.357 -2.072
#> Item_19 1.604 1.256 0.584 0.240 -0.145
#> Item_20 1.333 1.876 1.439 0.858 0.241
#>
#> $means
#> F1
#> 0
#>
#> $cov
#> F1
#> F1 1
#>
#>
#> $D2
#> $items
#> a1 d1 d2 d3 d4
#> Item_1 1.708 1.205 0.527 -0.453 -0.948
#> Item_2 1.517 -0.518 -0.992 -1.653 -2.434
#> Item_3 1.187 1.757 0.681 0.375 -0.638
#> Item_4 1.167 2.719 1.868 1.539 0.808
#> Item_5 1.410 0.485 -0.466 -0.867 -1.581
#> Item_6 0.683 -0.984 -1.396 -1.940 -2.910
#> Item_7 1.387 2.128 1.234 0.341 -0.386
#> Item_8 0.985 2.332 1.994 1.374 0.440
#> Item_9 1.043 1.597 0.850 0.024 -0.373
#> Item_10 0.906 -0.284 -1.281 -1.573 -2.038
#> Item_11 1.128 1.269 0.470 -0.460 -1.184
#> Item_12 2.016 0.268 -0.318 -1.128 -1.716
#> Item_13 1.356 -0.202 -0.835 -1.233 -2.016
#> Item_14 1.261 3.169 2.582 1.916 1.334
#> Item_15 0.928 2.307 1.957 1.151 0.268
#> Item_16 1.479 2.080 1.345 0.682 -0.305
#> Item_17 0.815 2.163 1.208 0.410 -0.557
#> Item_18 1.113 0.333 -0.481 -1.357 -2.072
#> Item_19 1.604 1.256 0.584 0.240 -0.145
#> Item_20 1.333 1.876 1.439 0.858 0.241
#>
#> $means
#> F1
#> -0.022
#>
#> $cov
#> F1
#> F1 1.182
#>
#>
# Item_1 fits poorly in several categories (RMSD > .05)
RMSD_DIF(pooled_mod)
#>
#>
#> $D1
#> P.1 P.2 P.3 P.4 P.5
#> Item_1 0.088 0.057 0.024 0.023 0.037
#> Item_2 0.014 0.008 0.010 0.011 0.012
#> Item_3 0.019 0.019 0.015 0.017 0.027
#> Item_4 0.024 0.010 0.010 0.014 0.028
#> Item_5 0.030 0.017 0.006 0.023 0.021
#> Item_6 0.010 0.015 0.015 0.019 0.016
#> Item_7 0.016 0.015 0.020 0.015 0.019
#> Item_8 0.014 0.008 0.012 0.021 0.022
#> Item_9 0.019 0.031 0.022 0.014 0.028
#> Item_10 0.025 0.015 0.010 0.011 0.032
#> Item_11 0.012 0.017 0.015 0.011 0.015
#> Item_12 0.013 0.011 0.021 0.013 0.018
#> Item_13 0.023 0.013 0.018 0.021 0.014
#> Item_14 0.009 0.011 0.005 0.022 0.029
#> Item_15 0.015 0.011 0.016 0.010 0.028
#> Item_16 0.016 0.025 0.020 0.022 0.012
#> Item_17 0.025 0.015 0.020 0.023 0.031
#> Item_18 0.016 0.015 0.017 0.016 0.023
#> Item_19 0.019 0.022 0.016 0.013 0.013
#> Item_20 0.033 0.011 0.012 0.012 0.025
#>
#> $D2
#> P.1 P.2 P.3 P.4 P.5
#> Item_1 0.101 0.059 0.036 0.018 0.040
#> Item_2 0.007 0.013 0.005 0.012 0.011
#> Item_3 0.035 0.028 0.017 0.030 0.016
#> Item_4 0.011 0.020 0.012 0.011 0.027
#> Item_5 0.017 0.017 0.010 0.013 0.016
#> Item_6 0.026 0.011 0.007 0.016 0.014
#> Item_7 0.017 0.013 0.017 0.019 0.020
#> Item_8 0.021 0.016 0.016 0.017 0.030
#> Item_9 0.019 0.016 0.014 0.015 0.020
#> Item_10 0.020 0.014 0.014 0.018 0.028
#> Item_11 0.018 0.021 0.017 0.013 0.019
#> Item_12 0.013 0.010 0.022 0.007 0.015
#> Item_13 0.018 0.013 0.013 0.012 0.017
#> Item_14 0.026 0.007 0.023 0.012 0.008
#> Item_15 0.019 0.010 0.014 0.017 0.023
#> Item_16 0.015 0.019 0.019 0.018 0.013
#> Item_17 0.017 0.018 0.028 0.024 0.012
#> Item_18 0.024 0.022 0.025 0.017 0.028
#> Item_19 0.027 0.017 0.014 0.009 0.024
#> Item_20 0.025 0.013 0.014 0.011 0.018
#>
RMSD_DIF(pooled_mod, flag = .05)
#>
#>
#> $D1
#> P.1 P.2 P.3 P.4 P.5
#> Item_1 0.088 0.057 NA NA NA
#> Item_2 NA NA NA NA NA
#> Item_3 NA NA NA NA NA
#> Item_4 NA NA NA NA NA
#> Item_5 NA NA NA NA NA
#> Item_6 NA NA NA NA NA
#> Item_7 NA NA NA NA NA
#> Item_8 NA NA NA NA NA
#> Item_9 NA NA NA NA NA
#> Item_10 NA NA NA NA NA
#> Item_11 NA NA NA NA NA
#> Item_12 NA NA NA NA NA
#> Item_13 NA NA NA NA NA
#> Item_14 NA NA NA NA NA
#> Item_15 NA NA NA NA NA
#> Item_16 NA NA NA NA NA
#> Item_17 NA NA NA NA NA
#> Item_18 NA NA NA NA NA
#> Item_19 NA NA NA NA NA
#> Item_20 NA NA NA NA NA
#>
#> $D2
#> P.1 P.2 P.3 P.4 P.5
#> Item_1 0.101 0.059 NA NA NA
#> Item_2 NA NA NA NA NA
#> Item_3 NA NA NA NA NA
#> Item_4 NA NA NA NA NA
#> Item_5 NA NA NA NA NA
#> Item_6 NA NA NA NA NA
#> Item_7 NA NA NA NA NA
#> Item_8 NA NA NA NA NA
#> Item_9 NA NA NA NA NA
#> Item_10 NA NA NA NA NA
#> Item_11 NA NA NA NA NA
#> Item_12 NA NA NA NA NA
#> Item_13 NA NA NA NA NA
#> Item_14 NA NA NA NA NA
#> Item_15 NA NA NA NA NA
#> Item_16 NA NA NA NA NA
#> Item_17 NA NA NA NA NA
#> Item_18 NA NA NA NA NA
#> Item_19 NA NA NA NA NA
#> Item_20 NA NA NA NA NA
#>
RMSD_DIF(pooled_mod, flag = .1, probfun = FALSE) # use expected score function
#>
#>
#> $D1
#> S(theta)
#> Item_1 0.184
#> Item_2 NA
#> Item_3 NA
#> Item_4 0.106
#> Item_5 NA
#> Item_6 NA
#> Item_7 NA
#> Item_8 NA
#> Item_9 NA
#> Item_10 NA
#> Item_11 NA
#> Item_12 NA
#> Item_13 NA
#> Item_14 NA
#> Item_15 NA
#> Item_16 NA
#> Item_17 0.101
#> Item_18 NA
#> Item_19 NA
#> Item_20 0.102
#>
#> $D2
#> S(theta)
#> Item_1 0.211
#> Item_2 NA
#> Item_3 NA
#> Item_4 NA
#> Item_5 NA
#> Item_6 NA
#> Item_7 NA
#> Item_8 NA
#> Item_9 NA
#> Item_10 NA
#> Item_11 NA
#> Item_12 NA
#> Item_13 NA
#> Item_14 NA
#> Item_15 NA
#> Item_16 NA
#> Item_17 NA
#> Item_18 NA
#> Item_19 NA
#> Item_20 NA
#>
# more freely estimated model (item 1 has more parameters estimated)
MGmod <- multipleGroup(dat, 1, group=group,
invariance = c(colnames(dat)[-1], 'free_mean', 'free_var'))
#>
Iteration: 1, Log-Lik: -48773.929, Max-Change: 0.80189
Iteration: 2, Log-Lik: -48255.266, Max-Change: 0.22359
Iteration: 3, Log-Lik: -48228.026, Max-Change: 0.10343
Iteration: 4, Log-Lik: -48220.436, Max-Change: 0.06735
Iteration: 5, Log-Lik: -48215.202, Max-Change: 0.06147
Iteration: 6, Log-Lik: -48211.104, Max-Change: 0.05347
Iteration: 7, Log-Lik: -48203.573, Max-Change: 0.19222
Iteration: 8, Log-Lik: -48197.872, Max-Change: 0.03763
Iteration: 9, Log-Lik: -48197.182, Max-Change: 0.01942
Iteration: 10, Log-Lik: -48196.303, Max-Change: 0.02822
Iteration: 11, Log-Lik: -48195.939, Max-Change: 0.01333
Iteration: 12, Log-Lik: -48195.687, Max-Change: 0.01131
Iteration: 13, Log-Lik: -48195.204, Max-Change: 0.04020
Iteration: 14, Log-Lik: -48194.830, Max-Change: 0.00889
Iteration: 15, Log-Lik: -48194.781, Max-Change: 0.00496
Iteration: 16, Log-Lik: -48194.711, Max-Change: 0.00801
Iteration: 17, Log-Lik: -48194.683, Max-Change: 0.00337
Iteration: 18, Log-Lik: -48194.666, Max-Change: 0.00300
Iteration: 19, Log-Lik: -48194.633, Max-Change: 0.00996
Iteration: 20, Log-Lik: -48194.608, Max-Change: 0.00228
Iteration: 21, Log-Lik: -48194.604, Max-Change: 0.00132
Iteration: 22, Log-Lik: -48194.599, Max-Change: 0.00213
Iteration: 23, Log-Lik: -48194.597, Max-Change: 0.00088
Iteration: 24, Log-Lik: -48194.596, Max-Change: 0.00078
Iteration: 25, Log-Lik: -48194.594, Max-Change: 0.00259
Iteration: 26, Log-Lik: -48194.592, Max-Change: 0.00060
Iteration: 27, Log-Lik: -48194.592, Max-Change: 0.00035
Iteration: 28, Log-Lik: -48194.591, Max-Change: 0.00057
Iteration: 29, Log-Lik: -48194.591, Max-Change: 0.00023
Iteration: 30, Log-Lik: -48194.591, Max-Change: 0.00021
Iteration: 31, Log-Lik: -48194.591, Max-Change: 0.00068
Iteration: 32, Log-Lik: -48194.591, Max-Change: 0.00016
Iteration: 33, Log-Lik: -48194.591, Max-Change: 0.00008
coef(MGmod, simplify=TRUE)
#> $D1
#> $items
#> a1 d1 d2 d3 d4
#> Item_1 1.293 1.471 0.527 -0.408 -0.925
#> Item_2 1.553 -0.527 -1.000 -1.659 -2.439
#> Item_3 1.226 1.754 0.675 0.368 -0.647
#> Item_4 1.201 2.716 1.864 1.535 0.802
#> Item_5 1.447 0.476 -0.475 -0.876 -1.590
#> Item_6 0.702 -0.989 -1.400 -1.944 -2.915
#> Item_7 1.426 2.122 1.227 0.333 -0.395
#> Item_8 1.009 2.325 1.987 1.368 0.433
#> Item_9 1.076 1.593 0.846 0.018 -0.380
#> Item_10 0.936 -0.290 -1.289 -1.581 -2.047
#> Item_11 1.157 1.261 0.463 -0.467 -1.191
#> Item_12 2.070 0.255 -0.331 -1.141 -1.728
#> Item_13 1.392 -0.211 -0.844 -1.242 -2.025
#> Item_14 1.290 3.158 2.571 1.906 1.324
#> Item_15 0.952 2.301 1.951 1.145 0.262
#> Item_16 1.516 2.070 1.334 0.671 -0.314
#> Item_17 0.835 2.158 1.202 0.405 -0.562
#> Item_18 1.141 0.326 -0.487 -1.363 -2.078
#> Item_19 1.643 1.245 0.573 0.230 -0.155
#> Item_20 1.371 1.869 1.432 0.851 0.234
#>
#> $means
#> F1
#> 0
#>
#> $cov
#> F1
#> F1 1
#>
#>
#> $D2
#> $items
#> a1 d1 d2 d3 d4
#> Item_1 2.523 0.906 0.520 -0.587 -1.079
#> Item_2 1.553 -0.527 -1.000 -1.659 -2.439
#> Item_3 1.226 1.754 0.675 0.368 -0.647
#> Item_4 1.201 2.716 1.864 1.535 0.802
#> Item_5 1.447 0.476 -0.475 -0.876 -1.590
#> Item_6 0.702 -0.989 -1.400 -1.944 -2.915
#> Item_7 1.426 2.122 1.227 0.333 -0.395
#> Item_8 1.009 2.325 1.987 1.368 0.433
#> Item_9 1.076 1.593 0.846 0.018 -0.380
#> Item_10 0.936 -0.290 -1.289 -1.581 -2.047
#> Item_11 1.157 1.261 0.463 -0.467 -1.191
#> Item_12 2.070 0.255 -0.331 -1.141 -1.728
#> Item_13 1.392 -0.211 -0.844 -1.242 -2.025
#> Item_14 1.290 3.158 2.571 1.906 1.324
#> Item_15 0.952 2.301 1.951 1.145 0.262
#> Item_16 1.516 2.070 1.334 0.671 -0.314
#> Item_17 0.835 2.158 1.202 0.405 -0.562
#> Item_18 1.141 0.326 -0.487 -1.363 -2.078
#> Item_19 1.643 1.245 0.573 0.230 -0.155
#> Item_20 1.371 1.869 1.432 0.851 0.234
#>
#> $means
#> F1
#> -0.009
#>
#> $cov
#> F1
#> F1 1.071
#>
#>
# RMSDs in Item_1 now reduced (MG model better accounts for DIF)
RMSD_DIF(MGmod)
#>
#>
#> $D1
#> P.1 P.2 P.3 P.4 P.5
#> Item_1 0.007 0.019 0.017 0.016 0.010
#> Item_2 0.016 0.009 0.009 0.011 0.015
#> Item_3 0.016 0.018 0.014 0.018 0.025
#> Item_4 0.021 0.010 0.010 0.014 0.022
#> Item_5 0.028 0.017 0.007 0.022 0.022
#> Item_6 0.009 0.016 0.015 0.018 0.015
#> Item_7 0.016 0.013 0.021 0.015 0.018
#> Item_8 0.012 0.008 0.012 0.022 0.021
#> Item_9 0.016 0.029 0.023 0.014 0.025
#> Item_10 0.023 0.015 0.010 0.011 0.031
#> Item_11 0.016 0.018 0.015 0.011 0.015
#> Item_12 0.010 0.010 0.022 0.012 0.020
#> Item_13 0.019 0.011 0.017 0.021 0.016
#> Item_14 0.012 0.010 0.005 0.023 0.032
#> Item_15 0.015 0.011 0.016 0.011 0.028
#> Item_16 0.013 0.024 0.020 0.022 0.015
#> Item_17 0.024 0.015 0.019 0.024 0.030
#> Item_18 0.019 0.016 0.017 0.016 0.020
#> Item_19 0.021 0.022 0.016 0.013 0.013
#> Item_20 0.029 0.011 0.012 0.012 0.022
#>
#> $D2
#> P.1 P.2 P.3 P.4 P.5
#> Item_1 0.026 0.003 0.019 0.007 0.010
#> Item_2 0.008 0.013 0.004 0.012 0.014
#> Item_3 0.032 0.027 0.016 0.031 0.014
#> Item_4 0.009 0.019 0.011 0.011 0.023
#> Item_5 0.021 0.017 0.010 0.014 0.017
#> Item_6 0.026 0.012 0.007 0.016 0.014
#> Item_7 0.020 0.013 0.019 0.018 0.018
#> Item_8 0.021 0.015 0.017 0.017 0.026
#> Item_9 0.017 0.015 0.015 0.015 0.019
#> Item_10 0.018 0.014 0.014 0.018 0.027
#> Item_11 0.020 0.021 0.017 0.013 0.017
#> Item_12 0.010 0.010 0.022 0.007 0.017
#> Item_13 0.015 0.012 0.013 0.013 0.014
#> Item_14 0.028 0.007 0.022 0.013 0.009
#> Item_15 0.018 0.010 0.015 0.017 0.024
#> Item_16 0.014 0.019 0.018 0.017 0.016
#> Item_17 0.017 0.017 0.028 0.025 0.013
#> Item_18 0.029 0.022 0.025 0.019 0.025
#> Item_19 0.027 0.016 0.015 0.010 0.024
#> Item_20 0.019 0.013 0.014 0.012 0.014
#>
RMSD_DIF(MGmod, flag = .05)
#>
#>
#> $D1
#> P.1 P.2 P.3 P.4 P.5
#> Item_1 NA NA NA NA NA
#> Item_2 NA NA NA NA NA
#> Item_3 NA NA NA NA NA
#> Item_4 NA NA NA NA NA
#> Item_5 NA NA NA NA NA
#> Item_6 NA NA NA NA NA
#> Item_7 NA NA NA NA NA
#> Item_8 NA NA NA NA NA
#> Item_9 NA NA NA NA NA
#> Item_10 NA NA NA NA NA
#> Item_11 NA NA NA NA NA
#> Item_12 NA NA NA NA NA
#> Item_13 NA NA NA NA NA
#> Item_14 NA NA NA NA NA
#> Item_15 NA NA NA NA NA
#> Item_16 NA NA NA NA NA
#> Item_17 NA NA NA NA NA
#> Item_18 NA NA NA NA NA
#> Item_19 NA NA NA NA NA
#> Item_20 NA NA NA NA NA
#>
#> $D2
#> P.1 P.2 P.3 P.4 P.5
#> Item_1 NA NA NA NA NA
#> Item_2 NA NA NA NA NA
#> Item_3 NA NA NA NA NA
#> Item_4 NA NA NA NA NA
#> Item_5 NA NA NA NA NA
#> Item_6 NA NA NA NA NA
#> Item_7 NA NA NA NA NA
#> Item_8 NA NA NA NA NA
#> Item_9 NA NA NA NA NA
#> Item_10 NA NA NA NA NA
#> Item_11 NA NA NA NA NA
#> Item_12 NA NA NA NA NA
#> Item_13 NA NA NA NA NA
#> Item_14 NA NA NA NA NA
#> Item_15 NA NA NA NA NA
#> Item_16 NA NA NA NA NA
#> Item_17 NA NA NA NA NA
#> Item_18 NA NA NA NA NA
#> Item_19 NA NA NA NA NA
#> Item_20 NA NA NA NA NA
#>
RMSD_DIF(MGmod, probfun = FALSE, flag = .1) # use expected score function
#>
#>
#> $D1
#> S(theta)
#> Item_1 NA
#> Item_2 NA
#> Item_3 NA
#> Item_4 NA
#> Item_5 NA
#> Item_6 NA
#> Item_7 NA
#> Item_8 NA
#> Item_9 NA
#> Item_10 NA
#> Item_11 NA
#> Item_12 NA
#> Item_13 NA
#> Item_14 NA
#> Item_15 NA
#> Item_16 NA
#> Item_17 0.104
#> Item_18 NA
#> Item_19 NA
#> Item_20 NA
#>
#> $D2
#> S(theta)
#> Item_1 NA
#> Item_2 NA
#> Item_3 NA
#> Item_4 NA
#> Item_5 NA
#> Item_6 NA
#> Item_7 NA
#> Item_8 NA
#> Item_9 NA
#> Item_10 NA
#> Item_11 NA
#> Item_12 NA
#> Item_13 NA
#> Item_14 NA
#> Item_15 NA
#> Item_16 NA
#> Item_17 NA
#> Item_18 NA
#> Item_19 NA
#> Item_20 NA
#>
# }