Use a two-step procedure to estimate the conditional average treatment effects (CATE) for all possible values of the covariate(s).
R6::R6Class object.
new()HDCATE_R6Class$new(data, y_name, d_name, x_formula)
propensity_hd_estimate()HDCATE_R6Class$propensity_hd_estimate(data = NA, verbose = F)
conditional_expectations_hd_estimate()HDCATE_R6Class$conditional_expectations_hd_estimate(data = NA, verbose = F)
first_stage()HDCATE_R6Class$first_stage(data = NA, verbose = F)
second_stage()HDCATE_R6Class$second_stage(
predictor_eta_hat = NA,
eta_hat = NA,
subsample_idx = NULL,
local_weight = NULL,
estimate_std = TRUE,
verbose = FALSE,
save_model = TRUE
)
get_bw()HDCATE_R6Class$get_bw(phi, use_sample_idx)
fit()Fit the HDCATE function
HDCATE_R6Class$fit(verbose = FALSE)estimated HDCATE
inference()HDCATE_R6Class$inference(
sig_level = 0.01,
boot_method = "normal",
n_rep_boot = 1000,
verbose = FALSE
)
plot()Plot the results.
HDCATE_R6Class$plot(
output_pdf = FALSE,
pdf_name = "hdcate_plot.pdf",
include_band = TRUE,
test_side = "both",
y_axis_min = "auto",
y_axis_max = "auto",
display.hdcate = "HDCATEF",
display.ate = "ATE",
display.siglevel = "sig_level"
)output_pdfif TRUE, save image to a pdf file named as pdf_name
pdf_namethe name of the output PDF file
include_bandif TRUE, plot uniform confidence bands as well.
test_side'both' for a 2-sided test, 'left' for a left-sided test or 'right' for a right-sided test
y_axis_minthe lowest value plotted in Y axis, the default is 'auto'
y_axis_maxthe largest value plotted in Y axis, the default is 'auto'
display.hdcatethe name of HDCATE function in the legend, the default is 'HDCATEF'
display.atethe name of average treatment effect in the legend, the default is 'ATE'
display.siglevelthe name of the significant level for confidence bands in the legend, the default is 'sig_level'
get_confidence_bands()HDCATE_R6Class$get_confidence_bands(test_side = "both")
draw_weights()HDCATE_R6Class$draw_weights(method, n_rep_boot, n_obs)
set_condition_var()HDCATE_R6Class$set_condition_var(name = NA, min = NA, max = NA, step = NA)
clone()The objects of this class are cloneable with this method.
HDCATE_R6Class$clone(deep = FALSE)deepWhether to make a deep clone.