diff_diff.StackedDiDResults
- class diff_diff.StackedDiDResults[source]
Bases:
objectResults from Stacked DiD estimation (Wing, Freedman & Hollingsworth 2024).
- overall_att
Overall average treatment effect on the treated (average of post-treatment event-study coefficients).
- Type:
- event_study_effects
Dictionary mapping event time h to effect dict with keys: ‘effect’, ‘se’, ‘t_stat’, ‘p_value’, ‘conf_int’, ‘n_obs’.
- Type:
dict, optional
- stacked_data
Full stacked dataset with _sub_exp, _event_time, _D_sa, _Q_weight columns. Accessible for custom analysis.
- Type:
pd.DataFrame
- __init__(overall_att, overall_se, overall_t_stat, overall_p_value, overall_conf_int, event_study_effects, group_effects, stacked_data, groups=<factory>, trimmed_groups=<factory>, time_periods=<factory>, n_obs=0, n_stacked_obs=0, n_sub_experiments=0, n_treated_units=0, n_control_units=0, kappa_pre=1, kappa_post=1, weighting='aggregate', clean_control='not_yet_treated', alpha=0.05)
- Parameters:
- Return type:
None
Methods
__init__(overall_att, overall_se, ...[, ...])print_summary([alpha])Print summary to stdout.
summary([alpha])Generate formatted summary of estimation results.
to_dataframe([level])Convert results to DataFrame.
Attributes
Check if overall ATT is significant.
Significance stars for overall ATT.
- print_summary(alpha=None)[source]
Print summary to stdout.
- Parameters:
alpha (float | None)
- Return type:
None
- to_dataframe(level='event_study')[source]
Convert results to DataFrame.
- Parameters:
level (str, default="event_study") – Level of aggregation: - “event_study”: Event study effects by relative time - “group”: Group (cohort) effects
- Returns:
Results as DataFrame.
- Return type:
pd.DataFrame
- __init__(overall_att, overall_se, overall_t_stat, overall_p_value, overall_conf_int, event_study_effects, group_effects, stacked_data, groups=<factory>, trimmed_groups=<factory>, time_periods=<factory>, n_obs=0, n_stacked_obs=0, n_sub_experiments=0, n_treated_units=0, n_control_units=0, kappa_pre=1, kappa_post=1, weighting='aggregate', clean_control='not_yet_treated', alpha=0.05)
- Parameters:
- Return type:
None