def test_multiple_no_effects(data):
dependent = data.set_index(['nr', 'year']).lwage
exog = sm.add_constant(data.set_index(['nr', 'year'])[['expersq', 'married', 'union']])
res = PanelOLS(dependent, exog).fit()
exog = sm.add_constant(data.set_index(['nr', 'year'])[['married', 'union']])
res3 = PooledOLS(dependent, exog).fit()
exog = data.set_index(['nr', 'year'])[['exper']]
res4 = RandomEffects(dependent, exog).fit()
comp = compare(dict(a=res, model2=res3, model3=res4))
assert len(comp.rsquared) == 3
d = dir(comp)
for value in d:
if value.startswith('_'):
continue
getattr(comp, value)
compare(OrderedDict(a=res, model2=res3, model3=res4))
评论列表
文章目录