makeTree {catSurv} | R Documentation |
Make Tree of Possible Question Combinations
Description
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.
Usage
makeTree(catObj, flat = FALSE)
Arguments
catObj |
An object of class |
flat |
A logical indicating whether to return tree as as a list of lists or a table |
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 \theta
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.
Value
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.
Note
This function is computationally expensive. If there are k
response options and the researcher wants a complete branching scheme to include n
items, k^{n-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.
Author(s)
Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil
See Also
Cat-class
, checkStopRules
, selectItem
Examples
## Loading ltm Cat object
data(ltm_cat)
## Setting complete branches to include 3 items
setLengthThreshold(ltm_cat) <- 3
## Object returned is list of lists
ltm_list <- makeTree(ltm_cat)
## Object returned is table
ltm_table <- makeTree(ltm_cat, flat = TRUE)