diff_diff.SimulationPowerResults#
- class diff_diff.SimulationPowerResults[source]#
Bases:
objectResults from simulation-based power analysis.
- n_simulations#
Number of simulations performed (successful count; see
n_simulation_failuresfor failed-replicate count).- Type:
- n_simulation_failures#
Number of simulations at the primary effect size whose estimator.fit (or result extraction) raised an exception and was skipped. Lets callers programmatically detect fragile DGP/estimator pairings; a proportional warning is also emitted above a 10% failure rate.
- Type:
- effective_n_units#
Effective sample size when it differs from the requested
n_units(e.g., due to DDD grid rounding).Nonewhen no rounding occurred.- Type:
int or None
Methods
__init__(power, power_se, power_ci, ...[, ...])power_curve_df()Get power curve data as a DataFrame.
print_summary()Print the summary to stdout.
summary()Generate a formatted summary of simulation power results.
to_dataframe()Convert results to a pandas DataFrame.
to_dict()Convert results to a dictionary.
Attributes
mean_deffmean_icc_realizedsimulation_resultssurvey_configbiasrmse- __init__(power, power_se, power_ci, rejection_rate, mean_estimate, std_estimate, mean_se, coverage, n_simulations, effect_sizes, powers, true_effect, alpha, estimator_name, simulation_results=None, effective_n_units=None, survey_config=None, mean_deff=None, mean_icc_realized=None, n_simulation_failures=0)#
- Parameters:
power (float)
power_se (float)
rejection_rate (float)
mean_estimate (float)
std_estimate (float)
mean_se (float)
coverage (float)
n_simulations (int)
true_effect (float)
alpha (float)
estimator_name (str)
effective_n_units (int | None)
survey_config (Any | None)
mean_deff (float | None)
mean_icc_realized (float | None)
n_simulation_failures (int)
- Return type:
None
- classmethod __new__(*args, **kwargs)#