#NEWLINE# def check_fitted( results ) : #NEWLINE# #INDENT# from statsmodels.genmod.generalized_linear_model import GLMResults #NEWLINE# from statsmodels.discrete.discrete_model import DiscreteResults #NEWLINE# if hasattr ( results , '_results' ) : #NEWLINE# #INDENT# results = results . _results #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# results = results #NEWLINE# #UNINDENT# if ( isinstance ( results , GLMResults ) or isinstance ( results , DiscreteResults ) ) : #NEWLINE# #INDENT# raise SkipTest #NEWLINE# #UNINDENT# res = results #NEWLINE# fitted = res . fittedvalues #NEWLINE# assert_allclose ( ( res . model . endog - fitted ) , res . resid , rtol = 1e-12 ) #NEWLINE# assert_allclose ( fitted , res . predict ( ) , rtol = 1e-12 )