【问题标题】:Error: (maxstephalfit) PIRLS step-halvings failed to reduce deviance in pwrssUpdate in lme4 for ratio data错误:(maxstephalfit)PIRLS 减半未能减少 lme4 中 pwrssUpdate 中比率数据的偏差
【发布时间】:2015-05-02 03:18:43
【问题描述】:

我的数据是比率数据。所以我尝试使用lme4() 和二项式模型来分析它。

这是我的代码:

fate.reP = glmer(predated~type+(1|island),data=fate.rate,family="binomial")

这是一组样本数据:

type    cluster  tree   predated
 B        B7-1    1       0.48  
 B        B7-1    2       0.66
 B        B7-2    3       0.18
 M         I63    8       0.55
 M         I63    9       0.6
 M         I63   20       0.41
 M         I63   21       0.42
 S         I14    5       0.75
 S         I14   17       0.53
 S         I15    6       0.23
 S         I15    7       0.03

当我运行模型时,它显示:

Error: (maxstephalfit) PIRLS step-halvings failed to reduce deviance in pwrssUpdate
In addition: Warning message:
In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!

我的数据中是否存在错误,或任何其他错误? 我正在为 Windows 使用 R 3.0.3。

【问题讨论】:

    标签: r lme4


    【解决方案1】:

    警告non-integer #successes in a binomial glm! 提示您lme4 中的二项式响应必须是整数。我在这里看不到分母(即暴露于捕食的个体总数):如果您在数据集中将它们作为(例如)total_exposed,您可以使用

    fate.reP <- glmer(predated~type+(1|island),
         data=fate.rate,family="binomial",
         weights=total_exposed)
    

    lme4 的行为与基础 R 中的 glm 略有不同,如果glm 为非整数,则会发出警告但仍会产生结果。

    【讨论】:

    • 感谢您的帮助。我已经解决了这个问题。我还有一个问题:如果我的数据中有很多 0 值,我可以对我的数据使用广义线性混合模型吗?比如我的示例数据中,predated 值有很多 0 值,函数 glmer() 会运行成功吗?
    • 二项式模型应该可以很好地处理零。如果零点比模型预测的多得多(即零膨胀或零改变模型),则模型仍然可以工作,但拟合可能不是很好。
    • 非常感谢您的回答。我是 R 语言的新手,所以你能给我一些关于零膨胀模型的详细建议吗?这种方法与 GLMM 不同吗?还是只是对 GLMM 的改编?
    猜你喜欢
    • 2017-04-19
    • 2016-09-28
    • 1970-01-01
    • 2013-11-26
    • 2011-01-22
    • 1970-01-01
    • 2016-11-16
    • 1970-01-01
    • 2019-07-31
    相关资源
    最近更新 更多