diff_diff.lwdid_results.LWDiDResults#
- class diff_diff.lwdid_results.LWDiDResults[source]#
Bases:
BaseResults,AggregationMixinResults 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_caseComplete-case tau_omega composite point, exposed as a diagnostic when complete-case drops prevented it from being
.att(None otherwise).bootstrap_pvalueWild cluster bootstrap p-value (None if not computed).
bsecband_crit_valuecband_methodcband_n_bootstrapciAlias for conf_int (diff-diff API convention).
cluster_namecohort_effectscohort_time_effectscontrol_groupdf_inferenceevent_study_dfevent_study_effectsevent_study_vcovevent_study_vcov_indexinference_basisis_staggeredWhether this result comes from a staggered adoption design.
n_bootstrapn_clustersn_composite_controls_droppedn_composite_treated_droppedTreated / control units dropped by the tau_omega complete-case resolution (0 when the composite path did not run or dropped none).
paramspscore_trimPropensity-score trim bound used by the ipw/dr/psm paths (None for estimation_method='reg', where no propensity model is fitted).
psm_configPSM matching settings (None unless estimation_method='psm'): {'pscore_trim', 'n_neighbors', 'caliper', 'with_replacement'}
pvalueAlias for p_value (diff-diff API convention).
ri_pvalueRandomization inference p-value (None if not computed).
seedvcovattset_statp_valueconf_intn_obsn_treatedn_controlrollingestimation_methodvcov_typealphareference_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:
att (float)
se (float)
t_stat (float)
p_value (float)
n_obs (int)
n_treated (int)
n_control (int)
rolling (str)
estimation_method (str)
vcov_type (str)
alpha (float)
df_inference (int | None)
cluster_name (str | None)
n_clusters (int | None)
control_group (str | None)
n_bootstrap (int)
seed (int | None)
pscore_trim (float | None)
inference_basis (str | None)
att_tau_omega_complete_case (float | None)
n_composite_treated_dropped (int)
n_composite_controls_dropped (int)
event_study_vcov (ndarray | None)
event_study_vcov_index (ndarray | None)
cband_method (str | None)
cband_crit_value (float | None)
cband_n_bootstrap (int | None)
params (ndarray | None)
bse (ndarray | None)
vcov (ndarray | None)
_ri_result (Any | None)
_wcb_result (Any | None)
- Return type:
None
- classmethod __new__(*args, **kwargs)#