Learn R Programming

xxIRT (version 1.1.0)

cat.sim: Computerized Adaptive Testing

Description

cat.sim simulates CAT sessions with user-defined algorithms

cat.select.ccat implements the constrained item slection algorithm described in Kingsbury & Zara (1989, 1991)

Usage

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

Arguments

theta
the true value of theta parameter
pool
an item pool (data.frame)
opts
a list of option parameters: min and max are required.
cat.select
the selection rule
cat.estimate
the estimation rule
cat.stop
the stopping rule
debug
TRUE to print debugging information
cat.data
a list of CAT inputs and outputs (see details)
x
a cat object
...
further arguments

Value

cat.sim returns a cat object (see details section)cat.select.default returns a list with item (selected item), pool (updated pool), output (optional output) elements.cat.estimate.default returns a list with theta (theta estimate) and output (optional output) elements.cat.stop.default returns a list with stop (TRUE to stop and FALSE to continue) and output (optional output) elements.

Details

All inputs are combined into a list called cat.data which is passed to cat.select, cat.estimate, and cat.stop. Besides, cat.data contains outpus too. In details, cat.data includes pool (the item pool), opts (options passed from arguments), len (test length), true (true theta), est (estimated theta), items administered items), stats (history of response, theta, se), and cat.data$admin (combining items and stats) When writing new selection, estimation, termination functions, use cat.data as the only argument and follow the structure strictly. For example, the selection function should return a list of selected item (item) and updated pool (pool). e.g., foo(cat.data){...; return(list(item=item, pool=pool))}. The estimation function should return a list containing an estimated theta (theta). e.g., foo(cat.data){...; return(list(theta=theta))}. The termination function should return a list containg a boolean value (stop). e.g., foo(cat.data){...; return(list(stop=FALSE))}. If a output element is included in the returning list, it'll be added to cat.data as cat.data$output.select, cat.data$output.estimate, cat.data$output.stop respectively.

cat.select.default randomly selects an item from the k (set in options using keyword random or 5 by default) most informative items.

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

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

cat.select.ccat: set target content percentage using ccat.target in options. Use ccat.random in options to allow the first k items to randomly draw next content domain.

Examples

Run this code
# generate an item pool
pool <- gen.irt(1, 100)$items
pool$content <- sample(1:3, nrow(pool), replace=TRUE)
# cat simulation: 10-30 items
opts <- list(min=10, max=30, stop.se=.3)
x <- cat.sim(0.1, pool, opts)
x
plot(x)
# cat simulation with randomesque
opts <- list(min=10, max=30, stop.se=.3, select.random=10)
x <- cat.sim(0.1, pool, opts)
plot(x)
# cat simulation with content balancing
opts <- list(min=10, max=30, stop.se=.3, ccat.target=c(.5,.3,.2), ccat.random=5)
x <- cat.sim(0.1, pool, opts, cat.select=cat.select.ccat)
freq(x$items$content, 1:3)

Run the code above in your browser using DataLab