Skip to content
Plotly templates

Event-study difference-in-differences — Medicaid expansion

Event-study plot of difference-in-differences coefficients with 95% confidence intervals relative to a normalised reference period, showing pre-treatment leads for the parallel-trends check and post-treatment lags, for applied policy evaluation and applied microeconomics.

Template previewPlotly
Rendering…

Make it your own.

{
  "data": [
    {"type":"scatter","mode":"markers","name":"Pre-expansion leads","x":[-4,-3,-2],"y":[0.3,-0.1,0.2],"error_y":{"type":"data","array":[1.2,1.0,0.9],"visible":true,"color":"#94a3b8","thickness":1.5,"width":5},"marker":{"size":9,"color":"#ffffff","line":{"color":"#334155","width":2},"symbol":"circle"},"hovertemplate":"k = %{x}<br>%{y:.1f} pp<extra></extra>"},
    {"type":"scatter","mode":"markers","name":"Reference period (k = −1)","x":[-1],"y":[0],"marker":{"size":11,"color":"#334155","symbol":"diamond"},"hovertemplate":"k = −1, normalised to 0<extra></extra>"},
    {"type":"scatter","mode":"markers","name":"Post-expansion lags","x":[0,1,2,3,4],"y":[-2.9,-4.4,-5.1,-5.4,-5.6],"error_y":{"type":"data","array":[0.9,1.1,1.2,1.3,1.4],"visible":true,"color":"#1d4ed8","thickness":1.5,"width":5},"marker":{"size":9,"color":"#2563eb","symbol":"circle"},"hovertemplate":"k = %{x}<br>%{y:.1f} pp<extra></extra>"}
  ],
  "layout": {
    "title": {"text":"Event-study difference-in-differences — Medicaid expansion and the adult uninsured rate<br><sub>βₖ from a two-way fixed-effects model; k = −1 normalised to zero; bars are 95% CIs</sub>"},
    "xaxis": {"title":{"text":"Years relative to expansion (k = 0 is the year of expansion)"},"dtick":1,"range":[-4.6,4.6],"zeroline":false},
    "yaxis": {"title":{"text":"Change in share of adults 19–64 uninsured (percentage points)"},"range":[-8,3],"zeroline":false},
    "shapes": [
      {"type":"line","x0":-4.6,"x1":4.6,"y0":0,"y1":0,"line":{"color":"#94a3b8","width":1}},
      {"type":"line","x0":-0.5,"x1":-0.5,"y0":-8,"y1":3,"line":{"color":"#dc2626","width":1.5,"dash":"dash"}}
    ],
    "annotations": [
      {"x":-0.5,"y":2.4,"text":"Expansion takes effect","showarrow":false,"xanchor":"left","font":{"size":11,"color":"#dc2626"}},
      {"text":"Model: yₛₜ = αₛ + γₜ + Σₖ βₖ Dₛₜᵏ + εₛₜ, estimated on 51 states × 9 years; standard errors clustered by state.","x":0,"y":-0.2,"xref":"paper","yref":"paper","showarrow":false,"align":"left","xanchor":"left","font":{"size":10,"color":"#64748b"}},
      {"text":"Pre-trend test: joint F-test of the three leads F(3, 50) = 0.59, p = 0.62 — no evidence against parallel trends before expansion.","x":0,"y":-0.27,"xref":"paper","yref":"paper","showarrow":false,"align":"left","xanchor":"left","font":{"size":10,"color":"#64748b"}},
      {"text":"With staggered adoption, check the two-way fixed-effects estimate against a heterogeneity-robust estimator (Callaway–Sant'Anna or Sun–Abraham) before reporting.","x":0,"y":-0.34,"xref":"paper","yref":"paper","showarrow":false,"align":"left","xanchor":"left","font":{"size":10,"color":"#64748b"}}
    ],
    "legend": {"orientation":"h","y":1.02,"x":0},
    "margin": {"l":80,"r":40,"t":110,"b":150}
  }
}