diff_diff.PowerResults#

class diff_diff.PowerResults[source]#

Bases: object

Results from analytical power analysis.

power#

Statistical power (probability of rejecting H0 when effect exists).

Type:

float

mde#

Minimum detectable effect size.

Type:

float

required_n#

Required total sample size (treated + control).

Type:

int

effect_size#

Effect size used in calculation.

Type:

float

alpha#

Significance level.

Type:

float

alternative#

Alternative hypothesis (‘two-sided’, ‘greater’, ‘less’).

Type:

str

n_treated#

Number of treated units.

Type:

int

n_control#

Number of control units.

Type:

int

n_pre#

Number of pre-treatment periods.

Type:

int

n_post#

Number of post-treatment periods.

Type:

int

sigma#

Residual standard deviation.

Type:

float

rho#

Within-unit (serial) equicorrelation (Burlig 2020 Eq. 2 equicorrelated case).

Type:

float

deff#

Survey design effect (variance inflation factor).

Type:

float

design#

Study design type (‘basic_did’, ‘panel’, ‘staggered’).

Type:

str

Methods

__init__(power, mde, required_n, ...[, rho, ...])

print_summary()

Print the summary to stdout.

summary()

Generate a formatted summary of power analysis results.

to_dataframe()

Convert results to a pandas DataFrame.

to_dict()

Convert results to a dictionary.

Attributes

__init__(power, mde, required_n, effect_size, alpha, alternative, n_treated, n_control, n_pre, n_post, sigma, rho=0.0, deff=1.0, design='basic_did')#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#