20.4 The Node( ) Function

TreeAge Pro includes a variety of special functions which can be useful in complex models. These functions are described in the next several sections and include Node(), Tree(), User(), and Global().

The Node() function can act as an internal linking function within a particular tree, allowing a node in one part of a model to retrieve calculated data from another part of the model. Some possible uses for the Node() function include:

  • Access calculated expected values in non-active payoff sets (only use in terminal columns).

  • Reuse a subtree at different locations in a tree for the active payoff set (similar to the way cloning is used, but with additional flexibility.

The Node() function can be called from within another Node() function.

The simplest form of the function is presented below...

  • Node( attribute )

...where attribute is an integer referring to a payoff set. This value must be a positive integer referring to an enabled (not necessarily active) payoff set. The Terminal Columns model described in the section Display terminal columns/roll back columns uses this Node() function syntax to display the expected value from a non-active payoff set in a terminal column.

The more complete function syntax is presented below:

Node( attribute; method; branch list )

  • The argument attribute refers to the payoff set to use for the calculation.

  • The argument method refers to the type of calculation to perform.

  • The argument branch list refers to the node at which to perform the calculation.

The different forms of the Node function are described in the following table.

Function Syntax Description

Node(Attribute)

Returns the stored expected value of the current node.

Attribute is a positive integer corresponding to the number associated with an enabled payoff as specified in tree preferences.

This syntax can be used to report extra payoffs in Terminal Columns only (more details in Display terminal columns/roll back columns).

Node(Attribute; 0; LIST)

Returns the expected value as above, but from a node whose path is defined by LIST.

Attribute:

Attribute is a positive integer corresponding to an enabled payoff.

In a cost-effectiveness tree, you can retrieve cost and effectiveness values via the Attribute values listed below:

  • Use -1 to perform CE calculations and return the new cost calculation

  • Use -2 to return a stored effectiveness calculation without recalculation after previously using -1

  • Use -12 to perform CE calculations and return the new effectiveness calculation

  • Use -11 to return a stored cost calculation without recalculation after previously using -12

Method (the "0" entry):

The method argument 0 returns data from an expected value calculation rather than microsimulation. See below for Microsimulation option.

LIST:

The LIST argument is a reference to the path from the root node to the node where you want calculations performed. Refer to the figure below for a description of how the path LIST is defined.

Node(Attribute; trials; LIST)

Runs a series of n microsimulation trials at the node whose path is defined by LIST. Returns the average of the trials results.

The Attribute and LIST arguments function the same as for the Node(Attribute; 0; LIST) syntax described above.

The trials argument defines the number of trials for the microsimulation.

It is important to note some differences in behavior in Node() function trials, as compared to regular Monte Carlo microsimulation trials. The Node() function does not reset tracker variables to their default values before each trial (allowing trackers to be used to track information across the group of trials). By default, distributions do not resample per trial. To force distribution sampling, use tracker variables set equal to the DistForce(n) function, for example.

The figure below includes node labels that match the appropriate LIST value for the Node() function to use when referring to each node.

The Special Features tutorial example model Node Function Syntax.trex illustrates the use of the Node function in a simple tree.

The top two terminal nodes' payoffs use the Node function to reference the Lottery node via the LIST value of 2. The top payoff returns the expected value, which is always 500. The second payoff returns the value calculated by running 1000 trials at the Lottery node. This will return a different value near the mean of 500 each time you roll back the tree. The rolled back tree is presented below.

The Special Features tutorial example model Node Function Syntax CE.trex illustrates the use of the Node function in a cost-effectiveness tree.

The top two terminal nodes' payoffs use the Node function to reference the Survival node via the LIST value of 2. The top cost and effectiveness payoff return the expected value for cost and effectiveness, which are always 5000 and 5. The second cost payoff returns the cost value calculated by running 1000 trials at the Survival node, while the effectiveness payoff returns the stored effectiveness value associated with that set of trials. This will return different cost and effectiveness values near the means each time you roll back the tree, but the cost and effectiveness values will be generated from means that are from the same set of trials. The rolled back tree is presented below.

If the cost and effectiveness payoff sets were reversed (1 vs. 2), then you would use -11 and -12 for the attribute arguments for the Node function.