diff_diff.MultiPeriodDiDResults#

class diff_diff.MultiPeriodDiDResults[source]#

Bases: object

Results 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]

avg_att#

Average Treatment effect on the Treated across post-periods only.

Type:

float

avg_se#

Standard error of the average ATT.

Type:

float

avg_t_stat#

T-statistic for the average ATT.

Type:

float

avg_p_value#

P-value for the null hypothesis that average ATT = 0.

Type:

float

avg_conf_int#

Confidence interval for the average ATT.

Type:

tuple[float, float]

n_obs#

Number of observations used in estimation.

Type:

int

n_treated#

Number of treated units/observations.

Type:

int

n_control#

Number of control units/observations.

Type:

int

pre_periods#

List of pre-treatment period identifiers.

Type:

list

post_periods#

List of post-treatment period identifiers.

Type:

list

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

alpha

att

cluster_name

coef_var

SE / abs(overall ATT).

coefficients

conf_int

conley_lag_cutoff

fitted_values

inference_method

interaction_indices

is_significant

Check if the average ATT is statistically significant at the alpha level.

n_bootstrap

n_clusters

p_value

post_period_effects

Post-period effects only.

pre_period_effects

Pre-period effects only (for parallel trends assessment).

r_squared

reference_period

residuals

se

significance_stars

Return significance stars for the average ATT based on p-value.

survey_metadata

t_stat

vcov

vcov_type

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

__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:
Return type:

None

classmethod __new__(*args, **kwargs)#