Title: | Implements Computerized Adaptive Testing Simulations |
---|---|
Description: | Computerized Adaptive Testing simulations with dichotomous and polytomous items. Selects items with Maximum Fisher Information method or randomly, with or without constraints (content balancing and item exposure control). Evaluates the simulation results in terms of precision, item exposure, and test length. Inspired on Magis & Barrada (2017) <doi:10.18637/jss.v076.c01>. |
Authors: | Alexandre Jaloto [aut, cre] |
Maintainer: | Alexandre Jaloto <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.1 |
Built: | 2025-02-23 05:17:56 UTC |
Source: | https://github.com/alexandrejaloto/simcat |
Calculate information of each item in the bank for a theta
calc.info(bank, theta, model = "3PL")
calc.info(bank, theta, model = "3PL")
bank |
matrix with item parameters (a, b, c) |
theta |
current theta |
model |
may be |
A vector with the information of each item
Alexandre Jaloto
Calculate probability of observing certain answer to a dichotomous item, given a theta
calc.prob(theta, bank, u = 1)
calc.prob(theta, bank, u = 1)
theta |
theta |
bank |
matrix with item parameters (a, b, c) |
u |
|
A vector with the probability of seeing determined response in each item
Alexandre Jaloto
Evaluate a CAT simulation
cat.evaluation(results, true.scores, item.name, rmax)
cat.evaluation(results, true.scores, item.name, rmax)
results |
list with results of a CAT simulation from |
true.scores |
true scores |
item.name |
vector with the name of all items in the bank |
rmax |
item maximum exposure rate |
a list with two elements.
evaluate
is a data.frame
. Each line corresponds to a replication,
and the columns are the following variables:
rmse
root mean square error between true and estimated score
se
standard error of measurement
correlation
correlation between true and estimated score
bias
bias between true and estimated score
overlap
overlap rate
min_exp
minimum exposure rate
max_exp
maximum exposure rate
n_exp0
number of items not administered
n_exp_rmax
number of items with exposure rate higher than rmax
length_mean
average mean of test length
length_sd
standard deviation of test length
length_median
average median of test length
min_length
minimum test length
max_length
maximum test length
conditional
is a data.frame with the same variables (except
for length_sd
and length_median
)
conditioned to the true scores. The colnames
are the thetas
in each decile, that is,
quantile(true.scores, probs = seq(.1, 1, length.out = 10))
. Each
line corresponds to the mean of the investigated variables for each
decile. If there are replications, values are the replication means
for each decile.
Alexandre Jaloto
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)
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)
Constricts the selection with content balancing (CCAT or MCCAT)
content.balancing( bank, administered = NULL, content.names, content.props, content.items, met.content = "MCCAT" )
content.balancing( bank, administered = NULL, content.names, content.props, content.items, met.content = "MCCAT" )
bank |
matrix with item parameters (a, b, c) |
administered |
vector with administered items, |
content.names |
vector with the contents of the test |
content.props |
desirable proportion of each content in test, in
the same order of |
content.items |
vector indicating the content of each item |
met.content |
content balancing method
|
A numeric vector with the items that will be excluded for
selection. That is, it returns the unavailable items. If all items
are available, it returns NULL
.
Alexandre Jaloto
Estimates theta with Expected a Posteriori
eap(pattern, bank)
eap(pattern, bank)
pattern |
response pattern (0 and 1) with the number of columns corresponding to the number of items |
bank |
data.frame with item parameters (a, b, c) |
40 quadrature points, ranging from -4 to 4. Priori with normal distribution (mean = 0, sd = 1).
data.frame with estimated theta
and SE
.
Alexandre Jaloto
Calculate exposure rate of items in a bank
exposure.rate(previous, item.name)
exposure.rate(previous, item.name)
previous |
list with previous responses. Each element corresponds to a person and has the names of the applied items. |
item.name |
vector with the name of all items in the bank |
data.frame
with
items
name of the items
Freq
exposure rate
Alexandre Jaloto
Generate response pattern based on probability of answering correct a dichotomous item, given a theta and an item bank
gen.resp(theta, bank)
gen.resp(theta, bank)
theta |
theta |
bank |
matrix with item parameters (a, b, c) |
A vector with the probability of seeing determined response in each item
Alexandre Jaloto
Calculate the root mean square error
rmse(true, estimated)
rmse(true, estimated)
true |
true values |
estimated |
estimated values |
A numeric vector
Alexandre Jaloto
Select next item to be administered
select.item( bank, model = "3PL", theta, administered = NULL, sel.method = "MFI", cat.type = "variable", threshold = 0.3, SE, acceleration = 1, met.weight = "mcclarty", max.items = 45, content.names = NULL, content.props = NULL, content.items = NULL, met.content = "MCCAT" )
select.item( bank, model = "3PL", theta, administered = NULL, sel.method = "MFI", cat.type = "variable", threshold = 0.3, SE, acceleration = 1, met.weight = "mcclarty", max.items = 45, content.names = NULL, content.props = NULL, content.items = NULL, met.content = "MCCAT" )
bank |
matrix with item parameters (a, b, c) |
model |
may be |
theta |
current theta |
administered |
vector with administered items, |
sel.method |
item selection method: may be |
cat.type |
CAT with |
threshold |
threshold for |
SE |
current standard error.
Necessary only for progressive method, with |
acceleration |
acceleration parameter. Necessary only for progressive method. |
met.weight |
the procedure to calculate the |
max.items |
maximum number of items to be administered.
Necessary only for progressive method, with |
content.names |
vector with the contents of the test |
content.props |
desirable proportion of each content in test, in
the same order of |
content.items |
vector indicating the content of each item |
met.content |
content balancing method: |
In the progressive (Revuelta & Ponsoda, 1998), the administered item is the one that has the highest weight. The weight of the
item i
is calculated as following:
where R
is a random number between zero and the maximum information of an
item in the bank
for the current theta, I
is the item information and s
is the importance
of the component. As
the application progresses, the random component loses importance. There are some
ways to calculate s
.
For fixed-length CAT, Barrada et al. (2008) uses
if it is the first item of the test. For the other administering items,
where q
is the number of the item position in the test, Q
is the
test length and k
is the acceleration parameter. simCAT
package uses these two
equations for fixed-length CAT. For variable-length, simCAT
package can
use "magis"
(Magis & Barrada, 2017):
where is the item information for the current theta,
is the information corresponding to the stopping error
value, and
M
is the maximum length of the test. simCAT
package uses as
default "mcclarty"
(adapted from McClarty et al., 2006):
where SE
is the standard error for the current theta, is
the stopping error value.
A list with two elements
item
the number o the selected item in item bank
name
name of the selected item (row name)
Alexandre Jaloto
Barrada, J. R., Olea, J., Ponsoda, V., & Abad, F. J. (2008). Incorporating randomness in the Fisher information for improving item-exposure control in CATs. British Journal of Mathematical and Statistical Psychology, 61(2), 493–513. 10.1348/000711007X230937
Leroux, A. J., & Dodd, B. G. (2016). A comparison of exposure control procedures in CATs using the GPC model. The Journal of Experimental Education, 84(4), 666–685. 10.1080/00220973.2015.1099511
Magis, D., & Barrada, J. R. (2017). Computerized adaptive testing with R: recent updates of the package catR. Journal of Statistical Software, 76(Code Snippet 1). 10.18637/jss.v076.c01
McClarty, K. L., Sperling, R. A., & Dodd, B. G. (2006). A variant of the progressive-restricted item exposure control procedure in computerized adaptive testing. Annual Meeting of the American Educational Research Association, San Francisco
Revuelta, J., & Ponsoda, V. (1998). A comparison of item exposure control methods in computerized adaptive testing. Journal of Educational Measurement, 35(4), 311–327. http://www.jstor.org/stable/1435308
CAT simulation in a Shiny application.
sim.shiny()
sim.shiny()
Uses simCAT
function in a more friendly way. For now, this application
only supports simulation with dichotomous items and one replication.
This function does not return a value. Instead, it generates a Shiny application for interactive Computerized Adaptive Testing simulations.
Alexandre Jaloto
A CAT simulation with dichotomous items.
simCAT( resps, bank, model = "3PL", start.theta = 0, sel.method = "MFI", cat.type = "variable", acceleration = 1, met.weight = "mcclarty", threshold = 0.3, rmax = 1, content.names = NULL, content.props = NULL, content.items = NULL, met.content = "MCCAT", stop = list(se = 0.3, hypo = 0.015, hyper = Inf), progress = TRUE )
simCAT( resps, bank, model = "3PL", start.theta = 0, sel.method = "MFI", cat.type = "variable", acceleration = 1, met.weight = "mcclarty", threshold = 0.3, rmax = 1, content.names = NULL, content.props = NULL, content.items = NULL, met.content = "MCCAT", stop = list(se = 0.3, hypo = 0.015, hyper = Inf), progress = TRUE )
resps |
a matrix with responses (0 and 1). The number of columns corresponds to the number of items |
bank |
matrix with item parameters (a, b, c) |
model |
may be |
start.theta |
first theta |
sel.method |
item selection method: may be |
cat.type |
CAT with |
acceleration |
acceleration parameter. Necessary only for progressive method. |
met.weight |
the procedure to calculate the |
threshold |
threshold for |
rmax |
item maximum exposure rate |
content.names |
vector with the contents of the test |
content.props |
desirable proportion of each content in test, in
the same order of |
content.items |
vector indicating the content of each item |
met.content |
content balancing method: |
stop |
list with stopping rule and thresholds
|
progress |
shows progress bar |
For details about formula of selection methods, see select.item
.
a list with five elements
score
estimated theta
convergence
TRUE
if the application ended before reaching the maximum test length
theta.history
estimated theta after each item administration
se.history
standard error after each item administration
prev.resps
previous responses (administered items)
Alexandre Jaloto
Barrada, J. R., Olea, J., Ponsoda, V., & Abad, F. J. (2008). Incorporating randomness in the Fisher information for improving item-exposure control in CATs. British Journal of Mathematical and Statistical Psychology, 61(2), 493–513. 10.1348/000711007X230937
Leroux, A. J., & Dodd, B. G. (2016). A comparison of exposure control procedures in CATs using the GPC model. The Journal of Experimental Education, 84(4), 666–685. 10.1080/00220973.2015.1099511
Magis, D., & Barrada, J. R. (2017). Computerized adaptive testing with R: recent updates of the package catR. Journal of Statistical Software, 76(Code Snippet 1). 10.18637/jss.v076.c01
McClarty, K. L., Sperling, R. A., & Dodd, B. G. (2006). A variant of the progressive-restricted item exposure control procedure in computerized adaptive testing. Annual Meeting of the American Educational Research Association, San Francisco
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)
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)
Check if any stopping rule has been achieved
stop.cat( rule = list(se = NULL, delta.theta = NULL, hypo = NULL, hyper = NULL, info = NULL, max.items = NULL, min.items = NULL, fixed = NULL), current = list(se = NULL, delta.theta = NULL, info = NULL, applied = NULL, delta.se = NULL) )
stop.cat( rule = list(se = NULL, delta.theta = NULL, hypo = NULL, hyper = NULL, info = NULL, max.items = NULL, min.items = NULL, fixed = NULL), current = list(se = NULL, delta.theta = NULL, info = NULL, applied = NULL, delta.se = NULL) )
rule |
list with stopping rules
|
current |
list with current values
|
A list with two elements:
stop
TRUE
if any stopping rule has been achieved
convergence
logical. FALSE
if the CAT stopped because it
achieved the maximum number of items. TRUE
for any other case.
Alexandre Jaloto