Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

run_psa

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


dampack

Decision-Analytic Modeling Package

v1.0.0
GPL-3
Authors
Fernando Alarid-Escudero [aut], Greg Knowlton [aut, cre], Caleb Easterly [aut], Eva Enns [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.