## Assume an item pool with 50 items with random item information values (iif) for
## a given ability value.
set.seed(50)
itemInformations <- runif(50, 0.5, 3)
## The target value for the test information value (i.e., sum of the item
## informations) when three test forms of 10 items are assembled is:
computeTargetValues(itemInformations, nForms = 3, testLength = 10)
## The minimum and maximum test iformation values for an allowed deviation of
## 10 percent are:
computeTargetValues(itemInformations, nForms = 3, allowedDeviation = .10,
relative = TRUE, testLength = 10)
## items_vera$MC is dummy variable indication which items in the pool are multiple choise
str(items_vera$MC)
## when used as a numerical vector, the dummy is not treated as a categorical
## indicator, but rather as a numerical value.
computeTargetValues(items_vera$MC, nForms = 14)
computeTargetValues(items_vera$MC, nForms = 14, allowedDeviation = 1)
## Therefore, it is best to convert dummy variables into a factor, so that
## automatically freqyencies are returned
MC_factor <- factor(items_vera$MC, labels = c("not MC", "MC"))
computeTargetValues(MC_factor, nForms = 14)
computeTargetValues(MC_factor, nForms = 3)
## The computed minimum and maximum frequencies can be used to create contstraints.
MC_ranges <- computeTargetValues(MC_factor, nForms = 3)
itemCategoryRangeConstraint(3, MC_factor, range = MC_ranges)
## When desired, the automatically computed range can be adjusted by hand. This
## can be of use when only a limited set of the categories should be constrained.
## For instance, when only the multiple-choice items should be constrained, and
## the non-multiple-choice items should not be constrained, the minimum and
## maximum value can be set to a very small and a very high value, respectively.
## Or to other sensible values.
MC_ranges["not MC", ] <- c(0, 40)
MC_ranges
itemCategoryRangeConstraint(3, MC_factor, range = MC_ranges)
Run the code above in your browser using DataLab