原版stata分析是行业*年份固定效应,同时cluster了城市层面,我用python做出来的结果和stata不一样,mod.fit(cov_type='robust', cluster_entity=True, cluster_time=True)这一句没有效果,请问大神实际问题在哪?我的代码:
data=pd.read_stata(f)
data=data.set_index(['code','year'])
exog = sm.add_constant(data[['Fintech','Size','LEV','Growth','CapEx','PPE','Indep','GDP' ,'Population']])
fe = PanelOLS(data['Patent'], exog, entity_effects=True, time_effects=True)
fe_res = fe.fit(cov_type='robust', cluster_entity=True, cluster_time=True)
print(fe_res)
这是stata的代码:
xtset code yearxtreg Patent Fintech Size LEV Growth CapEx PPE Indep GDP Population i.year#i.industry, /// fe vce(cluster city)est store m1