σ StatsDoge Causal inference workflows
11
Workflow·4 steps·branched

Honest sensitivity bounds for parallel-trends violations (HonestDiD)

Source HonestDiD — Rambachan & Roth
Summary by StatsDoge

Stop betting everything on a pre-trends test. Bound how far the post-treatment trend can deviate (relative-magnitudes / smoothness classes), then report the union of confidence intervals over that class plus the breakdown M̄* — the trend size that just nulls the effect.

1

Input · what goes in

An event-study: the vector of pre- and post-treatment coefficients and their covariance matrix (from any DiD / event-study estimator).

Show data format & exampleHide example

Format — the event-study coefficient vector betahat and its covariance sigma (e.g. from fixest/did).

library(HonestDiD)
# betahat: pre + post event-time coefficients
# sigma:   their covariance matrix; numPrePeriods / numPostPeriods
2

Pipeline · the recipe ⑂ has parallel branches

↑ Click any step in the diagram to read its logic, code, assumptions & discussion.

1
Data prep

Start from event-study coefficients

Data preparation — shapes the raw inputs into what the estimator expects.

What happens here

Take β̂ (pre- and post-treatment event-time coefficients) and its covariance Σ from whatever DiD estimator you trust.

Formula
\hateta\sim\mathcal N(eta,\Sigma),\qquad eta=(eta_{ ext{pre}},\,eta_{ ext{post}})
Reads from the input data Feeds into the final output
Key code
es <- fixest::feols(y ~ i(rel_time, ref = -1) | id + period, df)
betahat <- coef(es); sigma <- vcov(es)

Reference / docs ↗

Discussion on this step (0)
  • No comments on this step yet — be the first.
2
Diagnostic / pre-tests

Read the pre-trends, don't just test them

A pre-flight check — run this before trusting any estimate downstream.

What happens here

A failed pre-trends test is low-power and a passed one isn't a green light. Treat the post-period bias δ as something to bound, not assume away.

Formula
eta_{ ext{post}}=\underbrace{ au}_{ ext{effect}}+\underbrace{\delta_{ ext{post}}}_{ ext{trend bias}}
Reads from the input data Feeds into the final output
Key code
# post-period coefficient = causal effect + differential trend

Reference / docs ↗

Discussion on this step (0)
  • No comments on this step yet — be the first.
3
Robustness check

Bound the deviation: relative magnitudes / smoothness

A robustness check — does the headline result survive a different lens?

What happens here

Restrict δ to a transparent class — no bigger than M̄× the largest pre-period wiggle (relative magnitudes), or boundedly nonlinear (smoothness).

Formula
\Delta^{RM}(ar M)=\Big\{\delta:\ |\delta_t|\le ar M\!\max_{s<0}|\delta_s|\Big\}
Reads from the input data Feeds into the final output
Key code
delta_rm <- createSensitivityResults_relativeMagnitudes(
    betahat, sigma, numPrePeriods, numPostPeriods, Mbarvec = c(0.5,1,1.5,2))

Reference / docs ↗

Discussion on this step (0)
  • No comments on this step yet — be the first.
4
Inference

Robust confidence set & breakdown value

Uncertainty quantification — standard errors, intervals, and aggregation.

What happens here

Report the union of confidence intervals over the allowed δ, and the breakdown M̄* — how much trend the conclusion can survive.

Formula
\mathcal C_{1-\alpha}=igcup_{\delta\in\Delta(ar M)}\mathrm{CI}( au;\delta),\qquad ar M^{*}=\sup\{ar M: 0 otin\mathcal C_{1-\alpha}\}
Reads from the input data Feeds into the final output
Key code
robust <- createSensitivityResults_relativeMagnitudes(...)
createSensitivityPlot_relativeMagnitudes(robust, originalResults)

Reference / docs ↗

Discussion on this step (0)
  • No comments on this step yet — be the first.
3

Output · what you get 2 figures

Event-study estimates (Medicaid expansion on insurance coverage): flat pre-trends, then a post-2013 jump — the input HonestDiD stress-tests.
Fig 1Event-study estimates (Medicaid expansion on insurance coverage): flat pre-trends, then a post-2013 jump — the input HonestDiD stress-tests.
Robust confidence sets as the allowed post-period trend deviation M̄ grows: the effect stays significant until M̄ ≈ 2 — its breakdown value.
Fig 2Robust confidence sets as the allowed post-period trend deviation M̄ grows: the effect stays significant until M̄ ≈ 2 — its breakdown value.

Figures reproduced from HonestDiD — Rambachan & Roth — unofficial community showcase; all credit to the original authors.

⚠️ Unofficial community showcase of honestdid. Not affiliated with the authors; all credit to them.

Stop betting everything on a pre-trends test. Allow the post-treatment trend to deviate within a transparent class, and report the confidence set — and the breakdown value where the effect would vanish.

Discussion (2)

  • 2

    Replacing the pre-trends test with explicit bounds is the right move. The breakdown M̄* is exactly what referees keep asking me for.

  • 0

    I report the relative-magnitudes set next to the point estimate by default now — it pre-empts the 'but parallel trends' question.

    1

    Same. Pairing it with the event-study plot makes the whole argument legible in one figure.