Learn R Programming

xxIRT (version 2.0.0)

cat.sim: Computerized Adaptive Testing (CAT) Simulation

Description

cat.sim simulates CAT sessions with user-defined algorithms

cat.select.randomesque is a helper function for selecting an item from k most informative ones

cat.select.default selects the most informative item

cat.select.ccat selects items under content-balancing constraint (see Kingsbury & Zara, 1989, 1991)

cat.select.shadow implements the shadow test algorithm described in van der Linden (2010)

cat.stop.projection is the projection-based stopping rule

Usage

cat.sim(theta.true, pool, opts, cat.select = cat.select.default, cat.estimate = cat.estimate.default, cat.stop = cat.stop.default, debug = FALSE)
"print"(x, ...)
"plot"(x, ...)
cat.select.randomesque(theta, pool, randomesque)
cat.select.default(cat.data)
cat.select.ccat(cat.data)
cat.select.shadow(cat.data)
cat.estimate.default(cat.data)
cat.stop.default(cat.data)
cat.stop.projection(cat.data)

Arguments

theta.true
the true theta parameter
pool
a data frame of items used as the item pool
opts
a list of option parameters (min and max are required)
cat.select
a function of the item selection rule
cat.estimate
a function of the ability estimation rule
cat.stop
the a function of the stopping rule
debug
TRUE for turning on the debug mode
x
a cat object
...
further arguments
theta
the current theta estimate
randomesque
the randomesque parameter
cat.data
a list of CAT data

Value

cat.sim returns a cat object (see details section)cat.estimate.default estimates the ability using EAP (all correct/incorrect responses) or MLE (mixed responses)cat.stop.default evalutes whether to stop the CAT using the SE rule, MI rule, or CI rule

Details

All data (input and output) are combined into a list named cat.data, including the options (opts), the true theta (true), the estiamted theta (est), the item pool (pool), the administered items (items), the statistics (stats), the administration history (admin), the test length (len), the debuggin switch (debug). To write a new cat.select function, make sure it only takes cat.data as input and outputs a list with the selected item, updated pool, and output for additional output. Retrieve the additional output using output.select from the returnig cat object. To write a new cat.estimate function, make sure it only takes cat.data as input and outputs a list with the estimated theta, and output for additional output. Retrieve the additional output using output.estimate from the returnig cat object. To write a new cat.stop function, make sure it only takes cat.data as input and outputs a list with the boolean stop decision, and output for additional output. Retrieve the additional output using output.stop from the returnig cat object.

cat.select.default selects the most informative item for current theta. When randomesque is set, it randomly select an item from the k most informative ones.

To use cat.select.ccat, set target (percentage) using ccat.target and initial randomness using ccat.random in options.

cat.select.shadow: pass all constraints as a data frame with columns as such variable, level, min, max to shadow.constraints in options.

cat.estimate.default estimates theta using EAP for a response vector of all 1's or 0's and MLE otherwise

The cat.stop.default evaluates one of the three criteria after reaching minimum lenght: (1) if opts$stop.se is set, evalute if the se reaches the threshold; (2) if opts$stop.mi is set, evalute if all item reach the threshold; (3) if opts$stop.cut is set, evalute if the 95

See Also

Other res: rmse

Examples

Run this code
## Not run: 
# # generate an item pool
# pool <- irt.model()$gen.data(1,200)$items
# pool$content <- sample(1:3, nrow(pool), replace=TRUE)
# pool$time <- round(exp(rnorm(nrow(pool), log(60), .2)))
# # cat simulation: 10-30 items, default rules, stop criterion: se = .3
# opts <- list(min=10, max=30, stop.se=.3)
# x <- cat.sim(0.1, pool, opts)
# x$admin
# plot(x)
# # cat simulation: 10-30 items, default rules, stop criterion: mi = .3
# opts <- list(min=10, max=30, stop.mi=.8)
# x <- cat.sim(0.1, pool, opts, debug=TRUE)
# # cat simulation: 10-30 items, default rules, stop criterion: cut = -.5
# opts <- list(min=10, max=30, stop.cut=-0.5)
# x <- cat.sim(0.1, pool, opts, debug=TRUE)
# # cat simulation: 10-30 items, default rules, stop criterion: se = .3, randomesque=10
# opts <- list(min=10, max=30, stop.se=.3, randomesque=5)
# x <- cat.sim(0.1, pool, opts)
# x
# plot(x)
# # cat simulation: 10-30 items, c-cat selection rule, first 10 random
# opts <- list(min=30, max=60, stop.cut=0, ccat.target=c(.5,.25,.25), ccat.random=10)
# x <- cat.sim(0.1, pool, opts, cat.select=cat.select.ccat)
# x
# freq(x$admin$content, 1:3)
# plot(x)
# # cat simulation with shadow test
# cons <- data.frame(name="content", level=1, min=10, max=10, stringsAsFactors=FALSE)
# cons <- rbind(cons, c("content", 2, 10, 10))
# cons <- rbind(cons, c("content", 3, 10, 10))
# cons <- rbind(cons, c("time", NA, 55*30, 65*30))
# opts <- list(min=30, max=30, stop.se=.03, shadow.constraints=cons)
# x <- cat.sim(0.1, pool, opts, cat.select=cat.select.shadow, debug=TRUE)
# x
# freq(x$admin$content, 1:3)
# sum(x$items$time)
# plot(x)
# # cat simulation using the projection-based stopping rule
# cons <- data.frame(name="content", level=1, min=10, max=10, stringsAsFactors=FALSE)
# cons <- rbind(cons, c("content", 2, 10, 10))
# cons <- rbind(cons, c("content", 3, 10, 10))
# opts <- list(min=10, max=30, projection.cut=0, projection.constraints=cons, 
# projection.method="information")
# x <- cat.sim(0.1, pool, opts, cat.stop=cat.stop.projection, debug=TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab