diff_diff.StackedDiDResults#

class diff_diff.StackedDiDResults[source]#

Bases: object

Results 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:

float

overall_se#

Standard error of overall ATT (delta method on VCV).

Type:

float

overall_t_stat#

T-statistic for overall ATT.

Type:

float

overall_p_value#

P-value for overall ATT.

Type:

float

overall_conf_int#

Confidence interval for overall ATT.

Type:

tuple

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

group_effects#

Dictionary mapping cohort g to effect dict.

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

groups#

Adoption events in the trimmed set (Omega_kappa).

Type:

list

trimmed_groups#

Adoption events excluded by IC1/IC2.

Type:

list

time_periods#

All time periods in the original data.

Type:

list

n_obs#

Number of observations in the original data.

Type:

int

n_stacked_obs#

Number of observations in the stacked dataset.

Type:

int

n_sub_experiments#

Number of sub-experiments in the stack.

Type:

int

n_treated_units#

Distinct treated units across trimmed set.

Type:

int

n_control_units#

Distinct control units across trimmed set.

Type:

int

kappa_pre#

Pre-treatment event-time window size.

Type:

int

kappa_post#

Post-treatment event-time window size.

Type:

int

weighting#

Weighting scheme used.

Type:

str

clean_control#

Clean control definition used.

Type:

str

alpha#

Significance level used.

Type:

float

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

alpha

anticipation

att

clean_control

cluster_name

coef_var

SE / abs(overall ATT).

conf_int

is_significant

Check if overall ATT is significant.

kappa_post

kappa_pre

n_clusters

n_control_units

n_obs

n_stacked_obs

n_sub_experiments

n_treated_units

p_value

se

significance_stars

Significance stars for overall ATT.

survey_metadata

t_stat

vcov_type

weighting

overall_att

overall_se

overall_t_stat

overall_p_value

overall_conf_int

event_study_effects

group_effects

stacked_data

groups

trimmed_groups

time_periods

__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, anticipation=0, vcov_type='hc1', cluster_name=None, n_clusters=None, survey_metadata=None)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#