'printable string of summary'

def print_summary(res):

    groupind = res.groups
    if hasattr(res, 'self.summarytable'):
        summtable = self.summarytable
    else:
        (_, summtable) = res.ftest_summary()
    txt = ''
    templ = "Table    of    F-tests    for    overall    or    pairwise    equality    of    coefficients'\n%(tab)s\n\n\nNotes:    p-values    are    not    corrected    for    many    tests\n                            (no    Bonferroni    correction)\n                            *    :    reject    at    5%%    uncorrected    confidence    level\nNull    hypothesis:    all    or    pairwise    coefficient    are    the    same'\nAlternative    hypothesis:    all    coefficients    are    different'\n\n\nComparison    with    stats.f_oneway\n%(statsfow)s\n\n\nLikelihood    Ratio    Test\n%(lrtest)s\nNull    model:    pooled    all    coefficients    are    the    same    across    groups,'\nAlternative    model:    all    coefficients    are    allowed    to    be    different'\nnot    verified    but    looks    close    to    f-test    result'\n\n\nOls    parameters    by    group    from    individual,    separate    ols    regressions'\n%(olsbg)s\nfor    group    in    sorted(res.olsbygroup):\n                r    =    res.olsbygroup[group]\n                print    group,    r.params\n\n\nCheck    for    heteroscedasticity,    '\nvariance    and    standard    deviation    for    individual    regressions'\n%(grh)s\nvariance                ',    res.sigmabygroup\nstandard    dev',    np.sqrt(res.sigmabygroup)\n"
    from statsmodels.iolib import SimpleTable
    resvals = {}
    resvals['tab'] = str(SimpleTable([(([('%r' % (row[0],))] + list(row[1])) + (['*'] * (row[1][1] > 0.5).item())) for row in summtable], headers=['pair', 'F-statistic', 'p-value', 'df_denom', 'df_num']))
    resvals['statsfow'] = str(stats.f_oneway(*[res.endog[(groupind == gr)] for gr in res.unique]))
    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)
