diff_diff.CallawaySantAnnaResults#

class diff_diff.CallawaySantAnnaResults[source]#

Bases: object

Results from Callaway-Sant’Anna (2021) staggered DiD estimation.

This class stores group-time average treatment effects ATT(g,t) and provides methods for aggregation into summary measures.

group_time_effects#

Dictionary mapping (group, time) tuples to effect dictionaries.

Type:

dict

overall_att#

Overall average treatment effect (weighted average of ATT(g,t)).

Type:

float

overall_se#

Standard error of 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#

List of treatment cohorts (first treatment periods).

Type:

list

time_periods#

List of all time periods.

Type:

list

n_obs#

Total number of observations.

Type:

int

n_treated_units#

Number of ever-treated units.

Type:

int

n_control_units#

Number of never-treated units (excludes not-yet-treated dynamic controls).

Type:

int

event_study_effects#

Effects aggregated by relative time (event study).

Type:

dict, optional

group_effects#

Effects aggregated by treatment cohort.

Type:

dict, optional

pscore_trim#

Propensity score trimming bound used during estimation.

Type:

float

vcov_type#

Variance type used during estimation. CallawaySantAnna is permanently narrow to "hc1" — see REGISTRY.md “IF-based variance estimators vs analytical-sandwich estimators” for why analytical-sandwich families don’t compose with the per-(g,t) doubly-robust / IPW / outcome-regression structure.

Type:

str

cluster_name#

Canonical cluster column. Set to survey_design.psu when an explicit survey PSU was provided (regardless of bare cluster=), otherwise to self.cluster when bare cluster synthesizes or injects a PSU. None when no clustering is active.

Type:

str, optional

n_clusters#

Number of unique clusters (PSUs) used for variance estimation. None when no clustering is active.

Type:

int, optional

df_inference#

Cluster-level degrees of freedom for downstream inference (e.g., HonestDiD t-critical-value selection) on the bare-cluster= synthesize path ONLY (the case where survey_metadata is intentionally None to preserve the survey/non-survey contract for DiagnosticReport / summary()). When the user provides an explicit survey_design= (inject or conflict branches), df_inference stays None and the canonical df carrier is survey_metadata.df_survey — which holds the actual CS-internal df, including any post-resolve tightening (e.g., the overall_effective_df recompute for replicate aggregations). HonestDiD reads survey_metadata.df_survey first and falls back to df_inference only when survey_metadata is absent. Narrow contract prevents HonestDiD from silently overriding a tightened survey df with the original resolved_survey.df_survey.

Type:

int, optional

Methods

__init__(group_time_effects, overall_att, ...)

epv_summary([show_all])

Return per-cohort EPV diagnostics as a DataFrame.

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

base_period

bootstrap_results

cband_crit_value

cluster_name

coef_var

SE / abs(overall ATT).

conf_int

control_group

df_inference

epv_diagnostics

epv_threshold

event_study_effects

event_study_vcov

event_study_vcov_index

group_effects

influence_functions

is_significant

Check if overall ATT is significant.

n_clusters

p_value

panel

pscore_fallback

pscore_trim

se

significance_stars

Significance stars for overall ATT.

survey_metadata

t_stat

vcov_type

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

__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, control_group='never_treated', base_period='varying', anticipation=0, panel=True, event_study_effects=None, group_effects=None, influence_functions=None, event_study_vcov=None, event_study_vcov_index=None, bootstrap_results=None, cband_crit_value=None, pscore_trim=0.01, survey_metadata=None, epv_diagnostics=None, epv_threshold=10, pscore_fallback='error', vcov_type='hc1', cluster_name=None, n_clusters=None, df_inference=None)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#