run_psa {dampack}R Documentation

Calculate outcomes for a PSA using a user-defined function.

Description

run_psa calculates outcomes using a user-defined function and creates PSA objects corresponding to the specified outcomes.

Usage

run_psa(
  psa_samp,
  params_basecase = NULL,
  FUN,
  outcomes = NULL,
  strategies = NULL,
  currency = "$",
  progress = TRUE,
  ...
)

Arguments

psa_samp

A dataframe with samples of parameters for a probabilistic sensitivity analysis (PSA)

params_basecase

a named list of basecase values for input parameters needed by FUN, the user-defined function.

FUN

Function that takes the parameter values in psa_samp and ... to produce the outcome of interest. The FUN must return a dataframe where the first column are the strategy names and the rest of the columns must be outcomes.

outcomes

String vector with the outcomes of interest from FUN.

strategies

vector of strategy names. The default NULL will use strategy names in FUN

currency

symbol for the currency being used (ex. "$", "£")

progress

TRUE or FALSE for whether or not function progress should be displayed in console.

...

Additional arguments to user-defined FUN

Value

A list containing PSA objects for each outcome in outcomes.

See Also

run_psa, make_psa_obj, gen_psa_samp,


[Package dampack version 1.0.1 Index]