dectree: Decision tree estimation

View source: R/dectree.R

dectreeR Documentation

Decision tree estimation

Description

Single edge value (e.g. cost or QALY) wrapper.

Usage

dectree(
  dat_long,
  label_probs_distns = NULL,
  label_vals_distns = NULL,
  state_list = NULL,
  vals_col = NA,
  n = 100
)

Arguments

dat_long

Long format data frame with from, to, prob, vals columns.

label_probs_distns

Probability distribution names

label_vals_distns

Value distribution names

state_list

State list sets, usually terminal nodes

vals_col

Name of values column; defaults to vals

n

Number of PSA samples; default 100

Value

List of expected values at each node, joint probabilities at terminal state set and PSA samples of these if distributions provided.

Examples

library(purrr)
library(tibble)

dat_long <-
 tribble(
   ~from, ~to, ~vals, ~prob,
   1,  2,   10,   0.7,
   1,  3,   NA,   0.3,
   2,  4,  100,   0.1,
   2,  5,   NA,   0.9,
   3,  6,  100,   0.9,
   3,  7,   NA,   0.1)

dectree(dat_long,
   state_list = list(all = c(4,5,6,7)))


Health-Economics-in-R/CEdecisiontree documentation built on Sept. 14, 2022, 8:07 a.m.