def power_ztost_prop(low, upp, nobs, p_alt, alpha=0.05, dist='norm', variance_prop=None, discrete=True, continuity=0, critval_continuity=0):
 mean_low = low
 var_low = (std_prop(low, nobs) ** 2)
 mean_upp = upp
 var_upp = (std_prop(upp, nobs) ** 2)
 mean_alt = p_alt
 var_alt = (std_prop(p_alt, nobs) ** 2)
 if (variance_prop is not None):
  var_low = var_upp = (std_prop(variance_prop, nobs) ** 2)
 power = _power_ztost(mean_low, var_low, mean_upp, var_upp, mean_alt, var_alt, alpha=alpha, discrete=discrete, dist=dist, nobs=nobs, continuity=continuity, critval_continuity=critval_continuity)
 return (np.maximum(power[0], 0), power[1:])

def power_ztost_prop ( low , upp , nobs , p_alt , alpha = 0.05 , dist = 'norm' , variance_prop = None , discrete = True , continuity = 0 , critval_continuity = 0 ) : mean_low = low var_low = ( std_prop ( low , nobs ) ** 2 ) mean_upp = upp var_upp = ( std_prop ( upp , nobs ) ** 2 ) mean_alt = p_alt var_alt = ( std_prop ( p_alt , nobs ) ** 2 ) if ( variance_prop is not None ) : var_low = var_upp = ( std_prop ( variance_prop , nobs ) ** 2 ) power = _power_ztost ( mean_low , var_low , mean_upp , var_upp , mean_alt , var_alt , alpha = alpha , discrete = discrete , dist = dist , nobs = nobs , continuity = continuity , critval_continuity = critval_continuity ) return ( np . maximum ( power [ 0 ] , 0 ) , power [ 1 : ] )
power of proportions equivalence test based on normal distribution parameters low .