View source: R/hdcate_main_operators.R
HDCATE.plot | R Documentation |
Plot HDCATE function and the uniform confidence bands
HDCATE.plot( HDCATE_model, 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" )
HDCATE_model |
an object created via HDCATE |
output_pdf |
if |
pdf_name |
file name when |
include_band |
if |
test_side |
|
y_axis_min |
minimum value of the Y axis to plot in the graph, the default is |
y_axis_max |
maximum value of the Y axis to plot in the graph, the default is |
display.hdcate |
the name of HDCATE function in the legend, the default is 'HDCATEF' |
display.ate |
the name of average treatment effect in the legend, the default is 'ATE' |
display.siglevel |
the name of the significant level for confidence bands in the legend, the default is 'sig_level' |
None. A plot will be shown or saved as PDF.
# get simulation data n_obs <- 500 # Num of observations n_var <- 100 # Num of observed variables n_rel_var <- 4 # Num of relevant variables data <- HDCATE.get_sim_data(n_obs, n_var, n_rel_var) # conditional expectation model is misspecified x_formula <- paste(paste0('X', c(2:n_var)), collapse ='+') # propensity score model is misspecified # x_formula <- paste(paste0('X', c(1:(n_var-1))), collapse ='+') # create a new HDCATE model model <- HDCATE(data=data, y_name='Y', d_name='D', x_formula=x_formula) HDCATE.set_condition_var(model, 'X2', min=-1, max=1, step=0.01) HDCATE.fit(model) HDCATE.inference(model) HDCATE.plot(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.