contour_ate: Visualize ATE Estimates by Contour Plot

Description Usage Arguments Details Examples

View source: R/contour_ate.R

Description

Visualize the same level of Average Treatment Effect (ATE) for different choices of sensitivity parameters with contour lines.

Usage

1
2
contour_ate(x_trt, y_trt, x_ctrl, y_ctrl, 
            largest_effect, gamma_length = 11, ...)

Arguments

x_trt

a tibble or data frame with observed pre-treatment variables for the treatment group

y_trt

a vector with outcomes for the treatment group

x_ctrl

a tibble or data frame with observed pre-treatment variables for the control group

y_ctrl

a vector with outcomes for the control group

largest_effect

the largest magnitude of sensitivity parameter to be considered, chosen from caliplot

gamma_length

chosen length of sensitivity parameter sequence, which needs to be an odd integer

joint

logical. If TURE, the mean surface and residual variance will be estimated jointly for both treatment groups; if FALSE (default), the mean surface and residual variance will be estimated independently for each treatment group.

...

arguments passed to the function BART::wbart

Details

For analysis details, please see heatmap_ate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Observed data in treatment group 
NHANES_trt <- NHANES %>% dplyr::filter(trt_dbp == 1)
x_trt <- NHANES_trt %>% select(-one_of("trt_dbp", "ave_dbp"))
y_trt <- NHANES_trt %>% select(ave_dbp)

# Observed data in control group
NHANES_ctrl <- NHANES %>% dplyr::filter(trt_dbp == 0)
x_ctrl <- NHANES_ctrl %>% select(-one_of("trt_dbp", "ave_dbp"))
y_ctrl <- NHANES_ctrl %>% select(ave_dbp)

# ATE Contour Plot 
contour_ate(x_trt, y_trt, x_ctrl, y_ctrl, largest_effect = 0.05)
contour_ate(x_trt, y_trt, x_ctrl, y_ctrl, largest_effect = 0.05, joint = TRUE)

JiajingZ/TukeySens documentation built on Jan. 23, 2020, 3:44 a.m.