An R6 class representing a leaf (terminal) node in a decision tree.
Andrew J. Sims andrew.sims@newcastle.ac.uk
rdecision::Node
-> LeafNode
Inherited methods
new()
Create a new LeafNode
object; synonymous with a clinical outcome.
LeafNode$new(
label,
utility = 1,
interval = as.difftime(365.25, units = "days")
)
label
Character 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.
utility
The incremental utility that a user associates with
being in the health state for the interval.
Intended for use with cost benefit analysis. Can be numeric
or
a type of ModVar
. If the type is numeric
, the allowed
range is -Inf
to 1; if it is of type ModVar
, it is
unchecked.
interval
The time interval over which the utility
parameter applies, expressed as an R difftime
object; default
1 year.
A new LeafNode
object
modvars()
Find all the model variables of type ModVar
that have been
specified as values associated with this LeafNode
. Includes
operands of these ModVar
s, if they are expressions.
LeafNode$modvars()
A list of ModVar
s.
utility()
Return the incremental utility associated with being in the state for the interval.
LeafNode$utility()
Incremental utility (numeric value).
interval()
Return the interval associated with being in the state.
LeafNode$interval()
Interval (as a difftime
).
QALY()
Return the quality adjusted life years associated with being in the state.
LeafNode$QALY()
QALY.
clone()
The objects of this class are cloneable with this method.
LeafNode$clone(deep = FALSE)
deep
Whether to make a deep clone.
Represents a terminal state in a tree, and is associated with an
incremental utility. Inherits from class Node
.