diff_diff.SimulationSampleSizeResults#

class diff_diff.SimulationSampleSizeResults[source]#

Bases: object

Results from simulation-based sample size search.

required_n#

Required number of units to achieve target power.

Type:

int

power_at_n#

Power achieved at the required N.

Type:

float

target_power#

Target power used in the search.

Type:

float

alpha#

Significance level.

Type:

float

effect_size#

Effect size used in the search.

Type:

float

n_simulations_per_step#

Number of simulations per bisection step.

Type:

int

n_steps#

Number of bisection steps performed.

Type:

int

search_path#

Diagnostic trace of {n_units, power} at each step.

Type:

list of dict

estimator_name#

Name of the estimator used.

Type:

str

effective_n_units#

Effective sample size when it differs from required_n (e.g., due to DDD grid rounding). None when no rounding occurred or when the search already snapped to the estimator’s grid.

Type:

int or None

Methods

__init__(required_n, power_at_n, ...[, ...])

summary()

Generate a formatted summary.

to_dataframe()

Convert results to a single-row DataFrame.

to_dict()

Convert results to a dictionary.

Attributes

__init__(required_n, power_at_n, target_power, alpha, effect_size, n_simulations_per_step, n_steps, search_path, estimator_name, effective_n_units=None, survey_config=None)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#