diff_diff.PreTrendsPowerCurve#

class diff_diff.PreTrendsPowerCurve[source]#

Bases: object

Power curve across violation magnitudes.

M_values#

Grid of violation magnitudes tested.

Type:

np.ndarray

powers#

Power at each violation magnitude.

Type:

np.ndarray

mdv#

Minimum detectable violation.

Type:

float

alpha#

Significance level.

Type:

float

target_power#

Target power level.

Type:

float

violation_type#

Type of violation pattern.

Type:

str

pretest_form#

Pretest acceptance-region form ('nis' or 'wald') used to compute the curve. NIS and Wald curves can differ materially under correlated Σ_22; persisting the form prevents callers from misinterpreting a serialized/plotted curve.

Type:

str

Methods

__init__(M_values, powers, mdv, alpha, ...)

plot([ax, show_mdv, show_target, color, ...])

Plot the power curve.

to_dataframe()

Convert to DataFrame with M, power, and pretest_form columns.

Attributes

__init__(M_values, powers, mdv, alpha, target_power, violation_type, pretest_form='wald')#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#