diff_diff.lwdid_results.LWDiDResults#

class diff_diff.lwdid_results.LWDiDResults[source]#

Bases: BaseResults, AggregationMixin

Results from LWDiD.fit().

Follows the diff-diff standard results interface. Holds the headline ATT estimate and inference for the common-timing case, or per-cohort effects and an overall weighted ATT for the staggered case.

Parameters:
  • att (float) – Average treatment effect on the treated.

  • se (float) – Standard error of the ATT estimate.

  • t_stat (float) – t-statistic (att / se).

  • p_value (float) – Two-sided p-value.

  • conf_int (tuple of float) – (lower, upper) confidence interval at level 1 - alpha.

  • n_obs (int) – Total observations used in estimation.

  • n_treated (int) – Number of treated units.

  • n_control (int) – Number of control units.

  • rolling (str) – Transformation method used (‘demean’, ‘detrend’, ‘demeanq’, or ‘detrendq’).

  • estimation_method (str) – Estimation method (‘reg’, ‘ipw’, ‘dr’, or ‘psm’).

  • vcov_type (str) – Variance family (‘classical’, ‘hc1’, ‘hc2’, or ‘hc3’).

  • alpha (float) – Significance level used for confidence intervals.

  • df_inference (int or None) – Degrees of freedom used for t-distribution inference.

  • cluster_name (str or None) – Name of the cluster variable, if clustered.

  • n_clusters (int or None) – Number of clusters, if clustered.

  • cohort_effects (dict or None) – Per-cohort ATT results for staggered designs.

  • params (ndarray or None) – All coefficient estimates from the regression.

  • bse (ndarray or None) – All standard errors from the regression.

  • vcov (ndarray or None) – Variance-covariance matrix.

Methods

__init__(att, se, t_stat, p_value, conf_int, ...)

aggregate(type[, weights, balance_e])

Re-aggregate this fit without refitting.

print_summary()

Print the formatted summary to stdout.

randomization_test(*[, n_reps, method, seed])

Run Fisher randomization inference on the fitted estimation sample.

summary()

Formatted text summary of results.

to_csv(path)

Export results to CSV file.

to_dataframe()

Convert results to a pandas DataFrame.

to_dict()

Convert results to a JSON-serializable dictionary.

wild_cluster_bootstrap(*[, n_bootstrap, ...])

Run wild cluster bootstrap inference on the fitted estimation sample.

Attributes

att_tau_omega_complete_case

Complete-case tau_omega composite point, exposed as a diagnostic when complete-case drops prevented it from being .att (None otherwise).

bootstrap_pvalue

Wild cluster bootstrap p-value (None if not computed).

bse

cband_crit_value

cband_method

cband_n_bootstrap

ci

Alias for conf_int (diff-diff API convention).

cluster_name

cohort_effects

cohort_time_effects

control_group

df_inference

event_study_df

event_study_effects

event_study_vcov

event_study_vcov_index

inference_basis

is_staggered

Whether this result comes from a staggered adoption design.

n_bootstrap

n_clusters

n_composite_controls_dropped

n_composite_treated_dropped

Treated / control units dropped by the tau_omega complete-case resolution (0 when the composite path did not run or dropped none).

params

pscore_trim

Propensity-score trim bound used by the ipw/dr/psm paths (None for estimation_method='reg', where no propensity model is fitted).

psm_config

PSM matching settings (None unless estimation_method='psm'): {'pscore_trim', 'n_neighbors', 'caliper', 'with_replacement'}

pvalue

Alias for p_value (diff-diff API convention).

ri_pvalue

Randomization inference p-value (None if not computed).

seed

vcov

att

se

t_stat

p_value

conf_int

n_obs

n_treated

n_control

rolling

estimation_method

vcov_type

alpha

reference_periods

__init__(att, se, t_stat, p_value, conf_int, n_obs, n_treated, n_control, rolling, estimation_method, vcov_type, alpha, df_inference=None, cluster_name=None, n_clusters=None, control_group=None, n_bootstrap=0, seed=None, pscore_trim=None, psm_config=None, cohort_effects=None, cohort_time_effects=None, inference_basis=None, att_tau_omega_complete_case=None, n_composite_treated_dropped=0, n_composite_controls_dropped=0, event_study_effects=None, event_study_vcov=None, event_study_vcov_index=None, event_study_df=None, reference_periods=<factory>, cband_method=None, cband_crit_value=None, cband_n_bootstrap=None, params=None, bse=None, vcov=None, _ri_result=None, _wcb_result=None)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#