sensitivity: Sensitivity to unobserved confounders with specified...

Description Usage Arguments Details Value

Description

Sensitivity to unobserved confounders with specified parameters

Usage

1
2
3
sensitivity(pol, q, dp, d0, d1, compare = NULL, ptreat = NULL,
  resp_ctl = NULL, resp_trt = NULL, controls = NULL, naive_se = TRUE,
  fit_fn = "logit_coef", verbose = interactive(), debug = FALSE, ...)

Arguments

pol

object of class policy

q

p(u = 1 | x) (see Details)

dp

change in log-odds of treat = 1 if u = 1 (see Details)

d0

change in log-odds of response = 1 if treat = 0 and u = 1 (see Details)

d1

change in log-odds of response = 1 of treat = 1 and u = 1 (see Details)

compare

(Optional) character vector of groups to compare; the data will be filtered such that only specified groups are compared, and the grouping variable will be refactored such that the levels preserve the specified order, e.g., compare = c("white", "black") will make "white" the base group

ptreat

(Optional) default value for probability of treatment; if provided, it will override fitted values in pol$data

resp_ctl

(Optional)

resp_trt

(Optional) default value for probability of response = 1 given each treatment regime (ctl, trt); useful for cases where outcome under certain treatment regimes is deterministic (e.g., probability of finding illegal weapon if NOT frisked is 0); if provided, it will override fitted values in pol$data

controls

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

naive_se

logical flag, if TRUE, return std.error from naive (non-sensitivity) test, as well as std.errors from final weighted regression

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)

verbose

logical flag, if TRUE, print relevant messages for user

debug

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

...

additional arguments to pass to fit function from rad_control for fine-tuning

Details

All sensitivity parameters (q, dp, d0, d1) can be provided in one of three formats, determined by the length of each argument:

if length(arg) = 1

single value applied to all observations (rows)

if length(arg) = number of levels in grouping variable

each parameter setting applied to corresponding level in group

if length(arg) = nrow(pol$data)

each parameter applied to corresponding rows

Note that if compare is specified, the number of grouping levels is effectively the length of compare

Value

list of sensitized data frame and estimates


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