code: def print_results2(res):
      groupind = res.groups
      # res.fitjoint()  #not really necessary, because called by ftest_summary
      ft = res.ftest_summary()
      txt = ""
      # print ft[0]  #skip because table is nicer
      templ = """Table of F-tests for overall or pairwise equality of coefficients'
  %(tab)s
  
  
  Notes: p-values are not corrected for many tests
         (no Bonferroni correction)
         * : reject at 5%% uncorrected confidence level
  Null hypothesis: all or pairwise coefficient are the same'
  Alternative hypothesis: all coefficients are different'
  
  
  Comparison with stats.f_oneway
  %(statsfow)s
  
  
  Likelihood Ratio Test
  %(lrtest)s
  Null model: pooled all coefficients are the same across groups,'
  Alternative model: all coefficients are allowed to be different'
  not verified but looks close to f-test result'
  
  
  OLS parameters by group from individual, separate ols regressions'
  %(olsbg)s
  for group in sorted(res.olsbygroup):
      r = res.olsbygroup[group]
      print group, r.params
  
  
  Check for heteroscedasticity, '
  variance and standard deviation for individual regressions'
  %(grh)s
  variance    ', res.sigmabygroup
  standard dev', np.sqrt(res.sigmabygroup)
  """
  
      from statsmodels.iolib import SimpleTable
  
      resvals = {}
      resvals["tab"] = str(
          SimpleTable(
              [
                  (
                      ["{!r}".format(row[0])]
                      + list(row[1])
                      + ["*"] * (row[1][1] > 0.5).item()
                  )
                  for row in ft[1]
              ],
              headers=[
                  "pair",
                  "F-statistic",
                  "p-value",
                  "df_denom",
                  "df_num",
              ],
          )
      )
      resvals["statsfow"] = str(
          stats.f_oneway(*[y[groupind == gr] for gr in res.unique])
      )
      # resvals['lrtest'] = str(res.lr_test())
      resvals["lrtest"] = str(
          SimpleTable(
              [res.lr_test()],
              headers=["likelihood ratio", "p-value", "df"],
          )
      )
  
      resvals["olsbg"] = str(
          SimpleTable(
              [
                  [group] + res.olsbygroup[group].params.tolist()
                  for group in sorted(res.olsbygroup)
              ]
          )
      )
      resvals["grh"] = str(
          SimpleTable(
              np.vstack([res.sigmabygroup, np.sqrt(res.sigmabygroup)]),
              headers=res.unique.tolist(),
          )
      )
  
      return templ % resvals
  
imports: import numpy
  from scipy import stats
  import statsmodels.api
  from statsmodels.sandbox.regression.onewaygls import OneWayLS
label_desc: Use image node_id 2 for calling a global function with example usage: print_results2(res) and returns: unknown