- statsmodels.stats.proportion.power_ztost_prop(low, upp, nobs, p_alt, alpha=0.05, dist='norm', variance_prop=None, discrete=True, continuity=0, critval_continuity=0)¶
Power of proportions equivalence test based on normal distribution
- low, upp
lower and upper limit of equivalence region
number of observations
proportion under the alternative
significance level of the test
This defines the distribution to evaluate the power of the test. The critical values of the TOST test are always based on the normal approximation, but the distribution for the power can be either the normal (default) or the binomial (exact) distribution.
If this is None, then the variances for the two one sided tests are based on the proportions equal to the equivalence limits. If variance_prop is given, then it is used to calculate the variance for the TOST statistics. If this is based on an sample, then the estimated proportion can be used.
If true, then the critical values of the rejection region are converted to integers. If dist is “binom”, this is automatically assumed. If discrete is false, then the TOST critical values are used as floating point numbers, and the power is calculated based on the rejection region that is not discretized.
- continuitybool or
adjust the rejection region for the normal power probability. This has and effect only if
- critval_continuitybool or
If this is non-zero, then the critical values of the tost rejection region are adjusted before converting to integers. This affects both distributions,
- low, upp
In small samples the power for the
discreteversion, has a sawtooth pattern as a function of the number of observations. As a consequence, small changes in the number of observations or in the normal approximation can have a large effect on the power.
critval_continuityare added to match some results of PASS, and are mainly to investigate the sensitivity of the ztost power to small changes in the rejection region. From my interpretation of the equations in the SAS manual, both are zero in SAS.
dist='binom'results match PASS, The
dist='norm'results look reasonable, but no benchmark is available.
SAS Manual: Chapter 68: The Power Procedure, Computational Resources PASS Chapter 110: Equivalence Tests for One Proportion.