diff_diff.CallawaySantAnnaResults#
- class diff_diff.CallawaySantAnnaResults[source]#
Bases:
objectResults 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.
- n_control_units#
Number of never-treated units (excludes not-yet-treated dynamic controls).
- Type:
- 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:
- cluster_name#
Canonical cluster column. Set to
survey_design.psuwhen an explicit survey PSU was provided (regardless of barecluster=), otherwise toself.clusterwhen bare cluster synthesizes or injects a PSU.Nonewhen no clustering is active.- Type:
str, optional
- n_clusters#
Number of unique clusters (PSUs) used for variance estimation.
Nonewhen no clustering is active.- Type:
int, optional
- df_inference#
Cluster-level degrees of freedom for downstream inference (e.g.,
HonestDiDt-critical-value selection) on the bare-cluster=synthesize path ONLY (the case wheresurvey_metadatais intentionallyNoneto preserve the survey/non-survey contract forDiagnosticReport/summary()). When the user provides an explicitsurvey_design=(inject or conflict branches),df_inferencestaysNoneand the canonical df carrier issurvey_metadata.df_survey— which holds the actual CS-internal df, including any post-resolve tightening (e.g., theoverall_effective_dfrecompute for replicate aggregations).HonestDiDreadssurvey_metadata.df_surveyfirst and falls back todf_inferenceonly whensurvey_metadatais absent. Narrow contract prevents HonestDiD from silently overriding a tightened survey df with the originalresolved_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
alphaanticipationattbase_periodbootstrap_resultscband_crit_valuecoef_varSE / abs(overall ATT).
conf_intcontrol_groupepv_diagnosticsepv_thresholdevent_study_vcovevent_study_vcov_indexinfluence_functionsis_significantCheck if overall ATT is significant.
p_valuepanelpscore_fallbacksesignificance_starsSignificance stars for overall ATT.
survey_metadatat_statoverall_t_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, 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:
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)
control_group (str)
base_period (str)
anticipation (int)
panel (bool)
influence_functions (np.ndarray | None)
event_study_vcov (np.ndarray | None)
event_study_vcov_index (list | None)
bootstrap_results (CSBootstrapResults | None)
cband_crit_value (float | None)
pscore_trim (float)
survey_metadata (Any | None)
epv_diagnostics (Dict[Tuple[Any, Any], Dict[str, Any]] | None)
epv_threshold (float)
pscore_fallback (str)
vcov_type (str)
cluster_name (str | None)
n_clusters (int | None)
df_inference (int | None)
- Return type:
None
- classmethod __new__(*args, **kwargs)#