def summary_params_frame(results, yname=None, xname=None, alpha=0.05, use_t=True):
 if isinstance(results, tuple):
  (results, params, std_err, tvalues, pvalues, conf_int) = results
 else:
  params = results.params
  std_err = results.bse
  tvalues = results.tvalues
  pvalues = results.pvalues
  conf_int = results.conf_int(alpha)
 alp = (str(((1 - alpha) * 100)) + '%')
 if use_t:
  param_header = ['coef', 'std err', 't', 'P>|t|', 'Conf. Int. Low', 'Conf. Int. Upp.']
 else:
  param_header = ['coef', 'std err', 'z', 'P>|z|', 'Conf. Int. Low', 'Conf. Int. Upp.']
 (_, xname) = _getnames(results, yname=yname, xname=xname)
 from pandas import DataFrame
 table = np.column_stack((params, std_err, tvalues, pvalues, conf_int))
 return DataFrame(table, columns=param_header, index=xname)

def summary_params_frame ( results , yname = None , xname = None , alpha = 0.05 , use_t = True ) : if isinstance ( results , tuple ) : ( results , params , std_err , tvalues , pvalues , conf_int ) = results else : params = results . params std_err = results . bse tvalues = results . tvalues pvalues = results . pvalues conf_int = results . conf_int ( alpha ) alp = ( str ( ( ( 1 - alpha ) * 100 ) ) + '%' ) if use_t : param_header = [ 'coef' , 'std err' , 't' , 'P>|t|' , 'Conf. Int. Low' , 'Conf. Int. Upp.' ] else : param_header = [ 'coef' , 'std err' , 'z' , 'P>|z|' , 'Conf. Int. Low' , 'Conf. Int. Upp.' ] ( _ , xname ) = _getnames ( results , yname = yname , xname = xname ) from pandas import DataFrame table = np . column_stack ( ( params , std_err , tvalues , pvalues , conf_int ) ) return DataFrame ( table , columns = param_header , index = xname )
create a summary table for the parameters parameters res : results instance some required information is directly taken from the result instance yname : string or none optional name for the endogenous variable .