diff_diff.TwoStageDiDResults#

class diff_diff.TwoStageDiDResults[source]#

Bases: object

Results from Gardner (2022) two-stage DiD estimation.

treatment_effects#

Per-observation treatment effects with columns: unit, time, tau_hat, weight. tau_hat is the residualized outcome y_tilde for treated observations; weight is 1/n_treated.

Type:

pd.DataFrame

overall_att#

Overall average treatment effect on the treated.

Type:

float

overall_se#

Standard error of overall ATT (GMM sandwich).

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 relative 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

groups#

List of treatment cohorts.

Type:

list

time_periods#

List of all time periods.

Type:

list

n_obs#

Total number of observations.

Type:

int

n_treated_obs#

Number of treated observations.

Type:

int

n_untreated_obs#

Number of untreated observations.

Type:

int

n_treated_units#

Number of ever-treated units.

Type:

int

n_control_units#

Number of units contributing to untreated observations.

Type:

int

alpha#

Significance level used.

Type:

float

bootstrap_results#

Bootstrap inference results.

Type:

TwoStageBootstrapResults, optional

Methods

__init__(treatment_effects, overall_att, ...)

print_summary([alpha])

Print summary to stdout.

summary([alpha])

Generate formatted summary of estimation results.

to_dataframe([level])

Convert results to DataFrame.

to_dict()

Convert headline results to a dictionary.

Attributes

alpha

anticipation

att

bootstrap_results

cluster_name

coef_var

SE / abs(overall ATT).

conf_int

is_significant

Check if overall ATT is significant.

n_clusters

p_value

se

significance_stars

Significance stars for overall ATT.

survey_metadata

t_stat

vcov_type

treatment_effects

overall_att

overall_se

overall_t_stat

overall_p_value

overall_conf_int

event_study_effects

group_effects

groups

time_periods

n_obs

n_treated_obs

n_untreated_obs

n_treated_units

n_control_units

__init__(treatment_effects, overall_att, overall_se, overall_t_stat, overall_p_value, overall_conf_int, event_study_effects, group_effects, groups, time_periods, n_obs, n_treated_obs, n_untreated_obs, n_treated_units, n_control_units, alpha=0.05, anticipation=0, bootstrap_results=None, survey_metadata=None, vcov_type='hc1', cluster_name=None, n_clusters=None)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#