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)
## EM cycles terminated after 500 iterations.
plot(booted)
booted
##
## ORDINARY NONPARAMETRIC BOOTSTRAP
##
##
## Call:
## boot.mirt(x = mod, R = 20)
##
##
## Bootstrap Statistics :
## original bias std. error
## t1* 1.0417547 0.038196177 0.2112722
## t2* 4.8641542 0.195019138 0.5878621
## t3* 2.6399417 0.096645443 0.2275891
## t4* -1.4660135 0.014087511 0.1144388
## t5* 1.2259618 -0.006994640 0.2105281
## t6* 2.9240027 0.043087801 0.2318017
## t7* 0.9011651 0.006423654 0.1607631
## t8* -2.2665647 0.048878976 0.1534814
## t9* 2.2933717 0.140108541 0.6593676
## t10* 5.2339928 0.315960329 1.0053506
## t11* 2.2137728 0.104088921 0.5823635
## t12* -1.9637062 -0.071645435 0.3769785
## t13* 1.0949151 0.091714258 0.2049481
## t14* 3.3479196 0.153428270 0.2971465
## t15* 0.9916289 0.021413779 0.1445618
## t16* -1.6882599 -0.105378712 0.1602944
#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.015140932 0.2577839
## t2* 4.8641542 0.162728358 0.5137371
## t3* 2.6399417 0.042440004 0.2713438
## t4* -1.4660135 -0.025710112 0.1752256
## t5* 1.2259618 -0.007342895 0.2168463
## t6* 2.9240027 0.009298090 0.2748032
## t7* 0.9011651 0.014055533 0.1515958
## t8* -2.2665647 -0.031810925 0.2080635
## t9* 2.2933717 0.110887288 0.6432067
## t10* 5.2339928 0.211740755 1.0067759
## t11* 2.2137728 0.063640341 0.4546215
## t12* -1.9637062 -0.080640195 0.3732241
## t13* 1.0949151 0.001390262 0.2340299
## t14* 3.3479196 0.023481905 0.3106449
## t15* 0.9916289 -0.005361566 0.1629655
## t16* -1.6882599 -0.030355427 0.1824688
####
# 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)
## EM cycles terminated after 500 iterations.
## EM cycles terminated after 500 iterations.
## EM cycles terminated after 500 iterations.
## 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.006935009 0.08684481
## t2* 0.5844686 -0.006585269 0.06392348
## t3* 0.8030199 -0.009395402 0.06778840
## t4* 0.5410276 0.005267929 0.08474039
## End(No test)