dose_attributable_general {doseSens} | R Documentation |
Inference for general attributable effects in sensitivity analysis with continuous exposures and binary outcomes. Gurobi must be installed to use this function.
dose_attributable_general(
Z,
Q,
index,
gamma,
alpha = 0.05,
monotone = TRUE,
Delta,
sign = "positive",
trans = identity,
direction = "equal",
M = 10000,
eps = 0.01,
alternative = "both",
mv_threshold = NA,
baseline = 0,
relax = FALSE,
feasible = TRUE,
MIPgap = 0.01,
WorkLimit = 1000,
OutputFlag = 0
)
Z |
A length N vector of (nonnegative) observed doses. |
Q |
A length N vector of observed binary outcomes. |
index |
A length N vector of indices indicating matched set membership. |
gamma |
The nonnegative sensitivity parameter; gamma = 0 means no unmeasured confounding. |
alpha |
Level of the test. |
monotone |
Whether to impose a monotonicity constraint on the potential outcomes |
Delta |
A numeric for the attributable effect to be tested for. |
sign |
The sign of monotonicity - "positive" or "negative". |
trans |
The transformation of the doses to use for the test statistic. Default is the identity function. |
direction |
A string indicating the direction of testing the attributable effect with respect to Delta; "greater", "equal", or "less" |
M |
The numeric penalty parameter to ensure correct sign relationship. |
eps |
precision parameter for the objective function if solving feasible = "Yes" |
alternative |
For constraining the rejection region using the test statistic with baseline potential outcomes, should it be constructed with "lower" alternative, "upper" alternative, or "both." |
mv_threshold |
The number of allowed monotonicity violations. |
baseline |
The baseline dose level for defining the threshold attributable effect. |
relax |
Whether to solve the continuous relaxation. |
feasible |
Whether to look for a feasible solution or to find the optimal solution. |
MIPgap |
Gurobi parameter specifying the precision of the mixed integer program solution; default is 0.01. |
WorkLimit |
Gurobi parameter specifying the maximum work units before stopping; default is 1000. |
OutputFlag |
0 if Gurobi print output is desired, 1 otherwise; default 0. |
A list containing the following:
sol |
A gurobi object containing the solution to the optimization. If feasible is TRUE, then failing to find a solution indiciates rejection. If feasible is FALSE, then optimal value greater than zero indiciates rejection. |
attribut |
The attributable effect attained by the least rejectable allocation of potential outcomes and unmeasured confounders. |
search |
A list of length the number of matched sets containing the matrix of compatible baseline potential outcomes in each matched set. |
null_exp |
The null expectation of the pivot attained by the least rejectable allocation of potential outcomes and unmeasured confounders. |
obsT |
The value of the pivot attained by the least rejectable allocation of potential outcomes and unmeasured confounders. |
nps |
A vector with length the number of matched sets containing the size of each matched set. |
start.ind |
A vector with length the number of matched sets containing the starting index of the decision variables pertaining to each matched set in the optimization program. |
exp_upper |
The expectation of the pivot attained by the unmeasured confounders equalling the baseline potential outcome. |
exp_lower |
The expectation of the pivot attained by the unmeasured confounders equalling 1 minus the baseline potential outcome. |
var_upper |
The variance of the pivot attained by the unmeasured confounders equalling the baseline potential outcome. |
var_lower |
The variance of the pivot attained by the unmeasured confounders equalling 1 minus the baseline potential outcome. |
dose |
A list of length the number of matched sets containing the vector of doses observed in each matched set. |
model |
The initialized gurobi model. |
# To run the following example, Gurobi must be installed.
# Load the data
data <- treat_out_match
# Make a threshold at log(3.5) transformation function.
above = function(Z) { return(Z > log(3.5)) }
# Solve the mixed-integer program.
solution = dose_attributable_general(data$treat,
data$complain, data$match_ind, gamma=log(1),
alpha = 0.1, monotone = TRUE, trans = above,
Delta = 5, direction = "less", M = 10000, eps = 0.0001,
alternative = "upper", relax = FALSE, feasible = FALSE)