statsmodels.stats.proportion.power_binom_tost#

statsmodels.stats.proportion.power_binom_tost(low, upp, nobs, p_alt=None, alpha=0.05)[source]#

Power for exact binomial equivalence test

Parameters:
low, uppfloat or array_like

lower and upper limit of equivalence region

nobsint or array_like

the number of trials or observations.

p_altfloat or array_like in [0, 1], optional

proportion under the alternative. If p_alt is None, then the midpoint of the equivalence region, 0.5 * (low + upp), is used.

alphafloat or array_like in (0, 1), optional

significance level of the test

Returns:
powerfloat or ndarray

statistical power of the equivalence test.

Raises:
ValueError

If p_alt is not in [0, 1] (this includes NaN values), or if the arguments of binom_tost_reject_interval are not valid.

See also

binom_tost_reject_interval

Rejection region of the exact equivalence test.

Notes

The power is the probability of the rejection region of the exact equivalence test under the alternative. The rejection region can be empty, for example if the equivalence region is narrow relative to the sample size. In this case the power is zero.

Changed in version 0.15.1: The power is zero if the rejection region is empty. Previously a negative value was returned.