Commit a53009a
feat(did): did_summary gains include_sensitivity — 3-way robustness
Extends sp.did_summary() with an include_sensitivity=True flag that
runs the Rambachan-Roth (2023) breakdown M* on top of the Callaway-
Sant'Anna fit (when 'cs' is among the requested methods). The value is
exposed both in model_info['breakdown_m'] and in a new breakdown_m
column on the detail DataFrame (populated for the CS row; NaN for
other methods since honest_did is CS-specific).
This gives researchers a one-call three-way robustness readout:
method (CS/SA/BJS/ETWFE/Stacked) × estimate × sensitivity threshold
Backward compatible: default include_sensitivity=False preserves prior
output exactly (tested — breakdown_m column is all-NaN, model_info
field is None).
Graceful fallback: when 'cs' is not in methods_list, the flag is a
no-op rather than an error. If breakdown_m itself fails, the failure
is recorded in model_info['methods_failed']['__sensitivity__'].
Verified: forest plot still renders correctly with the added column.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 27a37ec commit a53009a
1 file changed
Lines changed: 49 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
| |||
213 | 221 | | |
214 | 222 | | |
215 | 223 | | |
| 224 | + | |
216 | 225 | | |
217 | 226 | | |
218 | 227 | | |
219 | 228 | | |
220 | 229 | | |
221 | 230 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
227 | 247 | | |
228 | 248 | | |
229 | 249 | | |
| |||
236 | 256 | | |
237 | 257 | | |
238 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
239 | 281 | | |
240 | 282 | | |
241 | | - | |
| 283 | + | |
242 | 284 | | |
243 | 285 | | |
244 | 286 | | |
| |||
263 | 305 | | |
264 | 306 | | |
265 | 307 | | |
| 308 | + | |
266 | 309 | | |
267 | 310 | | |
268 | 311 | | |
0 commit comments