itemCategoryConstraint {eatATA} | R Documentation |
Create item category constraints.
Description
Create constraints related to item categories/groupings (as
represented by itemCategories
). That is, the created
constraints assure that the number of items of each category per test form is either
(a) smaller or equal than (operator = "<="
), (b) equal to
(operator = "="
), or (c) greater than or equal to (operator = ">="
)
the corresponding targetValues
.
Usage
itemCategoryConstraint(
nForms,
itemCategories,
operator = c("<=", "=", ">="),
targetValues,
whichForms = seq_len(nForms),
info_text = NULL,
itemIDs = names(itemCategories)
)
Arguments
nForms |
Number of forms to be created. |
itemCategories |
a factor representing the categories/grouping of the items |
operator |
A character indicating which operator should be used in the
constraints, with three possible values: |
targetValues |
an integer vector representing the target number per category.
The order of the target values should correspond with the order of the levels
of the factor in |
whichForms |
An integer vector indicating which test forms should be constrained. Defaults to all the test forms. |
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. |
Value
A object of class "constraint"
.
Examples
## constraints to make sure that there are at least 3 items of each item type
## in each test form
nItems <- 30
item_type <- factor(sample(1:3, size = nItems, replace = TRUE))
itemCategoryConstraint(2, item_type, ">=", targetValues = c(1, 3, 2))