Defining costs for events and intervention

add_cost(.data = NULL, cost, evt, trt, cycle_l = NULL, cycle_starttime = 0)

Arguments

.data

Existing cost data

cost

Value or expression to calculate the cost estimate

evt

Vector of events for which this cost is applicable

trt

Vector of interventions for which this cost is applicable

cycle_l

Cycle length; only needed if costs are calculated per cycle

cycle_starttime

Cycle when costs start being accrued; only needed if costs are calculated per cycle

Value

A list of costs

Details

Costs 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 costs.

Examples

add_cost(evt = c("start","idfs","ttot"),trt = "int",cost = cost.int*fl.int + cost.idfs)
#> $start_int
#> $start_int$cost
#> cost.int * fl.int + cost.idfs
#> 
#> $start_int$cycle_l
#> NULL
#> 
#> $start_int$cycle_starttime
#> [1] 0
#> 
#> 
#> $idfs_int
#> $idfs_int$cost
#> cost.int * fl.int + cost.idfs
#> 
#> $idfs_int$cycle_l
#> NULL
#> 
#> $idfs_int$cycle_starttime
#> [1] 0
#> 
#> 
#> $ttot_int
#> $ttot_int$cost
#> cost.int * fl.int + cost.idfs
#> 
#> $ttot_int$cycle_l
#> NULL
#> 
#> $ttot_int$cycle_starttime
#> [1] 0
#> 
#>