Skip to contents

Cost-effectiveness decision tree using recursive approach

Usage

dectree_expected_recursive(node, tree, dat)

Arguments

node

Node at which total expected value is to be calculate at

tree

List of children by parents

dat

Node labels, branch probabilities and value; data frame

Value

Expected value at root node

See also

CEdecisiontree

Other CEdecisiontree: dectree_expected_recursive2()

Examples


tree <-
  list("1" = c(2,3),
       "2" =  c(4,5),
       "3" =  c(6,7),
       "4" =  c(),
       "5" =  c(),
       "6" =  c(),
       "7" =  c())
dat <-
  data.frame(node = 1:7,
             prob = c(NA, rep(0.5, 6)),
             vals = c(10,2,3,16,5,6,7))

root <- names(tree)[1]
dectree_expected_recursive(node = root, tree, dat)
#> [1] 21