boot.mirt {mirt} | R Documentation |
Given an internal mirt object estimate the bootstrapped standard errors. It may
be beneficial to run the computations using multi-core architecture (e.g., the parallel
package). Parameters are organized from the freely estimated values in mod2values(x)
(equality constraints will also be returned in the bootstrapped estimates).
boot.mirt(x, R = 100, boot.fun = NULL, technical = NULL, ...)
x |
an estimated model object |
R |
number of draws to use (passed to the |
boot.fun |
a user-defined function used to extract the information from the bootstrap
fitted models. Must be of the form |
technical |
technical arguments passed to estimation engine. See |
... |
additional arguments to be passed on to |
Phil Chalmers rphilip.chalmers@gmail.com
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
## No test:
# standard
mod <- mirt(Science, 1)
booted <- boot.mirt(mod, R=20)
plot(booted)
booted
##
## ORDINARY NONPARAMETRIC BOOTSTRAP
##
##
## Call:
## boot.mirt(x = mod, R = 20)
##
##
## Bootstrap Statistics :
## original bias std. error
## t1* 1.0417547 0.035916189 0.2036855
## t2* 4.8641542 0.169899781 0.5930891
## t3* 2.6399417 0.079353414 0.2358509
## t4* -1.4660135 0.001211466 0.1208381
## t5* 1.2259618 -0.006060488 0.2053956
## t6* 2.9240027 0.048583273 0.2227714
## t7* 0.9011651 0.012589819 0.1598286
## t8* -2.2665647 0.048168504 0.1482915
## t9* 2.2933717 0.409534684 1.3719391
## t10* 5.2339928 0.775379723 2.2721746
## t11* 2.2137728 0.267851432 0.9157055
## t12* -1.9637062 -0.203918530 0.7075526
## t13* 1.0949151 0.081528812 0.2036527
## t14* 3.3479196 0.143372380 0.2976212
## t15* 0.9916289 0.011871503 0.1476207
## t16* -1.6882599 -0.092624222 0.1633218
#run in parallel using snow back-end using all available cores
mod <- mirt(Science, 1)
booted <- boot.mirt(mod, parallel = 'snow', ncpus = parallel::detectCores())
booted
##
## ORDINARY NONPARAMETRIC BOOTSTRAP
##
##
## Call:
## boot.mirt(x = mod, parallel = "snow", ncpus = parallel::detectCores())
##
##
## Bootstrap Statistics :
## original bias std. error
## t1* 1.0417547 0.015725650 0.2582926
## t2* 4.8641542 0.161928779 0.5140894
## t3* 2.6399417 0.041969554 0.2711454
## t4* -1.4660135 -0.026366905 0.1754388
## t5* 1.2259618 -0.008168598 0.2171538
## t6* 2.9240027 0.009176419 0.2748813
## t7* 0.9011651 0.013667545 0.1522128
## t8* -2.2665647 -0.031233955 0.2081838
## t9* 2.2933717 0.111548982 0.6450601
## t10* 5.2339928 0.211643664 1.0068466
## t11* 2.2137728 0.063701009 0.4556802
## t12* -1.9637062 -0.082133838 0.3744344
## t13* 1.0949151 0.002643309 0.2348354
## t14* 3.3479196 0.023571269 0.3115571
## t15* 0.9916289 -0.005187382 0.1632241
## t16* -1.6882599 -0.031680737 0.1840463
####
# bootstrapped CIs for standardized factor loadings
boot.fun <- function(mod){
so <- summary(mod, verbose=FALSE)
as.vector(so$rotF)
}
# test to see if it works before running
boot.fun(mod)
## [1] 0.5220496 0.5844686 0.8030199 0.5410276
# run
booted.loads <- boot.mirt(mod, boot.fun=boot.fun)
## Warning: EM cycles terminated after 500 iterations.
## Warning: EM cycles terminated after 500 iterations.
## Warning: EM cycles terminated after 500 iterations.
## Warning: EM cycles terminated after 500 iterations.
booted.loads
##
## ORDINARY NONPARAMETRIC BOOTSTRAP
##
##
## Call:
## boot.mirt(x = mod, boot.fun = boot.fun)
##
##
## Bootstrap Statistics :
## original bias std. error
## t1* 0.5220496 0.006496639 0.08674054
## t2* 0.5844686 -0.006096772 0.06394975
## t3* 0.8030199 -0.009243337 0.06803535
## t4* 0.5410276 0.004859080 0.08498276
## End(No test)