optimsens: Find parameter values that min/maximize sensitivity results...

Description Usage Arguments Details Value

Description

Within specified range of sensitivity parameters, find the ones that achieve minimum/maximum sensitivity results

Usage

1
2
3
4
5
optimsens(pol, range_q = c(0, 1), range_dp = c(0, log(2)), range_d0 = c(0,
  log(2)), range_d1 = c(0, log(2)), base_group = NULL,
  minority_groups = NULL, range_q_ratio = NULL, allow_sgv = FALSE,
  controls = NULL, fit_fn = "logit_coef", optim_control = list(),
  include_benchmark = FALSE, verbose = TRUE, debug = FALSE)

Arguments

pol

object of class policy

range_q

2D vector specifying min/max value of p(u = 1 | x)

range_dp

2D vector specifying min/max value of change in log-odds of treat = 1 if u = 1

range_d0

2D vector specifying min/max value of change in log-odds of response = 1 if treat = 0 and u = 1

range_d1

2D vector specifying min/max value of change in log-odds of response = 1 of treat = 1 and u = 1

base_group

(Optional) single group that acts as the pivot/base; by default, if the grouping variable is a factor, set to the first level, otherwise set to the first of sorted unique values

minority_groups

(Optional) groups to compare to the base group; by default, set to every unique value other than the base group

range_q_ratio

(Optional) 2D vector. If set, the minority and base values of q will not be allowed to vary independently, but instead will be constrained to vary by the given range of log odds. ie q_minority = inv.logit(logit(q_base) + u), where u is in range_q_ratio

allow_sgv

logical; whether to allow for subgroup validity; i.e., if TRUE, the delta parameters (dp, d0, d1) will be allowed to vary between base/minority groups, but if FALSE, a single value for each delta parameter will be used for each base/minority pair

controls

vector of legitimate controls to use; the ones specified within the policy object will be used if not specified

fit_fn

string indicating the rad estimation model/procedure used. *_coef methods use models without interaction between risk and group, and return the coeficient on group membership. *_avg methods will fit more flexible models (possibly with interactions), and compute average ratios across the population. (TODO: better documentation is expected)

optim_control

list of control parameters passed to optim

include_benchmark

logical; whether to include the two extreme benchmark test results (default: FALSE)

verbose

whether or not to print debug messages (0 = none, 1 = results only, 2 = everything)

debug

logical flag, if TRUE, returns a list of results and the expanded data frame used to fit model

Details

If any of the range_ arguments are set to a single value (instead of a 2D vector), the corresponding paramter will be fixed and not explored for the optimization

Value

a list-type object of class optimsens with the following elements

results

tidy dataframe of second-stage model coefficients after searching for min/max values across specified sensitivy parameter ranges, independently for each minority group

optim

nested data frame where the $optim column contains the optimization results

base_case

result from compute_rad on base policy with specified groups and controls

base_group

base group used in analysis


jongbinjung/undi documentation built on May 8, 2019, 11:56 p.m.