itemUsageConstraint {eatATA} | R Documentation |
Create item usage constraints.
Description
Creates constraints related to item usage. That is, the number of times an item
is selected is constrained to be either (a) smaller or equal than
(operator = "<="
), (b) equal to (operator = "="
),
or (c) greater or equal than (operator = ">="
) the chosen value
.
Usage
itemUsageConstraint(
nForms,
nItems = NULL,
formValues = rep(1, nForms),
operator = c("<=", "=", ">="),
targetValue = 1,
whichItems = NULL,
info_text = NULL,
itemIDs = NULL
)
Arguments
nForms |
Number of forms to be created. |
nItems |
Number of items in the item pool [optional to create |
formValues |
vector with values or weights for each form. Defaults to 1 for each form. |
operator |
A character indicating which operator should be used in the
constraints, with three possible values: |
targetValue |
The value to be used in the constraints |
whichItems |
A vector indicating which items should be constrained. Defaults to all the items. |
info_text |
a character string of length 1, to be used in the |
itemIDs |
a character vector of item IDs in correct ordering, or NULL. |
Details
When operator = "<="
and value = 1
(the default), each item can
be selected maximally once, which corresponds with assuring that there is no
item overlap between the forms. When operator = "="
and value = 1
,
each item is used exactly once, which corresponds to no item-overlap and
complete item pool depletion.
If certain items are required in the resulting test form(s), as for example anchor items,
whichItems
can be used to constrain the usage of these items to be exactly 1.
whichItems
can either be a numeric vector with item numbers or a character vector
with item identifiers corresponding to itemIDs
.
Value
An object of class "constraint"
.
Examples
## create no-item overlap constraints with item pool depletion
## for 2 test forms with an item pool of 20 items
itemUsageConstraint(2, operator = "=", targetValue = 1,
itemIDs = 1:20)
## force certain items to be in the test, others not
usage1 <- itemUsageConstraint(2, operator = "<=", targetValue = 1,
itemIDs = paste0("item", 1:20))
usage2 <- itemUsageConstraint(2, operator = "=", targetValue = 1,
itemIDs = paste0("item", 1:20),
whichItems = c("item5", "item8", "item10"))