对数回归中估计系数的方向

我正在分析有序逻辑回归,我想知道如何知道估计系数的方向?对于女性,男性,我的变量仅为0、1;对于不同姿势,我的变量仅为0、1、2、4。所以我的问题是,我怎么知道,如果估算值描述的是从0到1的变化或从1到0的变化,是关于性别的?

输出为PicSex加1,是否是一个信号,表明该信号具有1-> 0方向?参见相关代码。

谢谢您的帮助


Cumulative Link Mixed Model fitted with the Laplace approximation

formula: Int ~ PicSex + Posture + (1 | PicID)
data:    x

Random effects:
 Groups Name        Variance Std.Dev.
 PicID  (Intercept) 0.0541   0.2326  
Number of groups:  PicID 16 

Coefficients:
        Estimate Std. Error z value Pr(>|z|)    
PicSex1   0.3743     0.1833   2.042   0.0411 *  
Posture  -1.1232     0.1866  -6.018 1.77e-09 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


P.S.
Thank you here are my head results (I relabeled PicSex to Sex)

> head(Posture)
[1] 1 1 1 1 1 1
Levels: 0 1
> head(Sex)
[1] 0 0 0 0 0 0
Levels: 0 1

So the level order is the same,but on Sex it still added  a 1 but on posture not. Still very confused about the directions.



Sdfadfadf 回答:对数回归中估计系数的方向

您的性别有两个级别,0或1。因此,PicSex1表示PicSex的效果为1,而PicSex为0。

library(ordinal)
DATA = wine
> head(DATA$temp)
[1] cold cold cold cold warm warm
Levels: cold warm

这里的感冒在Levels中是第一位的,因此在任何线性模型中都将其设置为参考。首先,我们验证感冒与温暖的影响

do.call(cbind,tapply(DATA$rating,DATA$temp,table))
#warm has a higher average rating

适合模型

# we fit the a model,temp is fixed effect
summary(clmm(rating ~ temp + contact+(1|judge),data = DATA))
Cumulative Link Mixed Model fitted with the Laplace approximation

formula: rating ~ temp + contact + (1 | judge)
data:    DATA

 link  threshold nobs logLik AIC    niter    max.grad cond.H 
 logit flexible  72   -81.57 177.13 332(999) 1.03e-05 2.8e+01

Random effects:
 Groups Name        Variance Std.Dev.
 judge  (Intercept) 1.279    1.131   
Number of groups:  judge 9 

Coefficients:
           Estimate Std. Error z value Pr(>|z|)    
tempwarm     3.0630     0.5954   5.145 2.68e-07 ***
contactyes   1.8349     0.5125   3.580 0.000344 ***

在这里,我们看到温暖与“温度”相关,并且众所周知,它具有正系数,因为与寒冷(参考)相比,温暖的等级更好。

因此,如果您将另一个组设置为参考,则会看到另一个名称附加,并且系数是相反的(-3 ..与上一示例中的+3 ..相比)

# we set warm as reference now
DATA$temp = relevel(DATA$temp,ref="warm")

summary(clmm(rating ~ temp + contact+(1|judge),data = DATA))
Cumulative Link Mixed Model fitted with the Laplace approximation

formula: rating ~ temp + contact + (1 | judge)
data:    DATA

 link  threshold nobs logLik AIC    niter    max.grad cond.H 
 logit flexible  72   -81.57 177.13 269(810) 1.14e-04 1.8e+01

Random effects:
 Groups Name        Variance Std.Dev.
 judge  (Intercept) 1.28     1.131   
Number of groups:  judge 9 

Coefficients:
           Estimate Std. Error z value Pr(>|z|)    
tempcold    -3.0630     0.5954  -5.145 2.68e-07 ***
contactyes   1.8349     0.5125   3.580 0.000344 ***

因此,在拟合模型之前,请始终检查参考是什么

本文链接:https://www.f2er.com/3137504.html

大家都在问