diff_diff.EfficientDiDResults#
- class diff_diff.EfficientDiDResults[source]#
Bases:
objectResults 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:
- overall_att#
Overall ATT (cohort-size weighted average of post-treatment group-time effects, matching CallawaySantAnna convention).
- Type:
- 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 tofit().- 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:
- influence_functions#
{(g, t): ndarray(n_units,)}— per-unit EIF values for each group-time cell. Only populated whenstore_eif=Trueinfit()(used internally byhausman_pretest).- Type:
dict, optional
- bootstrap_results#
Bootstrap inference results.
- Type:
EDiDBootstrapResults, optional
- sieve_k_max#
Maximum polynomial degree for the covariate-path sieves (propensity ratio, inverse propensity, and outcome regression);
1forces 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:
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
attcoef_varSE / abs(overall ATT).
conf_intcontrol_groupis_significantCheck if overall ATT is significant.
p_valuesesignificance_starsSignificance stars for overall ATT.
survey_metadatat_stat- __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:
overall_att (float)
overall_se (float)
overall_t_stat (float)
overall_p_value (float)
n_obs (int)
n_treated_units (int)
n_control_units (int)
alpha (float)
pt_assumption (str)
anticipation (int)
n_bootstrap (int)
bootstrap_weights (str)
seed (int | None)
efficient_weights (Dict[Tuple[Any, Any], np.ndarray] | None)
omega_condition_numbers (Dict[Tuple[Any, Any], float] | None)
control_group (str)
cluster_name (str | None)
n_clusters (int | None)
vcov_type (str)
influence_functions (Dict[Tuple[Any, Any], np.ndarray] | None)
bootstrap_results (EDiDBootstrapResults | None)
estimation_path (str)
sieve_k_max (int | None)
sieve_criterion (str)
ratio_clip (float)
kernel_bandwidth (float | None)
survey_metadata (Any | None)
- Return type:
None
- classmethod __new__(*args, **kwargs)#