model: An lm or fixest object with the outcome regression.
benchmark_covariates: The user has two options: (i) character vector of the names of covariates that will be used to bound the plausible strength of the unobserved confounders. Each variable will be considered separately; (ii) a named list with character vector names of covariates that will be used, as a group, to bound the plausible strength of the unobserved confounders. The names of the list will be used for the benchmark labels. Note: for factor variables with more than two levels, you need to provide the name of each level as encoded in the fixest model (the columns of model.matrix).
kd: numeric vector. Parameterizes how many times stronger the confounder is related to the treatment in comparison to the observed benchmark covariate. Default value is 1 (confounder is as strong as benchmark covariate).
ky: numeric vector. Parameterizes how many times stronger the confounder is related to the outcome in comparison to the observed benchmark covariate. Default value is the same as kd.
bound_label: label to bounds provided manually in r2dz.x and r2yz.dx.
treatment: A character vector with the name of the treatment variable of the model.
reduce: should the bias adjustment reduce or increase the absolute value of the estimated coefficient? Default is TRUE.
sensitivity.of: should the contour plot show adjusted estimates ("estimate") or adjusted t-values ("t-value")?
label.text: should label texts be plotted? Default is TRUE.
cex.label.text: size of the label text.
label.bump.x: bump on the x coordinate of label text.
label.bump.y: bump on the y coordinate of label text.
round: integer indicating the number of decimal places to be used for rounding.
r2dz.x: hypothetical partial R2 of unobserved confounder Z with treatment D, given covariates X.
r2yz.dx: hypothetical partial R2 of unobserved confounder Z with outcome Y, given covariates X and treatment D.
bound_value: value to be printed in label bound.
font.label.text: font for the label text.
point.pch: plotting character for points.
point.col: color code or name for points.
point.bg: background (fill) color for points.
point.cex: size of points.
point.font: font for points.
Returns
The function adds bounds in an existing contour plot and returns NULL.
Examples
# runs regression modelmodel <- lm(peacefactor ~ directlyharmed + age + farmer_dar + herder_dar + pastvoted + hhsize_darfur + female + village, data = darfur)# contour plotovb_contour_plot(model = model, treatment ="directlyharmed")# add bound 3/1 times stronger than femaleadd_bound_to_contour(model = model, benchmark_covariates ="female", kd =3, ky =1)# add bound 50/2 times stronger than ageadd_bound_to_contour(model = model, benchmark_covariates ="age", kd =50, ky =2)