#NEWLINE# @ classmethod #NEWLINE# def setupClass( self ) : #NEWLINE# #INDENT# from statsmodels.datasets.cpunish import load_pandas #NEWLINE# self . data = load_pandas ( ) #NEWLINE# self . exog = self . data . exog [ [ 'INCOME' , 'SOUTH' ] ] #NEWLINE# self . endog = self . data . endog #NEWLINE# family1 = sm . families . Gamma ( link = sm . families . links . log ) #NEWLINE# self . res1 = sm . GLM ( endog = self . data . endog , exog = self . data . exog [ [ 'INCOME' , 'SOUTH' ] ] , family = family1 ) . fit ( ) #NEWLINE# family2 = sm . families . Tweedie ( var_power = 2 , link_power = 0 ) #NEWLINE# self . res2 = sm . GLM ( endog = self . data . endog , exog = self . data . exog [ [ 'INCOME' , 'SOUTH' ] ] , family = family2 ) . fit ( )