【问题标题】:How to get rid of lmer warning message?如何摆脱 lmer 警告信息?
【发布时间】:2014-06-06 15:18:27
【问题描述】:

我对 lmer 做了一些更改。它可以正常工作,但我无法摆脱运行程序时弹出的警告消息。我添加了以下选项,允许程序在不停止但带有警告消息的情况下运行。我相信这是 check.nobs.vs.rankZ = "warningSmall" 部分。我怎么能摆脱这个,有什么建议吗?谢谢。

   lmerControl(check.nobs.vs.nlev = "ignore",check.nobs.vs.rankZ =   
   "warningSmall",check.nlev.gtreq.5 = "ignore",check.nobs.vs.nRE="ignore",
   check.rankX =    c("ignore"),check.scaleX = "ignore",check.formula.LHS="ignore",
   ## convergence checking options
   check.conv.grad   = .makeCC("warning", tol = 1e-3, relTol = NULL),
   check.conv.singular = .makeCC(action = "ignore",     tol = 1e-4),
   check.conv.hess   = .makeCC(action =    "warning", tol = 1e-6)

来自 R 的警告消息:

Warning message:
   In checkZrank(reTrms$Zt, n = n, control, nonSmall = 1e+06) :
     number of observations (=300) <= rank(Z) (=300); the random-effects parameters and the
    residual variance (or scale parameter) are probably unidentifiable

【问题讨论】:

    标签: lmer


    【解决方案1】:

    你应该试试check.nobs.vs.rankZ="ignore"。

    lmerControl 不需要指定除非默认选项以外的任何内容:快速浏览一下,这些是您的非默认值:

    lmerControl(check.nobs.vs.nlev = "ignore",check.nobs.vs.rankZ =   
       "ignore",check.nlev.gtreq.5 = "ignore",check.nobs.vs.nRE="ignore",
       check.rankX =    c("ignore"),
       check.scaleX = "ignore",
       check.formula.LHS="ignore",
       check.conv.grad   = .makeCC("warning", tol = 1e-3, relTol = NULL))
    

    一般来说,我建议您最好关闭仅您知道要覆盖的特定警告和错误 - 上面的设置看起来可能会给您带来麻烦。

    我没有检查这个,因为你没有给reproducible example ...

    【讨论】:

    • 那行得通。我还删除了一些没用的选项。
    • 如果答案对您有用,欢迎您单击我的答案旁边的复选标记以接受它...
    猜你喜欢
    • 2020-12-16
    • 1970-01-01
    • 2022-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-25
    • 1970-01-01
    相关资源
    最近更新 更多