diff_diff.HonestDiDResults

class diff_diff.HonestDiDResults[source]

Bases: object

Results from Honest DiD sensitivity analysis.

Contains bounds on the treatment effect under the specified restrictions on violations of parallel trends.

lb

Lower bound of identified set.

Type:

float

ub

Upper bound of identified set.

Type:

float

ci_lb

Lower bound of robust confidence interval.

Type:

float

ci_ub

Upper bound of robust confidence interval.

Type:

float

M

The restriction parameter value used.

Type:

float

method

The type of restriction (“smoothness”, “relative_magnitude”, or “combined”).

Type:

str

original_estimate

The original point estimate (under parallel trends).

Type:

float

original_se

The original standard error.

Type:

float

alpha

Significance level for confidence interval.

Type:

float

ci_method

Method used for CI construction (“FLCI” or “C-LF”).

Type:

str

original_results

The original estimation results object.

Type:

Any

__init__(lb, ub, ci_lb, ci_ub, M, method, original_estimate, original_se, alpha=0.05, ci_method='FLCI', original_results=None, event_study_bounds=None)
Parameters:
Return type:

None

Methods

__init__(lb, ub, ci_lb, ci_ub, M, method, ...)

print_summary()

Print summary to stdout.

summary()

Generate formatted summary of sensitivity analysis results.

to_dataframe()

Convert results to DataFrame.

to_dict()

Convert results to dictionary.

Attributes

alpha

ci_method

ci_width

Width of the confidence interval.

event_study_bounds

identified_set_width

Width of the identified set.

is_significant

Check if CI excludes zero (effect is robust to violations).

original_results

significance_stars

Return significance indicator if robust CI excludes zero.

lb

ub

ci_lb

ci_ub

M

method

original_estimate

original_se

lb: float
ub: float
ci_lb: float
ci_ub: float
M: float
method: str
original_estimate: float
original_se: float
alpha: float = 0.05
ci_method: str = 'FLCI'
original_results: Any | None = None
event_study_bounds: Dict[Any, Dict[str, float]] | None = None
property is_significant: bool

Check if CI excludes zero (effect is robust to violations).

property significance_stars: str

Return significance indicator if robust CI excludes zero.

Note: Unlike point estimation, partial identification does not yield a single p-value. This returns “*” if the robust CI excludes zero at the specified alpha level, indicating the effect is robust to the assumed violations of parallel trends.

property identified_set_width: float

Width of the identified set.

property ci_width: float

Width of the confidence interval.

summary()[source]

Generate formatted summary of sensitivity analysis results.

Returns:

Formatted summary.

Return type:

str

print_summary()[source]

Print summary to stdout.

Return type:

None

to_dict()[source]

Convert results to dictionary.

Return type:

Dict[str, Any]

to_dataframe()[source]

Convert results to DataFrame.

Return type:

DataFrame

__init__(lb, ub, ci_lb, ci_ub, M, method, original_estimate, original_se, alpha=0.05, ci_method='FLCI', original_results=None, event_study_bounds=None)
Parameters:
Return type:

None