Choosing the assumption#
# Measured confounders explain who got which dose (the default)
model = fit_dose_response(X, A, Y_post)
# A stable trait you can't measure drives dose and outcome: difference-in-differences
model = fit_dose_response(X, A, Y_post, y_pre=Y_pre)
# The dose responds to past outcomes: adjust for the lagged outcome instead
model = fit_dose_response(X, A, Y_post, y_pre=Y_pre, design="lagged")
# Placebo for DiD: the curve on two pre-periods should be flat. Judge it by size, not significance.
from drcurves import placebo_check
pc = placebo_check(X, A, Y_pre, Y_prepre, main=model)
pc["relative"] # largest placebo deviation / range of the real curve; small is good
Comparing doses under DiD needs strong parallel trends: units on different doses would have followed the same path had their doses been equal (Callaway, Goodman-Bacon & Sant’Anna 2024).
In simulation (experiments/sim_did.py), each design wins in its own world, and the placebo tells
them apart (RMSE of the curve; placebo = largest deviation of the pre-period curve from flat):
Adjust for X |
Lagged outcome |
DiD |
Placebo |
|
|---|---|---|---|---|
A stable hidden trait drives the dose |
1.06 |
0.29 |
0.04 |
0.03 (flat) |
The dose responds to past outcomes |
0.24 |
0.05 |
0.16 |
0.16 (not flat) |
A clearly non-flat placebo is a reason to prefer the lagged design, or to report both.