用 felm 进行固定效应回归

fixed effects regression with felm

我想知道为什么我的固定效应回归不起作用。

我的代码如下:

sfeL=felm(sätzegesp~TTRverf,spieler|0|0, data=datregT)

sätzegesp 是数字向量,TTRverf 是虚拟变量,固定效应变量 spieler 是表示每个人 ID 的数字向量。

不幸的是,我得到了错误

operators are only possible for numeric, logical or complex types

我不熟悉felm(),但通常我们使用y ~ x1 + x2 + .. + xn之类的东西作为公式,而不是y ~ x1, x2, ... xn。这可能是问题所在。您可以在 lfe 包 here.

的文档中的示例中看到它

所以尝试使用

sfeL <- felm(sätzegesp ~ TTRverf + spieler|0|0, data= datregT)