使用glmer进行逻辑回归,如何验证响应参考 [英] Using glmer for logistic regression, how to verify response reference

查看:281
本文介绍了使用glmer进行逻辑回归,如何验证响应参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题很简单,但是我一直无法在R手册或在线搜索中找到明确的答案.使用glmer进行Logistic回归时,是否有一种很好的方法来验证您对响应变量的引用是什么?

My question is quite simple, but I've been unable to find a clear answer in either R manuals or online searching. Is there a good way to verify what your reference is for the response variable when doing a logistic regression with glmer?

我得到的结果始终与理论完全相反,我认为我的反应变量必须与我的意图相反,但我无法验证.

I am getting results that consistently run the exact opposite of theory and I think my response variable must be reversed from my intention, but I have been unable to verify.

我的响应变量编码为0和1.

My response variable is coded in 0's and 1's.

谢谢!

推荐答案

您可以在知道真实效果的地方模拟一些数据... ?simulate.merMod使此操作相对容易.无论如何

You could simulate some data where you know the true effects ... ?simulate.merMod makes this relatively easy. In any case,

  • 根据影响对响应1的对数奇数的影响来解释影响
  • 例如,斜率0.5表示预测变量增加1个单位会使观察1(而不是0)的对数几率增加0.5.
  • 对于此类问题,glmerglm继承其框架. ?family特别指出:
  • the effects are interpreted in terms of their effect on the log-odds of a response of 1
  • e.g., a slope of 0.5 implies that a 1-unit increase in the predictor variable increases the log-odds of observing a 1 rather than a 0 by 0.5.
  • for questions of this sort, glmer inherits its framework from glm. In particular, ?family states:

对于二项式"和准二项式"家庭,回应可以 可以通过以下三种方式之一进行指定:

For the ‘binomial’ and ‘quasibinomial’ families the response can be specified in one of three ways:

   1. As a factor: ‘success’ is interpreted as the factor not
      having the first level (and hence usually of having the
      second level).

   2. As a numerical vector with values between ‘0’ and ‘1’,
      interpreted as the proportion of successful cases (with the
      total number of cases given by the ‘weights’).

   3. As a two-column integer matrix: the first column gives the
      number of successes and the second the number of failures.

您的数据是#2的(常见)特殊情况(每种情况下的成功比例"为零或100%,因为每个观察结果只有一个情况;权重向量是所有情况的向量)默认情况下.)

Your data are a (common) special case of #2 (the "proportion of successes" is either zero or 100% for each case, because there is only one case per observation; the weights vector is a vector of all ones by default).

这篇关于使用glmer进行逻辑回归,如何验证响应参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆