3

我喜欢在 R 中计算逻辑固定效应面板回归(条件最大似然)并获得预测值和/或平均边际效应。

我从生存包中找到了两个函数:bife 和 clogit

然而,这些功能的结果不同,我想知道为什么以及如何修复它。clogit 函数让我得到与 Stata (xtlogit, fe) 相同的结果,但我没有找到从中获得平均边际/部分影响的方法(解释如何这样做也可以解决我的问题)。在 bife 中,结果与 Stata 中的 clogit 和 xtlogit 的结果不同,有一个计算 PME (getAPE) 的选项。

克罗吉特:

clogit_output <- clogit(binary_variable~ x1 + x2 + x3 + strata(id), data = data) 

生活:

bife_output <- bife(binary_variable ~ x1 + x2 + x3 | id, data = data, model = c("logit"))

我的结果是二进制(0 或 1),预测变量是虚拟变量和数字。我有一个不平衡的小组,有 10.000 名受访者(id)超过 12 年。我声明了面板结构:

data<- pdata.frame(data, index = c("id", "wave"))

clogit 中的结果是:

summary(clogit_output) 
        coef exp(coef)  se(coef)       z Pr(>|z|)
X1 -0.173637  0.840602  0.103450  -1.678  0.09326
X2 -0.467696  0.626444  0.115345  -4.055 5.02e-05
X3 0.743621  2.103538  0.035638  20.866  < 2e-16

毕费:

summary (bife_output)
    Estimate Std. error z value Pr(> |z|) 
X1 -0.2135333  0.1140698  -1.872   0.06121
X2 -0.5624223  0.1268271  -4.435  9.23e-06
X3 0.9150707  0.0399252  22.920   < 2e-16

到目前为止,我假设通过使用 bife (bias_corr(bife_output)) 中的纠错,我会得到与 STATA 或 clogit 相同的结果。然而,在我的情况下,错误更正给出了错误:减半失败。

4

1 回答 1

0

的 差异clogitbife结果 由附带 参数 问题解释.

正如您自己已经发现的那样,bife::bias_corr(bife_output)纠正这种偏见。您也可以使用summary(bife::bias_corr(bife_output))来获取标准错误。

另请参阅我对 Stack Overflow 上这个新问题的更详细回答。

于 2020-12-19T08:35:10.063 回答