Learn R Programming

catSurv (version 1.5.0)

makeTree: 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)

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.

Arguments

catObj

An object of class Cat

flat

A logical indicating whether to return tree as as a list of lists or a table

Author

Haley Acevedo, Ryden Butler, Josh W. Cutler, Matt Malis, Jacob M. Montgomery, Tom Wilkinson, Erin Rossiter, Min Hee Seo, Alex Weil

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.

See Also

Cat-class, checkStopRules, selectItem

Examples

Run this code
## 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)




Run the code above in your browser using DataLab