# \donttest{
set.seed(1)
n.items <- 50
pars <- data.frame(
a = rlnorm(n.items),
b = rnorm(n.items),
c = rbeta(n.items, 5, 17),
d = 1)
# thetas
theta <- rnorm(100)
# simulate responses
resps <- gen.resp(theta, pars[,1:3])
results <- simCAT(resps = resps,
bank = pars[,1:3],
start.theta = 0,
sel.method = 'MFI',
cat.type = 'variable',
threshold = .3,
stop = list(se = .3, max.items = 10))
eval <- cat.evaluation(
results = results,
true.scores = theta,
item.name = paste0('I', 1:nrow(pars)),
rmax = 1)
#### 3 replications
replications <- 3
# simulate responses
set.seed(1)
resps <- list()
for(i in 1:replications)
resps[[i]] <- gen.resp(theta, pars[,1:3])
# CAT
results <- list()
for (rep in 1:replications)
{
print(paste0('replication: ', rep, '/', replications))
results[[rep]] <- simCAT(
resps = resps[[rep]],
bank = pars[,1:3],
start.theta = 0,
sel.method = 'MFI',
cat.type = 'variable',
threshold = .3,
stop = list(se = .5, max.items = 10))
}
eval <- cat.evaluation(
results = results,
true.scores = theta,
item.name = paste0('I', 1:nrow(pars)),
rmax = 1)
# }
Run the code above in your browser using DataLab