
Gap Plot for Synthetic Control Analysis
sc_gap_plot.RdPlots the treatment-synthetic gap (treated outcome minus synthetic control outcome) over time for synthetic control methods, with optional in-space placebo gaps for statistical inference.
Usage
sc_gap_plot(
treated_outcome,
synthetic_outcome,
time_periods,
treatment_period,
donor_gaps = NULL,
placebo_alpha = 0.25,
placebo_rmspe_filter = 2,
ci_level = 0.9,
title = "Synthetic Control: Gap Plot",
unit_label = "Treated"
)Arguments
- treated_outcome
Numeric vector. Observed outcome for the treated unit over time.
- synthetic_outcome
Numeric vector. Synthetic control outcome over time (same length as
treated_outcome).- time_periods
Numeric vector. Time period labels (same length).
- treatment_period
Numeric or integer. The first period of treatment (vertical line drawn here).
- donor_gaps
List or matrix. Optional. Gaps for donor/placebo units (in-space placebos). Each column or list element should be a numeric vector of length
length(time_periods).- placebo_alpha
Numeric. Transparency of placebo gap lines. Default
0.25.- placebo_rmspe_filter
Numeric. Exclude donor units whose pre-treatment RMSPE exceeds
placebo_rmspe_filtertimes the treated unit's pre-treatment RMSPE. Default2(common in Abadie et al.).- ci_level
Numeric. If
> 0, show a band at ±ci_level-th percentile of placebo gaps. Default0.9.- title
Character. Plot title.
- unit_label
Character. Label for the treated unit. Default
"Treated".