- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我喜欢在 R 中计算逻辑固定效应面板回归(条件最大似然)并获得预测值和/或平均边际效应。
我从生存包中找到了两个函数:bife 和 clogit
尽管如此,这些函数的结果不同,我想知道为什么以及如何修复它。 clogit 函数得到的结果与 Stata (xtlogit, fe) 中的结果相同,但我没有找到从中获得平均边际/部分效应的方法(解释如何这样做也可以解决我的问题)。在 bife 中,结果与 Stata 中的 clogit 和 xtlogit 的结果不同,有一个选项可以计算 PME (getAPEs)。
克洛 git :
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 中相同的结果。然而,在我的例子中,纠错给出了错误:步减半失败。
最佳答案
clogit
和bife
结果的区别由incidental parameter problem 解释。 .
正如您自己已经发现的那样,bife::bias_corr(bife_output)
可以纠正这种偏差。您还可以使用 summary(bife::bias_corr(bife_output))
来获取标准错误。
另请参阅我对 this newer question on Stack Overflow 的更详细回答.
关于r - 为什么 clogit 和 bife 函数(均在 R 中)的结果不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60888086/
我是一名优秀的程序员,十分优秀!