This function runs a deterministic two-way sensitivity analysis (TWSA) on a given function that produces outcomes.

twsa_det(parm1, parm2, ranges, nsamps = 40, params_basecase, FUN,
  outcome, strategies = NULL, ...)

Arguments

parm1

String with the name of the first parameter of interest

parm2

String with the name of the second parameter of interest

ranges

A named list of the form list("parm1" = c(0, 1), ...) that gives the ranges for the parameters of interest. The number of samples from this range is determined by nsamp

nsamps

number of parameter values. If NULL, 100 parameter values are used

params_basecase

List with parameters for the base case

FUN

Function that takes params_basecase and ... and produces outcome of interest

outcome

String with the outcome of interest produced by nsamp

strategies

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

...

Further arguments to FUN (not used)

Value

A dataframe with the results of the sensitivity analysis. Can be visualized with plot.owsa, and owsa_tornado

Details

FUN must return a dataframe where the first column are the strategy names and the rest of the columns must be outcomes.