diff_diff.MultiPeriodDiDResults#
- class diff_diff.MultiPeriodDiDResults[source]#
Bases:
objectResults from a Multi-Period Difference-in-Differences estimation.
Provides access to period-specific treatment effects as well as an aggregate average treatment effect.
- period_effects#
Dictionary mapping period identifiers to their PeriodEffect objects. Contains all estimated period effects (pre and post, excluding the reference period which is normalized to zero).
- Type:
dict[any, PeriodEffect]
- reference_period#
The reference (omitted) period. Its coefficient is zero by construction and it is excluded from
period_effects.- Type:
any, optional
- interaction_indices#
Mapping from period identifier to column index in the full variance-covariance matrix. Used internally for sub-VCV extraction (e.g., by HonestDiD and PreTrendsPower).
- Type:
dict, optional
Methods
__init__(period_effects, avg_att, avg_se, ...)get_effect(period)Get the treatment effect for a specific period.
print_summary([alpha])Print the summary to stdout.
summary([alpha])Generate a formatted summary of the estimation results.
to_dataframe()Convert period-specific effects to a pandas DataFrame.
to_dict()Convert results to a dictionary.
Attributes
alphaattcluster_namecoef_varSE / abs(overall ATT).
coefficientsconf_intconley_lag_cutofffitted_valuesinference_methodis_significantCheck if the average ATT is statistically significant at the alpha level.
n_bootstrapn_clustersp_valuepost_period_effectsPost-period effects only.
pre_period_effectsPre-period effects only (for parallel trends assessment).
r_squaredresidualssesignificance_starsReturn significance stars for the average ATT based on p-value.
survey_metadatat_statvcovvcov_type- __init__(period_effects, avg_att, avg_se, avg_t_stat, avg_p_value, avg_conf_int, n_obs, n_treated, n_control, pre_periods, post_periods, alpha=0.05, coefficients=None, vcov=None, residuals=None, fitted_values=None, r_squared=None, reference_period=None, interaction_indices=None, survey_metadata=None, inference_method='analytical', n_bootstrap=None, n_clusters=None, vcov_type=None, cluster_name=None, conley_lag_cutoff=None)#
- Parameters:
period_effects (Dict[Any, PeriodEffect])
avg_att (float)
avg_se (float)
avg_t_stat (float)
avg_p_value (float)
n_obs (int)
n_treated (int)
n_control (int)
alpha (float)
vcov (ndarray | None)
residuals (ndarray | None)
fitted_values (ndarray | None)
r_squared (float | None)
reference_period (Any | None)
survey_metadata (Any | None)
inference_method (str)
n_bootstrap (int | None)
n_clusters (int | None)
vcov_type (str | None)
cluster_name (str | None)
conley_lag_cutoff (int | None)
- Return type:
None
- classmethod __new__(*args, **kwargs)#