testList {catR} | R Documentation |
Testing the format of the input lists
Description
This command tests whether format of the input lists for the random generation of adaptive tests is convenient, and returns a warning message otherwise.
Usage
testList(list, type = "start")
Arguments
list |
a list of arguments to be tested. See Details. |
type |
character: the type of list for checking. Possible values are |
Details
The testList
function checks whether the list provided in the list
argument is accurate for the selected type
.
It mainly serves as an initial check for the randomCAT
function.
The four types of lists are: "start"
with the parameters for selecting the first items; "test"
with
the options of the adaptive test (i.e. method for next item selection, provisional ability estimator and related information);
"stop"
with the options setting the stopping rule; and "final"
with the options for final ability estimation.
See the help file of randomCAT
for further details about the different lists, their allowed arguments and their contents.
The function returns an "ok"
message if the arguments of list
match the requirement of the corresponding type
. Otherwise, a message is returned with information about list - type mismatch. This will be the case
if:
list
is not a list, or has no argument names,list
has too many arguments for thetype
specified,at least one of the argument names is incorrect,
the content of at least one argument is not adequate (e.g. character instead of numeric).
Each mismatch yields a different output message to help in debugging the problem.
Value
A list with two arguments:
test |
a logical value indicating whether the format of the list is accurate ( |
message |
either a message to indicate the type of misspecification, or |
Author(s)
David Magis
Department of Psychology, University of Liege, Belgium
david.magis@uliege.be
References
Magis, D. and Barrada, J. R. (2017). Computerized Adaptive Testing with R: Recent Updates of the Package catR. Journal of Statistical Software, Code Snippets, 76(1), 1-18. doi: 10.18637/jss.v076.c01
Magis, D., and Raiche, G. (2012). Random Generation of Response Patterns under Computerized Adaptive Testing with the R Package catR. Journal of Statistical Software, 48 (8), 1-31. doi: 10.18637/jss.v048.i08
See Also
Examples
# Creation and test of a 'start' list
start <- list(nrItems = 3, theta = c(-1, 0, 2, -2), randomesque = 2)
testList(start, type = "start")
# Using former 'halfRange' argument yields an error now:
start <- list(nrItems = 3, theta = 0, halfRange = 2)
testList(start, type = "start")
# Modification of the list to introduce a mistake
names(start)[1] <- "nrItem"
testList(start, type = "start")
# Creation and test of a 'test' list
test <- list(method = "WL", itemSelect = "bOpt")
testList(test, type = "test")
# Creation and test of a 'stop' list
stop <- list(method = "WL")
testList(stop, type = "test")
# Creation and test of a 'final' list (with mistake)
final <- list(method = "MAP")
testList(final, type = "final")