【问题标题】:coefficients in vglm(), orm(), polr() and clm() for ologitologit 的 vglm()、orm()、polr() 和 clm() 中的系数
【发布时间】:2015-04-26 16:36:39
【问题描述】:

我正在使用不同的包做 ogit,它们是 VGAMrmsMASSordinal,使用来自包 wine 的数据集 ordinal

首先是vglm()

library(VGAM)
vglmfit <- vglm(rating ~ temp * contact, data = wine, 
                family=cumulative(parallel=TRUE, reverse=TRUE))

系数是:

  (Intercept):1       (Intercept):2       (Intercept):3       (Intercept):4 
      1.4112568          -1.1435551          -3.3770742          -4.9419773 
       tempwarm          contactyes tempwarm:contactyes 
      2.3212033           1.3474598           0.3595241 

第二个是orm():

library(rms)
ormfit <- orm(rating ~ temp * contact, data = wine)

系数:

                        Coef    S.E.   Wald Z Pr(>|Z|)
y>=2                     1.4113 0.5454  2.59  0.0097  
y>=3                    -1.1436 0.5097 -2.24  0.0248  
y>=4                    -3.3771 0.6382 -5.29  <0.0001 
y>=5                    -4.9420 0.7509 -6.58  <0.0001 
temp=warm                2.3212 0.7009  3.31  0.0009  
contact=yes              1.3475 0.6604  2.04  0.0413  
temp=warm * contact=yes  0.3595 0.9238  0.39  0.6971

第三,polr

library(MASS)
polrfit <- polr(rating ~ temp * contact, method="logistic", data = wine)

系数:

Coefficients:
           tempwarm          contactyes tempwarm:contactyes 
          2.3211214           1.3474055           0.3596357 

Intercepts:
      1|2       2|3       3|4       4|5 
-1.411278  1.143507  3.377005  4.941901 

最后,clm()

library(ordinal)
clmfit <- clm(rating ~ temp * contact, link="logit", data = wine)

系数:

Coefficients:
           tempwarm          contactyes tempwarm:contactyes 
             2.3212              1.3475              0.3595 

Threshold coefficients:
   1|2    2|3    3|4    4|5 
-1.411  1.144  3.377  4.942 

另外,当reverse=FALSE在vglm()中时,

library(VGAM)
vglmfit <- vglm(rating ~ temp * contact, data = wine, 
                family=cumulative(parallel=TRUE, reverse=FALSE))

Coefficients:
      (Intercept):1       (Intercept):2       (Intercept):3       (Intercept):4 
         -1.4112568           1.1435551           3.3770742           4.9419773 
           tempwarm          contactyes tempwarm:contactyes 
         -2.3212033          -1.3474598          -0.3595241 

您可能会注意到vglm()reverse=TRUE 中的系数与orm() 中的系数相同,polr()clm() 中的系数相同。所以有两组系数,唯一的区别是截距的符号。

虽然我设置了reverse=FALSE,但它确实反转了截距,但同时反转了我不想要的变量参数。

这有什么问题?我怎么能得到完全相同的结果?或者我该如何解释?

【问题讨论】:

    标签: r


    【解决方案1】:

    这只是参数化的问题。引入有序逻辑回归模型的一种经典方法是假设存在潜在的连续响应

    y* = x'b + e

    其中 e 具有标准逻辑分布。然后,假设如果 y* 落在截止点 a_j-1 和 a_j 之间,则仅离散类别 y = j 观察不到 y* 本身。然后得出模型方程:

    logit(P(y

    其他动机导致类似的方程式,但 P(y >= j) 和/或 a_j + x'b。这只会导致您在不同实现中观察到的 a 和/或 b 系数的符号切换。当然,相应的模型和预测是等价的。您觉得哪种解释更容易主要是个人喜好问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-24
      • 2013-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-18
      • 1970-01-01
      相关资源
      最近更新 更多