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

owsa_det(
  parms,
  ranges,
  nsamps = 100,
  params_basecase,
  FUN,
  outcome,
  strategies = NULL,
  ...
)

Arguments

parms

Vector with strings with the name of the parameters of interest

ranges

A named list of the form list("parm" = c(0, 1), ...) that gives the ranges for the parameters of interest. The list is matched to parms by name, so the order of its elements does not matter. The number of samples from each range is determined by nsamps

nsamps

Number of parameter values to evaluate for each parameter. Default = 100

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 name of the outcome of interest produced by FUN

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, owsa_opt_strat and owsa_tornado from dampack

Details

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

Examples

# \donttest{
  l_params_all <- load_all_params()
  owsa_det(parms  = c("c_Trt", "u_S1"),
           ranges = list("c_Trt" = c(6000, 13000),
                         "u_S1"  = c(0.75, 0.95)),
           nsamps = 10,
           params_basecase = l_params_all,
           FUN     = calculate_ce_out,
           outcome = "NMB",
           n_wtp   = 150000)
#>    parameter    param_val     strategy outcome_val
#> 1      c_Trt 6.000000e+03 No Treatment     2885035
#> 2      c_Trt 6.777778e+03 No Treatment     2885035
#> 3      c_Trt 7.555556e+03 No Treatment     2885035
#> 4      c_Trt 8.333333e+03 No Treatment     2885035
#> 5      c_Trt 9.111111e+03 No Treatment     2885035
#> 6      c_Trt 9.888889e+03 No Treatment     2885035
#> 7      c_Trt 1.066667e+04 No Treatment     2885035
#> 8      c_Trt 1.144444e+04 No Treatment     2885035
#> 9      c_Trt 1.222222e+04 No Treatment     2885035
#> 10     c_Trt 1.300000e+04 No Treatment     2885035
#> 11      u_S1 7.500000e-01 No Treatment     2885035
#> 12      u_S1 7.722222e-01 No Treatment     2896738
#> 13      u_S1 7.944444e-01 No Treatment     2908440
#> 14      u_S1 8.166667e-01 No Treatment     2920143
#> 15      u_S1 8.388889e-01 No Treatment     2931845
#> 16      u_S1 8.611111e-01 No Treatment     2943548
#> 17      u_S1 8.833333e-01 No Treatment     2955251
#> 18      u_S1 9.055556e-01 No Treatment     2966953
#> 19      u_S1 9.277778e-01 No Treatment     2978656
#> 20      u_S1 9.500000e-01 No Treatment     2990358
#> 21     c_Trt 6.000000e+03    Treatment     2941571
#> 22     c_Trt 6.777778e+03    Treatment     2935246
#> 23     c_Trt 7.555556e+03    Treatment     2928922
#> 24     c_Trt 8.333333e+03    Treatment     2922597
#> 25     c_Trt 9.111111e+03    Treatment     2916273
#> 26     c_Trt 9.888889e+03    Treatment     2909949
#> 27     c_Trt 1.066667e+04    Treatment     2903624
#> 28     c_Trt 1.144444e+04    Treatment     2897300
#> 29     c_Trt 1.222222e+04    Treatment     2890976
#> 30     c_Trt 1.300000e+04    Treatment     2884651
#> 31      u_S1 7.500000e-01    Treatment     2892783
#> 32      u_S1 7.722222e-01    Treatment     2892783
#> 33      u_S1 7.944444e-01    Treatment     2892783
#> 34      u_S1 8.166667e-01    Treatment     2892783
#> 35      u_S1 8.388889e-01    Treatment     2892783
#> 36      u_S1 8.611111e-01    Treatment     2892783
#> 37      u_S1 8.833333e-01    Treatment     2892783
#> 38      u_S1 9.055556e-01    Treatment     2892783
#> 39      u_S1 9.277778e-01    Treatment     2892783
#> 40      u_S1 9.500000e-01    Treatment     2892783
# }