add_util.Rd
Defining utilities for events and interventions
add_util(.data = NULL, util, evt, trt, cycle_l = NULL, cycle_starttime = 0)
Existing utility data
Value or expression to calculate the utility estimate
Events for which this utility is applicable
Interventions for which this utility is applicable
Cycle length; only needed if utilities are calculated per cycle
Cycle when utilities start being accrued; only needed if utilities are calculated per cycle
A list of utilities
Utilities can be defined by writing expressions and objects in the cost argument whose execution will be delayed until the model runs.
This function accepts the use of pipes (%>%) to define multiple utilities.
add_util(evt = c("start","idfs","ttot"),
trt = c("int", "noint"),
util = util.idfs.ontx * fl.idfs.ontx + util.idfs.offtx * (1-fl.idfs.ontx))
#> $start_int
#> $start_int$util
#> util.idfs.ontx * fl.idfs.ontx + util.idfs.offtx * (1 - fl.idfs.ontx)
#>
#> $start_int$cycle_l
#> NULL
#>
#> $start_int$cycle_starttime
#> [1] 0
#>
#>
#> $idfs_int
#> $idfs_int$util
#> util.idfs.ontx * fl.idfs.ontx + util.idfs.offtx * (1 - fl.idfs.ontx)
#>
#> $idfs_int$cycle_l
#> NULL
#>
#> $idfs_int$cycle_starttime
#> [1] 0
#>
#>
#> $ttot_int
#> $ttot_int$util
#> util.idfs.ontx * fl.idfs.ontx + util.idfs.offtx * (1 - fl.idfs.ontx)
#>
#> $ttot_int$cycle_l
#> NULL
#>
#> $ttot_int$cycle_starttime
#> [1] 0
#>
#>
#> $start_noint
#> $start_noint$util
#> util.idfs.ontx * fl.idfs.ontx + util.idfs.offtx * (1 - fl.idfs.ontx)
#>
#> $start_noint$cycle_l
#> NULL
#>
#> $start_noint$cycle_starttime
#> [1] 0
#>
#>
#> $idfs_noint
#> $idfs_noint$util
#> util.idfs.ontx * fl.idfs.ontx + util.idfs.offtx * (1 - fl.idfs.ontx)
#>
#> $idfs_noint$cycle_l
#> NULL
#>
#> $idfs_noint$cycle_starttime
#> [1] 0
#>
#>
#> $ttot_noint
#> $ttot_noint$util
#> util.idfs.ontx * fl.idfs.ontx + util.idfs.offtx * (1 - fl.idfs.ontx)
#>
#> $ttot_noint$cycle_l
#> NULL
#>
#> $ttot_noint$cycle_starttime
#> [1] 0
#>
#>