
Plot RD Always-assigned Share
plot_rd_aa_share.RdThis function creates a plot for the share of always-assigned units in a Regression Discontinuity (RD) design, either Sharp RD (SRD) or Fuzzy RD (FRD). It provides options to include various confidence intervals and reference lines.
Usage
plot_rd_aa_share(
data,
rd_type = "SRD",
x_label = "Share of Always-assigned Units",
y_label = "ATE",
plot_title = "",
theme_use = causalverse::ama_theme(),
tau = TRUE,
tau_CI = FALSE,
bounds_CI = TRUE,
ref_line = 0,
show_naive = TRUE,
...
)Arguments
- data
The output object from the
rdboundsfunction.- rd_type
The type of RD design, either "SRD" for Sharp RD or "FRD" for Fuzzy RD. Default is "SRD".
- x_label
The label for the x-axis. Default is "Share of Always-assigned Units".
- y_label
The label for the y-axis. Default is "ATE".
- plot_title
The title of the plot. Default is an empty string.
- theme_use
A ggplot2 theme function to apply to the plot. Default is
causalverse::ama_theme().- tau
Logical, whether to include a vertical line at the estimated treatment effect. Default is TRUE.
- tau_CI
Logical, whether to include confidence intervals for the treatment effect estimate. Default is FALSE.
- bounds_CI
Logical, whether to include confidence intervals for the manipulation bounds. Default is TRUE.
- ref_line
The y-intercept for a reference line. Default is 0.
- show_naive
Logical, whether to show the naive estimate. Default is TRUE.
- ...
Additional arguments passed to
labsin ggplot2.
Examples
if (FALSE) { # \dontrun{
set.seed(1)
data <- rdbounds::rdbounds_sampledata(10000, covs = FALSE)
rdbounds_est_tau <- rdbounds::rdbounds(
y = data$y,
x = data$x,
treatment = data$treatment,
c = 0,
discrete_x = FALSE,
discrete_y = FALSE,
bwsx = c(.2, .5),
bwy = 1,
kernel = "epanechnikov",
orders = 1,
evaluation_ys = seq(from = 0, to = 15, by = 1),
refinement_A = TRUE,
refinement_B = TRUE,
right_effects = TRUE,
potential_taus = c(.025, .05, .1, .2),
yextremes = c(0, 15),
num_bootstraps = 5
)
plot_rd_aa_share(rdbounds_est_tau)
} # }