Learn R Programming

catR (version 2.2)

test.cbList: Testing the format of the list for content balancing

Description

This command tests whether format of the list to be assigned to cbControl argument of function nextItem is appropriate for content balancing, and returns a warning message otherwise.

Usage

test.cbList(list, itemBank)

Arguments

list
a list of arguments to be tested. See Details.
itemBank
an item bank of class itBank as output of the function createItemBank, holding subgroups of items (i.e. such that itemBank$cbGroup is not NULL

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 test.cbList function checks whether the list provided in the cbControl argument of the nextItem and randomCAT functions, is accurate for controlling for ontent balancing. It mainly serves as an initial check for the randomCAT function. The function returns an "ok" message if the arguments of list match the requirement of the list cbControl for content balancing. Otherwise, a message is returned with information about list - type mismatch. This will be the case if:
  • listis not a list or has not exactly two elements,
at least one of the argument names is incorrect, the lengths of the arguments are different, or different from the number of subgroups of items, the 'names' element does not match with the subgroups' names, the 'props' element is not numeric or holds negative values.

References

Magis, D., and Raiche, G. (in press). Random generation of response patterns under computerized adaptive testing with the R package catR. Journal of Statistical Software.

See Also

nextItem, randomCAT

Examples

Run this code
# Loading the 'tcals' parameters 
 data(tcals)
 
 # Item bank creation for content balancing
 bank <- createItemBank(tcals, cb=TRUE)

 # Creation of a correct list with arbitrary proportions
 cbList <- list(names=c("Audio1","Audio2","Written1","Written2",
                "Written3"), props=c(0.1,0.2,0.2,0.2,0.3))

 # Testing 'cbList'
 test.cbList(cbList, bank)

 # Creation of an incorrect list (mismatch in first name)
 cbList <- list(names=c("audio1","Audio2","Written1","Written2",
                "Written3"), props=c(0.1,0.2,0.2,0.2,0.3))
 test.cbList(cbList, bank)

 # Creation of an incorrect list (mismatch in name of second
 # element)
 cbList <- list(names=c("Audio1","Audio2","Written1","Written2",
                "Written3"), prop=c(0.1,0.2,0.2,0.2,0.3))
 test.cbList(cbList, bank)

 # Creation of an incorrect list (second element shorter than
 # first element)
 cbList <- list(names=c("Audio1","Audio2","Written1","Written2",
                "Written3"), props=c(0.1,0.2,0.2,0.2))
 test.cbList(cbList, bank)

 # Creation of an incorrect list (adding a third element)
 cbList <- list(names=c("Audio1","Audio2","Written1","Written2",
                "Written3"), props=c(0.1,0.2,0.2,0.2), third="hi")
 test.cbList(cbList, bank)

Run the code above in your browser using DataLab