コード例 #1
0
ファイル: ex_onewaygls.py プロジェクト: JerWatson/statsmodels
    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


# get results for example
# -----------------------

print("\nTest for equality of coefficients for all exogenous variables")
print("-------------------------------------------------------------")
res = OneWayLS(y, x, groups=groupind.astype(int))
print_results(res)

print("\n\nOne way ANOVA, constant is the only regressor")
print("---------------------------------------------")

print("this is the same as scipy.stats.f_oneway")
res = OneWayLS(y, np.ones(len(y)), groups=groupind)
print_results(res)


print("\n\nOne way ANOVA, constant is the only regressor with het is true")
print("--------------------------------------------------------------")

print("this is the similar to scipy.stats.f_oneway,")
print("but variance is not assumed to be the same across groups")
コード例 #2
0
ファイル: ex_onewaygls.py プロジェクト: kikuriyou/example
        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


#get results for example
#-----------------------

print('\nTest for equality of coefficients for all exogenous variables')
print('-------------------------------------------------------------')
res = OneWayLS(y, x, groups=groupind.astype(int))
print_results(res)

print('\n\nOne way ANOVA, constant is the only regressor')
print('---------------------------------------------')

print('this is the same as scipy.stats.f_oneway')
res = OneWayLS(y, np.ones(len(y)), groups=groupind)
print_results(res)

print('\n\nOne way ANOVA, constant is the only regressor with het is true')
print('--------------------------------------------------------------')

print('this is the similar to scipy.stats.f_oneway,')
print('but variance is not assumed to be the same across groups')
res = OneWayLS(y, np.ones(len(y)), groups=groupind.astype(str), het=True)
コード例 #3
0
    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


# get results for example
# -----------------------

print "\nTest for equality of coefficients for all exogenous variables"
print "-------------------------------------------------------------"
res = OneWayLS(y, x, groups=groupind.astype(int))
print_results(res)

print "\n\nOne way ANOVA, constant is the only regressor"
print "---------------------------------------------"

print "this is the same as scipy.stats.f_oneway"
res = OneWayLS(y, np.ones(len(y)), groups=groupind)
print_results(res)


print "\n\nOne way ANOVA, constant is the only regressor with het is true"
print "--------------------------------------------------------------"

print "this is the similar to scipy.stats.f_oneway,"
print "but variance is not assumed to be the same across groups"