【发布时间】:2020-03-05 03:43:25
【问题描述】:
我正在分析序数逻辑回归,我想知道,如何知道估计系数的方向?我的变量只有 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.
【问题讨论】:
-
您是否获得了用于获取此公式的代码,例如
glm(...)或同等学历?如果您知道您的链接功能应该很清楚,但测试它的一种简单方法是使用具有predict功能的模型对象对新的姿势值进行预测,并观察预测是增加还是减少 -
如果我理解正确的话,PicSex1 是性的固定效应,并且是分类的。因此,您的模型的总体截距是 R 识别为第一个的性别级别(因此,如果您将性别编码为 F 或 M,F 将是参考,因为它在字母表中是第一个)。 PicID 的 RE 以“0”为中心,但实际上它是您拟合性别截距后截距项周围的方差。我会,作为一个健全的检查,只是做
levels(PicSex),虽然使用predict函数的建议也很棒。 -
我使用了以下代码:“var.with.red
标签: r statistics logistic-regression mixed-models