| LeafNode {rdecision} | R Documentation |
A leaf node in a decision tree
Description
An R6 class representing a leaf (terminal) node in a decision tree.
Details
Represents a terminal state in a tree, and is associated with an
incremental utility. Inherits from class Node.
Super class
rdecision::Node -> LeafNode
Methods
Public methods
Inherited methods
Method new()
Create a new LeafNode object; synonymous with a clinical outcome.
Usage
LeafNode$new( label, utility = 1, interval = as.difftime(365.25, units = "days") )
Arguments
labelCharacter string; a label for the state; must be defined because it is used in tabulations. The label is automatically converted to a syntactically valid (in R) name to ensure it can be used as a column name in a data frame.
utilityThe incremental utility that a user associates with being in the health state for the interval. Intended for use with cost benefit analysis. Can be
numericor a type ofModVar. If the type isnumeric, the allowed range is-Infto 1; if it is of typeModVar, it is unchecked.intervalThe time interval over which the
utilityparameter applies, expressed as an Rdifftimeobject; default 1 year.
Returns
A new LeafNode object
Method modvars()
Find all the model variables of type ModVar that have
been specified as values associated with this LeafNode. Includes
operands of these ModVars, if they are expressions.
Usage
LeafNode$modvars()
Returns
A list of ModVars.
Method set_utility()
Set the incremental utility associated with the node.
Usage
LeafNode$set_utility(utility)
Arguments
utilityThe incremental utility that a user associates with being in the health state for the interval. Intended for use with cost benefit analysis. Can be
numericor a type ofModVar. If the type isnumeric, the allowed range is-Infto 1, not NA; if it is of typeModVar, it is unchecked.
Returns
Updated Leaf object.
Method set_interval()
Set the time interval associated with the node.
Usage
LeafNode$set_interval(interval)
Arguments
intervalThe time interval over which the
utilityparameter applies, expressed as an Rdifftimeobject; default 1 year, not NA.
Returns
Updated Leaf object.
Method utility()
Return the incremental utility associated with being in the state for the interval.
Usage
LeafNode$utility()
Returns
Incremental utility (numeric value).
Method interval()
Return the interval associated with being in the state.
Usage
LeafNode$interval()
Returns
Interval (as a difftime).
Method QALY()
Return the quality adjusted life years associated with being in the state.
Usage
LeafNode$QALY()
Returns
QALY.
Method clone()
The objects of this class are cloneable with this method.
Usage
LeafNode$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Author(s)
Andrew J. Sims andrew.sims@newcastle.ac.uk