【问题标题】:Strange error in GLMGLM 中的奇怪错误
【发布时间】:2015-02-24 11:20:23
【问题描述】:

我正在创建多个泊松回归,每个模型都有不同的结果。在这个与其他结果没有什么不同的特殊结果(所有二进制,0 或 1)上,我得到了这个我以前从未见过的奇怪错误。

mix_1<- glm(count~ offset(log(time)) + age + gender, data=x[x$diagnosis=="match",], family=poisson)

glm 模型没有任何问题,我没有按预期工作。尝试执行 cbind 并对系数求幂时收到错误消息。

mix_2 <- cbind(exp(coef(mix_1)), exp(confint(mix_1)))

这是我得到的错误:

   Waiting for profiling to be done...
    Error in glm.fit(x = Xi, y = Y, weights = W, etastart = LP, offset = o,  : 
      NA/NaN/Inf in 'x'
   warning
Warning messages:
1: glm.fit: fitted rates numerically 0 occurred

我认为这个问题不需要数据子集,因此我没有提供。但如果我真的没有必要,请告诉我,我会创建一个子集。

非常感谢所有帮助!

【问题讨论】:

    标签: error-handling count regression glm poisson


    【解决方案1】:

    我刚刚遇到了同样的问题。在 Andrew Gelman 的博客 here 上,围绕 MASS 和 glm.fit 的问题进行了一些讨论,这可能至少略有相关。

    问题似乎出在confint() 函数上。来自confint手册:

    “glm”和“nls”类有存根方法 它调用包 MASS 中基于配置文件的那些 可能性。

    ...

    confint(glm.D93) # needs MASS to be present on the system

    confint.default(glm.D93) # based on asymptotic normality

    我发现如果我使用confint.default() 函数,问题就会消失。我希望我有更多的答案。

    【讨论】:

      猜你喜欢
      • 2018-05-31
      • 1970-01-01
      • 1970-01-01
      • 2011-02-06
      • 2015-10-08
      • 2018-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多