# NOT RUN {
## generate item pool
pool <- model_3pl()$gendata(1, 100)$items
pool$set_id <- sample(1:30, 100, replace=TRUE)
pool$content <- sample(1:3, 100, replace=TRUE)
pool$time <- round(rlnorm(100, mean=4.1, sd=.2))
## randomesque to control exposure in selection
cat_sim(1.0, pool, min=10, max=20, randomesque=5)
## use user-defined ID variable to select item sets
cat_sim(1.0, pool, min=10, max=20, selct_id="set")
## use the mle_step estimation rule
cat_sim(1.0, pool, min=10, max=20, mle_step=.5,
estimate_rule=cat_estimate_mle_step)
## use the hybrid estimation rule
cat_sim(1.0, pool, min=10, max=20, estimate_rule=cat_estimate_hybrid)
## use the standard error stopping rule
cat_sim(1.0, pool, min=10, max=20, stop_rule=cat_stop_default, stop_se=.25)
## use the 95% confidence interval classification stopping rule
cat_sim(1.0, pool, min=10, max=20, stop_rule=cat_stop_default, stop_cut=0)
## use the constrained CAT item selection
cat_sim(1.0, pool, min=10, max=20, select_rule=cat_select_ccat,
ccat_var='content', ccat_perc=c('1'=.2, '2'=.3, '3'=.5))
## use the constrained CAT item selection with initial randomness
cat_sim(1.0, pool, min=10, max=20, select_rule=cat_select_ccat,
ccat_var='content', ccat_perc=c('1'=.2, '2'=.3, '3'=.5), ccat_init_rand=5)
## use the shadow-test CAT
cons <- data.frame(var='content', level=1:3, min=3, max=5)
cons <- rbind(cons, data.frame(var='time', level=NA, min=55*10, max=65*10))
cat_sim(1.0, pool, min=10, max=10, shadow_constraints=cons, select_id="set_id")
# }
Run the code above in your browser using DataLab