cbControl
argument of function nextItem
is appropriate for content balancing, and returns a warning message otherwise.
test.cbList(list, cbGroup)
NULL
.TRUE
) or not (FALSE
)."ok"
if the format is accurate.test.cbList
function checks whether the list provided in the cbControl
argument of the nextItem
and randomCAT
functions, is accurate for controlling for content 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:
list
is not a list or has not exactly two elements,
Each mismatch yields a different output message to help in debugging the problem.
nextItem
, randomCAT
## Dichotomous models ##
# Loading the 'tcals' parameters
data(tcals)
# Vector of group membership for 'tcals' data set
group <- tcals$Group
# 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, group)
# 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, group)
# 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, group)
# 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, group)
# 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, group)
## Polytomous models ##
# Creation of an appropriate list for content balancing
# Equal proprotions across subgroups of items
cbList <- list(names = c("Group1", "Group2", "Group3", "Group4"), props = rep(1, 4))
# Creation of a "wrong" list
cbList2 <- list(names=c("group1","group2"),props = c(1, 1))
# Generation of an item bank under GRM with 100 items and at most 4 categories
m.GRM <- genPolyMatrix(100, 4, "GRM", cbControl = cbList)
# Breaking the 'm.GRM' bank
bank <- breakBank(m.GRM)
# Testing 'cbList' and 'cbList2'
test.cbList(cbList, bank$cbGroup)
test.cbList(cbList2, bank$cbGroup)
# Generation of an item bank under PCM with 100 items, 4 categories and groups
m.PCM <- genPolyMatrix(100, 4, "PCM", same.nrCat = TRUE, cbControl = cbList2)
# Breaking the 'm.PCM' bank
bank2 <- breakBank(m.PCM)
# Testing 'cbList' and 'cbList2'
test.cbList(cbList, bank2$cbGroup)
test.cbList(cbList2, bank2$cbGroup)
Run the code above in your browser using DataLab