This functions wraps multiple modular functions and allows an end-to-end cost effectiveness to be run, including final analysis of the findings.

markov_ce_pipeline(
  markov_model = NULL,
  duration = NULL,
  discount = 1.035,
  samples = 1,
  baseline = 1,
  willingness_to_pay_threshold = 20000,
  sample_type = "rcpp",
  sim_type = "armadillo_all",
  debug = FALSE,
  batches = 1,
  batch_fn = NULL,
  ...
)

Arguments

markov_model

A list of functions that define a markov model across multiple interventions. See example_two_state_markov for the correct format.

duration

Numeric, how many long to run the model for.

discount

Numeric, the discount that should be applied to the costs and QALYs. Defaults to 1.035.

samples

Numeric, defaults to 1. The number of markov model samples to use.

baseline

Numeric, the intervention to consider as the baseline for pairwise comparisons.

willingness_to_pay_threshold

Numeric, defaulting to 20,000. This is the threshold at which an intervention may be considered cost effective in the UK.

sample_type

A character string specifying the approach to use to sample the model. Options and defaults inherited from sample_markov.

sim_type

A character string specifying the approach to use to simulate the model. Options and defaults inherited from simulate_markov.

debug

Logical, defaults to FALSE. Turns on all debug checks - this may impact runtimes.

batches

Numeric, defaults to 1. The number of batches to run simulation/sampling in. When set to values greater than 1 a batch_fn must also be supplied. It is likely that the most efficient option will be to use a batch number that corresponds to the number of cores being utilised.

batch_fn

Function, defaults to NULL. This is the function to be used to parallise across batches. Potential options include parallel::mclapply (not Windows) or furrr::future_map (requires the use of future::plan outside the function). When not given the function will default to using no batching.

...

Additional options to pass to batch_fn. For example this may be the mc.cores argument of parallel::mclapply.

Value

A list containing the model samples and simulations and cost effectiveness summary measures.

See also

markov_simulation_pipeline analyse_ce

Examples

markov_ce_pipeline(example_two_state_markov(), duration = 10, samples = 5)
#> $simulations_with_ce #> # A tibble: 10 x 12 #> sample intervention transition state_cost intervention_co… cohort qalys #> <int> <chr> <list> <list> <dbl> <list> <lis> #> 1 1 SoC <dbl[,2] … <dbl [2]> 0 <dbl … <dbl… #> 2 1 Soc with We… <dbl[,2] … <dbl [2]> 50 <dbl … <dbl… #> 3 2 SoC <dbl[,2] … <dbl [2]> 0 <dbl … <dbl… #> 4 2 Soc with We… <dbl[,2] … <dbl [2]> 50 <dbl … <dbl… #> 5 3 SoC <dbl[,2] … <dbl [2]> 0 <dbl … <dbl… #> 6 3 Soc with We… <dbl[,2] … <dbl [2]> 50 <dbl … <dbl… #> 7 4 SoC <dbl[,2] … <dbl [2]> 0 <dbl … <dbl… #> 8 4 Soc with We… <dbl[,2] … <dbl [2]> 50 <dbl … <dbl… #> 9 5 SoC <dbl[,2] … <dbl [2]> 0 <dbl … <dbl… #> 10 5 Soc with We… <dbl[,2] … <dbl [2]> 50 <dbl … <dbl… #> # … with 5 more variables: total_costs <dbl>, total_qalys <dbl>, #> # incremental_costs <dbl>, incremental_qalys <dbl>, #> # incremental_net_benefit <dbl> #> #> $summarised_ce #> # A tibble: 2 x 13 #> intervention mean_costs sd_costs mean_qalys sd_qlays mean_incrementa… #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 SoC 0 0 4.17 0.0348 0 #> 2 Soc with We… 50 0 4.17 0.0414 0.00783 #> # … with 7 more variables: sd_incremental_qlays <dbl>, #> # mean_incremental_costs <dbl>, sd_incremental_costs <dbl>, #> # mean_incremental_net_benefit <dbl>, sd_incremental_net_benefit <dbl>, #> # probability_cost_effective <dbl>, icer <dbl> #>