diff_diff.EfficientDiDResults#

class diff_diff.EfficientDiDResults[source]#

Bases: object

Results from Efficient DiD (Chen, Sant’Anna & Xie 2025) estimation.

Stores group-time ATT(g,t) estimates with efficient weights, plus optional aggregations (overall ATT, event study, group effects).

group_time_effects#

{(g, t): {'effect', 'se', 't_stat', 'p_value', 'conf_int', 'n_treated', 'n_control'}}

Type:

dict

overall_att#

Overall ATT (cohort-size weighted average of post-treatment group-time effects, matching CallawaySantAnna convention).

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

groups#

Treatment cohort identifiers.

Type:

list

time_periods#

All time periods.

Type:

list

n_obs#

Total observations (units x periods).

Type:

int

n_treated_units#

Number of ever-treated units.

Type:

int

n_control_units#

Number of never-treated units.

Type:

int

alpha#

Significance level.

Type:

float

pt_assumption#

"all" or "post".

Type:

str

anticipation#

Number of anticipation periods used.

Type:

int

n_bootstrap#

Number of bootstrap iterations (0 = analytical only).

Type:

int

bootstrap_weights#

Bootstrap weight distribution ("rademacher", "mammen", "webb").

Type:

str

seed#

Random seed used for bootstrap.

Type:

int or None

event_study_effects#

{relative_time: effect_dict}

Type:

dict, optional

group_effects#

{group: effect_dict}

Type:

dict, optional

efficient_weights#

{(g, t): ndarray} — diagnostic: weight vector per target.

Type:

dict, optional

omega_condition_numbers#

{(g, t): float} — diagnostic: Omega* condition numbers.

Type:

dict, optional

cluster_name#

Cluster column used at fit time (None for unclustered fits; suppressed under any survey design). Populated when cluster= is passed to fit().

Type:

str or None

n_clusters#

Number of clusters at fit time (None for unclustered or survey fits). Renders as G=<n> in the variance-estimator summary line.

Type:

int or None

vcov_type#

Variance-estimator family. Permanently "hc1" per the Chen-Sant’Anna-Xie (2025) IF-based variance; see REGISTRY.md.

Type:

str

influence_functions#

{(g, t): ndarray(n_units,)} — per-unit EIF values for each group-time cell. Only populated when store_eif=True in fit() (used internally by hausman_pretest).

Type:

dict, optional

bootstrap_results#

Bootstrap inference results.

Type:

EDiDBootstrapResults, optional

estimation_path#

"nocov" or "dr" — which estimation path was used.

Type:

str

sieve_k_max#

Maximum polynomial degree for the covariate-path sieves (propensity ratio, inverse propensity, and outcome regression); 1 forces a linear outcome-regression working model.

Type:

int or None

sieve_criterion#

Information criterion used ("aic" or "bic") for all covariate-path sieve order selection.

Type:

str

ratio_clip#

Clipping bound for sieve propensity ratios.

Type:

float

kernel_bandwidth#

Bandwidth used for kernel-smoothed conditional Omega*.

Type:

float or None

Methods

__init__(group_time_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 flat dictionary.

Attributes

__init__(group_time_effects, overall_att, overall_se, overall_t_stat, overall_p_value, overall_conf_int, groups, time_periods, n_obs, n_treated_units, n_control_units, alpha=0.05, pt_assumption='all', anticipation=0, n_bootstrap=0, bootstrap_weights='rademacher', seed=None, event_study_effects=None, group_effects=None, efficient_weights=None, omega_condition_numbers=None, control_group='never_treated', cluster_name=None, n_clusters=None, vcov_type='hc1', influence_functions=None, bootstrap_results=None, estimation_path='nocov', sieve_k_max=None, sieve_criterion='bic', ratio_clip=20.0, kernel_bandwidth=None, survey_metadata=None)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#