0

我有一个面板数据库,想运行一个考虑固定效应的回归。使用 Panel.Ols 时,两个固定效果可以正常工作。

我的代码如下所示:

df['countyCode'] = pd.Categorical(df['countyCode'])
df['state'] = pd.Categorical(df['state'])
df1 = df.set_index(['crdFirm','year'])
Y = 'income'
formula = Y + ' ~ 1 +  experience + tenureFirm + EntityEffects + TimeEffects'
mod = PanelOLS.from_formula(formula, df1, other_effects= df1[['countyCode']])
res = mod.fit()

但是,当我尝试使用两个以上的固定效果时,我会收到以下错误消息:

ValueError:最多支持两种效果。

如何在不收到此错误消息的情况下运行具有两个以上固定效果的面板回归?

4

0 回答 0