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, upp
floator array_like lower and upper limit of equivalence region
- nobs
intor array_like the number of trials or observations.
- p_alt
floator array_likein[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.- alpha
floator array_likein(0, 1),optional significance level of the test
- low, upp
- Returns:
- Raises:
ValueErrorIf
p_altis not in [0, 1] (this includes NaN values), or if the arguments ofbinom_tost_reject_intervalare not valid.
See also
binom_tost_reject_intervalRejection 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.