diff_diff.TROPResults#
- class diff_diff.TROPResults[source]#
Bases:
objectResults from a Triply Robust Panel (TROP) estimation.
TROP combines nuclear norm regularized factor estimation with exponential distance-based unit weights and time decay weights.
- lambda_time#
Selected time weight decay parameter from grid. 0.0 = uniform time weights (disabled) per Eq. 3.
- Type:
- lambda_unit#
Selected unit weight decay parameter from grid. 0.0 = uniform unit weights (disabled) per Eq. 3.
- Type:
- lambda_nn#
Selected nuclear norm regularization parameter from grid. inf = factor model disabled (L=0); converted to 1e10 internally for computation.
- Type:
- factor_matrix#
Estimated low-rank factor matrix L (n_periods x n_units).
- Type:
np.ndarray
- bootstrap_distribution#
Bootstrap distribution of estimates.
- Type:
np.ndarray, optional
Methods
__init__(att, se, t_stat, p_value, conf_int, ...)get_time_effects_df()Get time fixed effects as a DataFrame.
get_treatment_effects_df()Get individual treatment effects as a DataFrame.
get_unit_effects_df()Get unit fixed effects as a DataFrame.
print_summary([alpha])Print the summary to stdout.
summary([alpha])Generate a formatted summary of the estimation results.
to_dataframe()Convert results to a pandas DataFrame.
to_dict()Convert results to a dictionary.
Attributes
coef_varSE / abs(ATT).
is_significantCheck if the ATT is statistically significant at the alpha level.
significance_starsReturn significance stars based on p-value.
survey_metadata- __init__(att, se, t_stat, p_value, conf_int, n_obs, n_treated, n_control, n_treated_obs, unit_effects, time_effects, treatment_effects, lambda_time, lambda_unit, lambda_nn, factor_matrix, effective_rank, loocv_score, alpha=0.05, n_pre_periods=0, n_post_periods=0, n_bootstrap=None, bootstrap_distribution=None, survey_metadata=None)#
- Parameters:
att (float)
se (float)
t_stat (float)
p_value (float)
n_obs (int)
n_treated (int)
n_control (int)
n_treated_obs (int)
lambda_time (float)
lambda_unit (float)
lambda_nn (float)
factor_matrix (ndarray)
effective_rank (float)
loocv_score (float)
alpha (float)
n_pre_periods (int)
n_post_periods (int)
n_bootstrap (int | None)
bootstrap_distribution (ndarray | None)
survey_metadata (Any | None)
- Return type:
None
- classmethod __new__(*args, **kwargs)#