Learn R Programming

catR (version 1.0)

testList: 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 "start" (default), "test", "stop" and "final". See Details.

Value

  • A list with two arguments:
  • testa logical value indicating whether the format of the list is accurate (TRUE) or not (FALSE).
  • messageeither a message to indicate the type of misspecification, or "ok" if the format is accurate.

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. 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:
  • listis not a list, or has no argument names,
list has too many arguments for the type specified, one of the argument names is incorrect, the contents of an argument is not adequate (e.g. character instead of numeric).

See Also

randomCAT

Examples

Run this code
# Creation and test of a 'start' list
 start <- list(nrItems=3, theta=0, bw=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")
 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")

Run the code above in your browser using DataLab