diff_diff.PreTrendsPowerResults
- class diff_diff.PreTrendsPowerResults[source]
Bases:
objectResults from pre-trends power analysis.
- violation_type
Type of violation pattern (‘linear’, ‘constant’, ‘last_period’, ‘custom’).
- Type:
- pre_period_effects
Estimated pre-period effects from the event study.
- Type:
np.ndarray
- pre_period_ses
Standard errors of pre-period effects.
- Type:
np.ndarray
- vcov
Variance-covariance matrix of pre-period effects.
- Type:
np.ndarray
- __init__(power, mdv, violation_magnitude, violation_type, alpha, target_power, n_pre_periods, test_statistic, critical_value, noncentrality, pre_period_effects, pre_period_ses, vcov, original_results=None)
- Parameters:
- Return type:
None
Methods
__init__(power, mdv, violation_magnitude, ...)power_at(M)Compute power to detect a specific violation magnitude.
Print summary to stdout.
summary()Generate formatted summary of pre-trends power analysis.
Convert results to DataFrame.
to_dict()Convert results to dictionary.
Attributes
Check if the pre-trends test is informative.
Check if power meets the target threshold.
- property is_informative: bool
Check if the pre-trends test is informative.
A pre-trends test is considered informative if the MDV is reasonably small relative to typical effect sizes. This is a heuristic check; see the summary for interpretation guidance.
- summary()[source]
Generate formatted summary of pre-trends power analysis.
- Returns:
Formatted summary.
- Return type:
- power_at(M)[source]
Compute power to detect a specific violation magnitude.
This method allows computing power at different M values without re-fitting the model, using the stored variance-covariance matrix.
- __init__(power, mdv, violation_magnitude, violation_type, alpha, target_power, n_pre_periods, test_statistic, critical_value, noncentrality, pre_period_effects, pre_period_ses, vcov, original_results=None)
- Parameters:
- Return type:
None