def ftest_power(effect_size, df_num, df_denom, alpha, ncc=1):
 nc = ((effect_size ** 2) * ((df_denom + df_num) + ncc))
 crit = stats.f.isf(alpha, df_denom, df_num)
 pow_ = stats.ncf.sf(crit, df_denom, df_num, nc)
 return pow_

def ftest_power ( effect_size , df_num , df_denom , alpha , ncc = 1 ) : nc = ( ( effect_size ** 2 ) * ( ( df_denom + df_num ) + ncc ) ) crit = stats . f . isf ( alpha , df_denom , df_num ) pow_ = stats . ncf . sf ( crit , df_denom , df_num , nc ) return pow_
calculate the power of a f-test .