
Pre-trend Sensitivity Analysis (HonestDiD)
pretrend_sensitivity.RdWrapper around the HonestDiD methodology (Rambachan & Roth 2023) for sensitivity analysis of difference-in-differences designs to violations of the parallel trends assumption. Constructs robust confidence intervals that remain valid under bounded violations of parallel trends.
Arguments
- event_study
A data frame with columns
period,estimate,std_errorfrom an event study regression, or afixestmodel estimated withi()interactions.- ref_period
Numeric. Reference (omitted) period. Default
-1.- M_seq
Numeric vector. Grid of \(M\) values (maximum deviation from parallel trends per period). Default
seq(0, 1, by = 0.1).- method
Character. Restriction type:
"C"smoothness/\(\Delta\) restriction (default),"Delta"sign restriction, or"Rel_Mag"relative magnitudes.- alpha
Numeric. Significance level. Default
0.05.- plot
Logical. Produce a sensitivity plot. Default
TRUE.
Value
A list with:
- robust_cis
Data frame with columns
period,M,ci_lower,ci_upper,estimate.- original_cis
Data frame of the original (unadjusted) event-study CIs.
- breakdown_M
Scalar. Smallest \(M\) at which the robust CI for the first post-period includes zero.
Infif the CI never includes zero on this grid.- plot
A
ggplot2object (only whenplot = TRUE).
Details
If the HonestDiD package is installed, its optimisation routines are used. Otherwise a simplified analytic approximation is computed: for each \(M\) the confidence interval is widened by \(M \times |t|\) on each side, where \(t\) is the distance from the reference period.