【问题标题】:why do results of clogit and bife function (both in R) differ?为什么clogit和bife函数(都在R中)的结果不同?
【发布时间】:2020-03-27 14:31:43
【问题描述】:

我喜欢在 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 中相同的结果。然而,在我的情况下,错误更正给出了错误:步减半失败。

【问题讨论】:

    标签: r logistic-regression survival longitudinal


    【解决方案1】:

    clogitbife 结果的区别由incidental parameter problem 解释。

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

    另请参阅我对this newer question on Stack Overflow 的更详细回答。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-03-14
      • 1970-01-01
      • 2019-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-19
      相关资源
      最近更新 更多