diff_diff.ImputationDiDResults#

class diff_diff.ImputationDiDResults[source]#

Bases: object

Results from Borusyak-Jaravel-Spiess (2024) imputation DiD estimation.

treatment_effects#

Unit-level treatment effects with columns: unit, time, tau_hat, weight.

Type:

pd.DataFrame

overall_att#

Overall average treatment effect on the treated.

Type:

float

overall_se#

Standard error of overall ATT.

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 (\(|\Omega_1|\)).

Type:

int

n_untreated_obs#

Number of untreated observations (\(|\Omega_0|\)).

Type:

int

n_treated_units#

Number of ever-treated units.

Type:

int

n_control_units#

Number of units contributing to Omega_0.

Type:

int

alpha#

Significance level used.

Type:

float

pretrend_results#

Populated by pretrend_test().

Type:

dict, optional

bootstrap_results#

Bootstrap inference results.

Type:

ImputationBootstrapResults, optional

Methods

__init__(treatment_effects, overall_att, ...)

pretrend_test([n_leads])

Run a pre-trend test (Equation 9 of Borusyak et al. 2024).

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

pretrend_results

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, pretrend_results=None, bootstrap_results=None, _estimator_ref=None, survey_metadata=None, vcov_type='hc1', cluster_name=None, n_clusters=None)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#