Pre-calculates a complete branching scheme of all possible questions-answer combinations and stores it as a list of lists or a flattened table of values.
makeTree(catObj, flat =FALSE)
Arguments
catObj: An object of class Cat
flat: A logical indicating whether to return tree as as a list of lists or a table
Returns
The function makeTree returns either a list or a table. If the argument flat is FALSE, the default value, the function returns a list of lists.
If the argument flat is TRUE, the function takes the list of lists and configures it into a flattened table where the columns represent the battery items and the rows represent the possible answer profiles.
Details
The function takes a Cat object and generates a tree of all possible question-answer combinations, conditional on previous answers in the branching scheme and the current θ estimates for the branch. The tree is stored as a list of lists, iteratively generated by filling in a possible answer, calculating the next question via selectItem, filling in a possible answer for that question, and so forth.
The length of each complete branching scheme within the tree is dictated by the lengthThreshold slot within the Cat object.
Note
This function is computationally expensive. If there are k response options and the researcher wants a complete branching scheme to include n items, kn−1 complete branching schemes will be calculated. Setting n is done via the lengthThreshold slot in the Cat object. See Examples .
This function is to allow users to access the internal functions of the package. During item selection, all calculations are done in compiled C++ code.
Examples
## Loading ltm Cat objectdata(ltm_cat)## Setting complete branches to include 3 itemssetLengthThreshold(ltm_cat)<-3## Object returned is list of listsltm_list <- makeTree(ltm_cat)## Object returned is tableltm_table <- makeTree(ltm_cat, flat =TRUE)
See Also
Cat-class, checkStopRules, selectItem
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil