如何摆脱lmer警告信息?

时间:2014-06-06 15:18:28

标签: lmer

我对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

1 个答案:

答案 0 :(得分:0)

您应该尝试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 ...