#NEWLINE# def __init__( self , t = None , F = None , sd = None , effect = None , df_denom = None , df_num = None , alpha = 0.05 , **kwds ) : #NEWLINE# #INDENT# self . effect = effect #NEWLINE# if ( F is not None ) : #NEWLINE# #INDENT# self . distribution = 'F' #NEWLINE# self . fvalue = F #NEWLINE# self . statistic = self . fvalue #NEWLINE# self . df_denom = df_denom #NEWLINE# self . df_num = df_num #NEWLINE# self . dist = fdist #NEWLINE# self . dist_args = ( df_num , df_denom ) #NEWLINE# self . pvalue = fdist . sf ( F , df_num , df_denom ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( t is not None ) : #NEWLINE# #INDENT# self . distribution = 't' #NEWLINE# self . tvalue = t #NEWLINE# self . statistic = t #NEWLINE# self . sd = sd #NEWLINE# self . df_denom = df_denom #NEWLINE# self . dist = student_t #NEWLINE# self . dist_args = ( df_denom , ) #NEWLINE# self . pvalue = ( self . dist . sf ( np . abs ( t ) , df_denom ) * 2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'statistic' in kwds ) : #NEWLINE# #INDENT# self . distribution = kwds [ 'distribution' ] #NEWLINE# self . statistic = kwds [ 'statistic' ] #NEWLINE# self . tvalue = value = kwds [ 'statistic' ] #NEWLINE# self . sd = sd #NEWLINE# self . dist = getattr ( stats , self . distribution ) #NEWLINE# self . dist_args = ( ) #NEWLINE# if ( self . distribution is 'chi2' ) : #NEWLINE# #INDENT# self . pvalue = self . dist . sf ( self . statistic , df_denom ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# 'normal' #NEWLINE# self . pvalue = ( self . dist . sf ( np . abs ( value ) ) * 2 ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# self . pvalue = np . squeeze ( self . pvalue )