尝试在R中运行glmer时显示警告消息 [英] warning messages when trying to run glmer in r

查看:129
本文介绍了尝试在R中运行glmer时显示警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的堆栈溢出社区,

当前,我正在尝试对R和lme4的最新版本重新运行旧的数据分析(二项式glmer模型)(从2013年初开始),因为我已经没有R和lme4的旧版本了.但是,我遇到了与dmartin和carine的先前线程(第一条警告消息)以及堆栈溢出之外的其他线程(警告2和3)类似的警告消息.这些警告消息没有在我使用的R和lme4的早期版本中弹出,因此它一定与最新更新有关吗?

Currently I'm trying to rerun an old data analysis, binomial glmer model, (from early 2013) on the latest version of R and lme4, because I don't have the old versions of R and lme4 anymore. However, I experience similar warning messages as previous threads by dmartin and carine (first warning message) and other threads outside stack overflow (warnings 2 and 3). These warning messages didn't pop up on the earlier version of R and lme4 I used, so it must have something to do with latest updates?

我的数据集的一个子集:

A subset of my dataset:

    df <- structure(list(SUR.ID = structure(c(1L, 1L, 2L, 2L, 3L, 3L, 1L, 
1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 
3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 
2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 
1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 
3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 
2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 
1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 
3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L, 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 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 
    2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 
    1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 
    2L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 
    2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L
    ), .Label = c("CT", "PT-04"), class = "factor"), ValidDetections = c(0L, 
    0L, 6L, 5L, 1L, 7L, 0L, 0L, 5L, 8L, 7L, 3L, 0L, 0L, 1L, 4L, 
    1L, 0L, 0L, 0L, 0L, 1L, 2L, 1L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 
    0L, 3L, 5L, 5L, 4L, 0L, 0L, 6L, 7L, 6L, 5L, 0L, 0L, 0L, 1L, 
    2L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 23L, 
    21L, 15L, 28L, 11L, 27L, 22L, 31L, 29L, 30L, 32L, 45L, 18L, 
    19L, 29L, 26L, 32L, 43L, 7L, 5L, 7L, 4L, 6L, 10L, 0L, 0L, 
    0L, 0L, 0L, 0L, 24L, 22L, 19L, 23L, 21L, 34L, 9L, 13L, 30L, 
    25L, 33L, 21L, 4L, 18L, 22L, 29L, 11L, 38L, 2L, 7L, 5L, 7L, 
    6L, 9L, 0L, 0L, 0L, 0L, 0L, 0L, 23L, 20L, 24L, 26L, 29L, 
    34L, 6L, 7L, 5L, 4L, 6L, 10L, 0L, 0L, 3L, 0L, 1L, 6L, 0L, 
    0L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 2L, 0L, 5L, 0L, 0L, 0L, 0L, 
    0L, 1L, 0L, 0L, 0L, 3L, 1L, 11L, 0L, 0L, 2L, 5L, 1L, 2L, 
    0L, 0L, 0L, 3L, 0L, 4L, 0L, 0L, 0L, 2L, 0L, 2L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 4L, 2L, 5L, 6L, 6L, 2L, 3L, 0L, 0L, 1L, 
    3L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 21L, 12L, 
    15L, 8L, 23L, 7L, 2L, 2L, 1L, 1L), CountDetections = c(0L, 
    0L, 7L, 5L, 3L, 7L, 0L, 0L, 5L, 8L, 8L, 4L, 0L, 0L, 1L, 4L, 
    1L, 1L, 0L, 0L, 0L, 1L, 3L, 3L, 0L, 0L, 1L, 0L, 2L, 4L, 0L, 
    0L, 4L, 5L, 5L, 5L, 0L, 0L, 6L, 7L, 7L, 5L, 0L, 0L, 0L, 1L, 
    2L, 2L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 2L, 23L, 
    21L, 18L, 28L, 11L, 27L, 23L, 31L, 29L, 30L, 34L, 45L, 19L, 
    19L, 29L, 26L, 32L, 43L, 7L, 5L, 7L, 4L, 6L, 10L, 0L, 0L, 
    0L, 0L, 0L, 0L, 24L, 22L, 19L, 23L, 21L, 34L, 10L, 15L, 30L, 
    25L, 34L, 24L, 4L, 19L, 23L, 29L, 13L, 38L, 2L, 7L, 5L, 7L, 
    7L, 9L, 0L, 0L, 0L, 0L, 0L, 0L, 23L, 20L, 24L, 26L, 29L, 
    34L, 6L, 7L, 5L, 4L, 6L, 10L, 0L, 0L, 4L, 1L, 1L, 7L, 0L, 
    0L, 0L, 3L, 2L, 1L, 0L, 0L, 0L, 3L, 0L, 5L, 0L, 0L, 2L, 2L, 
    0L, 1L, 0L, 0L, 0L, 5L, 1L, 11L, 0L, 0L, 3L, 5L, 1L, 2L, 
    0L, 0L, 2L, 3L, 0L, 6L, 0L, 0L, 0L, 3L, 0L, 3L, 0L, 0L, 1L, 
    0L, 0L, 1L, 0L, 0L, 6L, 2L, 5L, 6L, 7L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, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L
    ), .Label = c("03/06/13", "2/22/13", "2/26/13", "2/27/13", 
    "3/14/13"), class = "factor"), R.det = c(0, 0, 0.857142857, 
    1, 0.333333333, 1, 0, 0, 1, 1, 0.875, 0.75, 0, 0, 1, 1, 1, 
    0, 0, 0, 0, 1, 0.666666667, 0.333333333, 0, 0, 0, 0, 1, 0, 
    0, 0, 0.75, 1, 1, 0.8, 0, 0, 1, 1, 0.857142857, 1, 0, 0, 
    0, 1, 1, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0.833333333, 
    1, 1, 1, 0.956521739, 1, 1, 1, 0.941176471, 1, 0.947368421, 
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 
    1, 1, 1, 1, 0.9, 0.866666667, 1, 1, 0.970588235, 0.875, 1, 
    0.947368421, 0.956521739, 1, 0.846153846, 1, 1, 1, 1, 1, 
    0.857142857, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 
    1, 1, 1, 1, 0, 0, 0.75, 0, 1, 0.857142857, 0, 0, 0, 0.333333333, 
    0.5, 1, 0, 0, 0, 0.666666667, 0, 1, 0, 0, 0, 0, 0, 1, 0, 
    0, 0, 0.6, 1, 1, 0, 0, 0.666666667, 1, 1, 1, 0, 0, 0, 1, 
    0, 0.666666667, 0, 0, 0, 0.666666667, 0, 0.666666667, 0, 
    0, 0, 0, 0, 0, 0, 0, 0.666666667, 1, 1, 1, 0.857142857, 0.5, 
    0.6, 0, 0, 0.333333333, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0.913043478, 1, 0.9375, 0.8, 1, 0.7, 1, 1, 1, 1), c.receiver.depth = c(-0.2, 
    -0.2, -0.2, -0.2, -0.2, -0.2, -0.22, -0.22, -0.22, -0.22, 
    -0.22, -0.22, -0.22, -0.22, -0.22, -0.22, -0.22, -0.22, -0.225, 
    -0.225, -0.225, -0.225, -0.225, -0.225, -0.225, -0.225, -0.225, 
    -0.225, -0.225, -0.225, -0.205, -0.205, -0.205, -0.205, -0.205, 
    -0.205, -0.185, -0.185, -0.185, -0.185, -0.185, -0.185, -0.18, 
    -0.18, -0.18, -0.18, -0.18, -0.18, -0.165, -0.165, -0.165, 
    -0.165, -0.165, -0.165, -0.14, -0.14, -0.14, -0.14, -0.14, 
    -0.14, -0.34, -0.34, -0.34, -0.34, -0.34, -0.34, -0.365, 
    -0.365, -0.365, -0.365, -0.365, -0.365, -0.365, -0.365, -0.365, 
    -0.365, -0.365, -0.365, -0.38, -0.38, -0.38, -0.38, -0.38, 
    -0.38, -0.385, -0.385, -0.385, -0.385, -0.385, -0.385, -0.395, 
    -0.395, -0.395, -0.395, -0.395, -0.395, -0.4, -0.4, -0.4, 
    -0.4, -0.4, -0.4, -0.395, -0.395, -0.395, -0.395, -0.395, 
    -0.395, -0.38, -0.38, -0.38, -0.38, -0.38, -0.38, -0.37, 
    -0.37, -0.37, -0.37, -0.37, -0.37, -0.285, -0.285, -0.285, 
    -0.285, -0.285, -0.285, -0.31, -0.31, -0.31, -0.31, -0.31, 
    -0.31, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.225, 0.225, 
    0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 
    0.225, 0.21, 0.21, 0.21, 0.21, 0.21, 0.21, 0.185, 0.185, 
    0.185, 0.185, 0.185, 0.185, 0.175, 0.175, 0.175, 0.175, 0.175, 
    0.175, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 
    0.13, 0.13, 0.13, 0.105, 0.105, 0.105, 0.105, 0.105, 0.105, 
    0.215, 0.215, 0.215, 0.215, 0.215, 0.215, 0.54, 0.54, 0.54, 
    0.54, 0.54, 0.54, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 
    0.515, 0.515, 0.515, 0.515, 0.515, 0.515, 0.545, 0.545, 0.545, 
    0.545, 0.545, 0.545, 0.525, 0.525, 0.525, 0.525), c.tm.depth = c(0.042807692, 
    0.042807692, 0.042807692, 0.042807692, 0.042807692, 0.042807692, 
    -0.282192308, -0.282192308, -0.282192308, -0.282192308, -0.282192308, 
    -0.282192308, -0.427192308, -0.427192308, -0.427192308, -0.427192308, 
    -0.427192308, -0.427192308, -0.027192308, -0.027192308, -0.027192308, 
    -0.027192308, -0.027192308, -0.027192308, 0.022807692, 0.022807692, 
    0.022807692, 0.022807692, 0.022807692, 0.022807692, 0.042807692, 
    0.042807692, 0.042807692, 0.042807692, 0.042807692, 0.042807692, 
    -0.267192308, -0.267192308, -0.267192308, -0.267192308, -0.267192308, 
    -0.267192308, -0.312192308, -0.312192308, -0.312192308, -0.312192308, 
    -0.312192308, -0.312192308, 0.062807692, 0.062807692, 0.062807692, 
    0.062807692, 0.062807692, 0.062807692, 0.127807692, 0.127807692, 
    0.127807692, 0.127807692, 0.127807692, 0.127807692, -0.592192308, 
    -0.592192308, -0.592192308, -0.592192308, -0.592192308, -0.592192308, 
    -0.612192308, -0.612192308, -0.612192308, -0.612192308, -0.612192308, 
    -0.612192308, -0.597192308, -0.597192308, -0.597192308, -0.597192308, 
    -0.597192308, -0.597192308, -0.607192308, -0.607192308, -0.607192308, 
    -0.607192308, -0.607192308, -0.607192308, -0.327192308, -0.327192308, 
    -0.327192308, -0.327192308, -0.327192308, -0.327192308, -0.572192308, 
    -0.572192308, -0.572192308, -0.572192308, -0.572192308, -0.572192308, 
    -0.622192308, -0.622192308, -0.622192308, -0.622192308, -0.622192308, 
    -0.622192308, -0.572192308, -0.572192308, -0.572192308, -0.572192308, 
    -0.572192308, -0.572192308, -0.577192308, -0.577192308, -0.577192308, 
    -0.577192308, -0.577192308, -0.577192308, -0.272192308, -0.272192308, 
    -0.272192308, -0.272192308, -0.272192308, -0.272192308, -0.547192308, 
    -0.547192308, -0.547192308, -0.547192308, -0.547192308, -0.547192308, 
    -0.607192308, -0.607192308, -0.607192308, -0.607192308, -0.607192308, 
    -0.607192308, 0.552807692, 0.552807692, 0.552807692, 0.552807692, 
    0.552807692, 0.552807692, 0.402807692, 0.402807692, 0.402807692, 
    0.402807692, 0.402807692, 0.402807692, 0.777807692, 0.777807692, 
    0.777807692, 0.777807692, 0.777807692, 0.777807692, 0.752807692, 
    0.752807692, 0.752807692, 0.752807692, 0.752807692, 0.752807692, 
    0.752807692, 0.752807692, 0.752807692, 0.752807692, 0.752807692, 
    0.752807692, 0.402807692, 0.402807692, 0.402807692, 0.402807692, 
    0.402807692, 0.402807692, 0.292807692, 0.292807692, 0.292807692, 
    0.292807692, 0.292807692, 0.292807692, 0.667807692, 0.667807692, 
    0.667807692, 0.667807692, 0.667807692, 0.667807692, 0.677807692, 
    0.677807692, 0.677807692, 0.677807692, 0.677807692, 0.677807692, 
    0.777807692, 0.777807692, 0.777807692, 0.777807692, 0.777807692, 
    0.777807692, 0.252807692, 0.252807692, 0.252807692, 0.252807692, 
    0.252807692, 0.252807692, 0.352807692, 0.352807692, 0.352807692, 
    0.352807692, 0.352807692, 0.352807692, 0.502807692, 0.502807692, 
    0.502807692, 0.502807692, 0.502807692, 0.502807692, 0.027807692, 
    0.027807692, 0.027807692, 0.027807692, 0.027807692, 0.027807692, 
    0.077807692, 0.077807692, 0.077807692, 0.077807692), c.temp = c(-4.095807692, 
    -4.095807692, -4.095807692, -4.095807692, -4.095807692, -4.095807692, 
    -4.220807692, -4.220807692, -4.220807692, -4.220807692, -4.220807692, 
    -4.220807692, -4.210807692, -4.210807692, -4.210807692, -4.210807692, 
    -4.210807692, -4.210807692, -4.175807692, -4.175807692, -4.175807692, 
    -4.175807692, -4.175807692, -4.175807692, -4.035807692, -4.035807692, 
    -4.035807692, -4.035807692, -4.035807692, -4.035807692, -3.920807692, 
    -3.920807692, -3.920807692, -3.920807692, -3.920807692, -3.920807692, 
    -3.820807692, -3.820807692, -3.820807692, -3.820807692, -3.820807692, 
    -3.820807692, -3.640807692, -3.640807692, -3.640807692, -3.640807692, 
    -3.640807692, -3.640807692, -3.660807692, -3.660807692, -3.660807692, 
    -3.660807692, -3.660807692, -3.660807692, -3.620807692, -3.620807692, 
    -3.620807692, -3.620807692, -3.620807692, -3.620807692, 0.074192308, 
    0.074192308, 0.074192308, 0.074192308, 0.074192308, 0.074192308, 
    -0.015807692, -0.015807692, -0.015807692, -0.015807692, -0.015807692, 
    -0.015807692, 0.324192308, 0.324192308, 0.324192308, 0.324192308, 
    0.324192308, 0.324192308, 0.544192308, 0.544192308, 0.544192308, 
    0.544192308, 0.544192308, 0.544192308, 0.759192308, 0.759192308, 
    0.759192308, 0.759192308, 0.759192308, 0.759192308, 1.324192308, 
    1.324192308, 1.324192308, 1.324192308, 1.324192308, 1.324192308, 
    1.549192308, 1.549192308, 1.549192308, 1.549192308, 1.549192308, 
    1.549192308, 1.709192308, 1.709192308, 1.709192308, 1.709192308, 
    1.709192308, 1.709192308, 1.639192308, 1.639192308, 1.639192308, 
    1.639192308, 1.639192308, 1.639192308, 1.579192308, 1.579192308, 
    1.579192308, 1.579192308, 1.579192308, 1.579192308, 2.724192308, 
    2.724192308, 2.724192308, 2.724192308, 2.724192308, 2.724192308, 
    2.839192308, 2.839192308, 2.839192308, 2.839192308, 2.839192308, 
    2.839192308, 1.064192308, 1.064192308, 1.064192308, 1.064192308, 
    1.064192308, 1.064192308, 1.184192308, 1.184192308, 1.184192308, 
    1.184192308, 1.184192308, 1.184192308, 1.254192308, 1.254192308, 
    1.254192308, 1.254192308, 1.254192308, 1.254192308, 1.379192308, 
    1.379192308, 1.379192308, 1.379192308, 1.379192308, 1.379192308, 
    1.529192308, 1.529192308, 1.529192308, 1.529192308, 1.529192308, 
    1.529192308, 1.599192308, 1.599192308, 1.599192308, 1.599192308, 
    1.599192308, 1.599192308, 1.669192308, 1.669192308, 1.669192308, 
    1.669192308, 1.669192308, 1.669192308, 1.664192308, 1.664192308, 
    1.664192308, 1.664192308, 1.664192308, 1.664192308, 1.714192308, 
    1.714192308, 1.714192308, 1.714192308, 1.714192308, 1.714192308, 
    0.984192308, 0.984192308, 0.984192308, 0.984192308, 0.984192308, 
    0.984192308, -1.545807692, -1.545807692, -1.545807692, -1.545807692, 
    -1.545807692, -1.545807692, -1.475807692, -1.475807692, -1.475807692, 
    -1.475807692, -1.475807692, -1.475807692, -1.460807692, -1.460807692, 
    -1.460807692, -1.460807692, -1.460807692, -1.460807692, -1.340807692, 
    -1.340807692, -1.340807692, -1.340807692, -1.340807692, -1.340807692, 
    -1.265807692, -1.265807692, -1.265807692, -1.265807692), 
    c.wind = c(1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, 1.27535159, 1.27535159, 1.27535159, 1.27535159, 
    1.27535159, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, -2.96855001, -2.96855001, -2.96855001, -2.96855001, 
    -2.96855001, 4.71144999, 4.71144999, 4.71144999, 4.71144999, 
    4.71144999, 4.71144999, 4.71144999, 4.71144999, 4.71144999, 
    4.71144999, 4.71144999, 4.71144999, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, -2.939182972, -2.939182972, 
    -2.939182972, -2.939182972, -2.939182972, 5.88092439, 5.88092439, 
    5.88092439, 5.88092439, 5.88092439, 5.88092439, 5.88092439, 
    5.88092439, 5.88092439, 5.88092439, 5.88092439, 5.88092439, 
    5.88092439, 5.88092439, 5.88092439, 5.88092439, 5.88092439, 
    5.88092439, 5.88092439, 5.88092439, 5.88092439, 5.88092439, 
    5.88092439, 5.88092439, 5.88092439, 5.88092439, 5.88092439, 
    5.88092439), c.distance = c(-160L, -160L, -160L, -160L, -160L, 
    -160L, -110L, -110L, -110L, -110L, -110L, -110L, -10L, -10L, 
    -10L, -10L, -10L, -10L, 90L, 90L, 90L, 90L, 90L, 90L, 190L, 
    190L, 190L, 190L, 190L, 190L, -160L, -160L, -160L, -160L, 
    -160L, -160L, -110L, -110L, -110L, -110L, -110L, -110L, -10L, 
    -10L, -10L, -10L, -10L, -10L, 90L, 90L, 90L, 90L, 90L, 90L, 
    190L, 190L, 190L, 190L, 190L, 190L, -160L, -160L, -160L, 
    -160L, -160L, -160L, -110L, -110L, -110L, -110L, -110L, -110L, 
    -10L, -10L, -10L, -10L, -10L, -10L, 90L, 90L, 90L, 90L, 90L, 
    90L, 190L, 190L, 190L, 190L, 190L, 190L, -160L, -160L, -160L, 
    -160L, -160L, -160L, -110L, -110L, -110L, -110L, -110L, -110L, 
    -10L, -10L, -10L, -10L, -10L, -10L, 90L, 90L, 90L, 90L, 90L, 
    90L, 190L, 190L, 190L, 190L, 190L, 190L, -160L, -160L, -160L, 
    -160L, -160L, -160L, -110L, -110L, -110L, -110L, -110L, -110L, 
    -110L, -110L, -110L, -110L, -110L, -110L, -10L, -10L, -10L, 
    -10L, -10L, -10L, 90L, 90L, 90L, 90L, 90L, 90L, 190L, 190L, 
    190L, 190L, 190L, 190L, -160L, -160L, -160L, -160L, -160L, 
    -160L, -110L, -110L, -110L, -110L, -110L, -110L, -10L, -10L, 
    -10L, -10L, -10L, -10L, 90L, 90L, 90L, 90L, 90L, 90L, 190L, 
    190L, 190L, 190L, 190L, 190L, -160L, -160L, -160L, -160L, 
    -160L, -160L, -10L, -10L, -10L, -10L, -10L, -10L, 90L, 90L, 
    90L, 90L, 90L, 90L, 190L, 190L, 190L, 190L, 190L, 190L, -160L, 
    -160L, -160L, -160L, -160L, -160L, -110L, -110L, -110L, -110L
    )), .Names = c("SUR.ID", "tm", "ValidDetections", "CountDetections", 
"FalseDetections", "replicate", "Area", "Day", "R.det", "c.receiver.depth", 
"c.tm.depth", "c.temp", "c.wind", "c.distance"), row.names = c(NA, 
-220L), class = "data.frame")

我的脚本:

library(lme4)
df$SUR.ID <- factor(df$SUR.ID)
df$replicate <- factor(df$replicate)
Rdet <- cbind(df$ValidDetections,df$FalseDetections)
Unit <- factor(1:length(df$ValidDetections))
m1 <- glmer(Rdet ~ tm:Area + tm:c.distance + c.distance:Area + c.tm.depth:Area + c.receiver.depth:Area + c.temp:Area + c.wind:Area + c.tm.depth + c.receiver.depth + c.temp +c.wind + tm + c.distance + Area + replicate + (1|SUR.ID) + (1|Day) + (1|Unit) , data = df, family = binomial(link=logit))

(单位=用于计算确定系数的色散参数)

(Unit = dispersion parameter used to calculate coefficients of determination)

与2013年初相比,最新版本的R和lme4返回以下3条警告消息:

In contrast to early 2013, the newest versions of R and lme4 return the following 3 warning messages:

1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 62.5817 (tol = 0.001)
2: In if (resHess$code != 0) { :
  the condition has length > 1 and only the first element will be used
3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?;Model is nearly unidentifiable: large eigenvalue ratio
 - Rescale variables?

我在google和堆栈溢出中搜索了上述警告消息的可能解决方案,但是我对它们并不了解,以及如何将其应用于我的特定模型/数据.

I searched google and stack overflow for potential solutions to the above warning messages, however I cannot make sense out of them, and how it may be applied to my specific model / data.

随后,我试图通过使用Chi ^ 2测试在R中使用drop1()函数来查找MAM,并一次删除不重要的变量1.忽略以上警告消息,我执行以下命令:

Subsequently, I'm trying to find the MAM by using the drop1() function in R using a Chi^2 test and remove non-significant variables 1 at a time. Ignoring the above warning messages, I execute the following command:

drop1(m1,test="Chi")

但是,如果没有解决/首先解决以上警告,则无法使用此命令(即返回附加警告消息).

However, this command cannot be used (i.e., returns addition warning messages) if the above warnings are not solved / dealt with first.

有人知道这里发生了什么吗?拜托,有人可以帮我解决这些警告吗?不能忽略.

Does anyone know what is happening here? Please, can someone help me how to solve these warnings? Ignoring is not an option.

非常感谢

最良好的祝愿, 莫里斯

Best Wishes, Maurits

推荐答案

tl; dr 至少基于您提供的数据子集,这是非常不稳定的拟合.如果缩放连续预测变量,则几乎无法识别的警告会消失.通过尝试各种优化器,我们得到了相同的对数似然率,参数估计值相差几个百分点.两个优化器(来自R的nlminb和来自nloptr的BOBYQA)收敛而没有警告,并且可能给出了正确"的答案.我还没有计算出置信区间,但是我怀疑它们的范围很广. (您的里程可能与您的完整数据集有所不同...)

tl;dr at least based on the subset of data you provided, this is a fairly unstable fit. The warnings about near unidentifiability go away if you scale the continuous predictors. Trying with a wide variety of optimizers, we get about the same log-likelihoods, and parameter estimates that vary by a few percent; two optimizers (nlminb from base R and BOBYQA from the nloptr package) converge without warnings, and are probably giving the "correct" answer. I haven't computed confidence intervals, but I suspect that they're very wide. (Your mileage may differ somewhat with your full data set ...)

source("SO_23478792_dat.R")  ## I put the data you provided in here

基本适合(从上面复制):

Basic fit (replicated from above):

library(lme4)
df$SUR.ID <- factor(df$SUR.ID)
df$replicate <- factor(df$replicate)
Rdet <- cbind(df$ValidDetections,df$FalseDetections)
Unit <- factor(1:length(df$ValidDetections))
m1 <- glmer(Rdet ~ tm:Area + tm:c.distance +
            c.distance:Area + c.tm.depth:Area +
            c.receiver.depth:Area + c.temp:Area +
            c.wind:Area +
            c.tm.depth + c.receiver.depth +
            c.temp +c.wind + tm + c.distance + Area +
            replicate +
            (1|SUR.ID) + (1|Day) + (1|Unit) ,
            data = df, family = binomial(link=logit))

我得到的警告与您大致相同,但由于开发版本已得到一些改进/调整,因此警告有所减少:

I get more or less the same warnings you did, slightly fewer since the development version has been a little improved/tweaked:

## 1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
##   Model failed to converge with max|grad| = 1.52673 (tol = 0.001, component 1)
## 2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
##   Model is nearly unidentifiable: very large eigenvalue
##  - Rescale variables?;Model is nearly unidentifiable: large eigenvalue ratio
## - Rescale variables?

我尝试了各种小事情(从先前的拟合值重新开始,切换了优化程序),但结果没有太大变化(即,相同的警告).

I tried various little things (restarting from the previous fitted values, switching optimizers) without much change in the results (i.e. the same warnings).

ss <- getME(m1,c("theta","fixef"))
m2 <- update(m1,start=ss,control=glmerControl(optCtrl=list(maxfun=2e4)))
m3 <- update(m1,start=ss,control=glmerControl(optimizer="bobyqa",
                         optCtrl=list(maxfun=2e4)))

遵循警告消息中的建议(调整连续预测变量的比例):

Following the advice in the warning message (rescaling the continuous predictors):

numcols <- grep("^c\\.",names(df))
dfs <- df
dfs[,numcols] <- scale(dfs[,numcols])
m4 <- update(m1,data=dfs)

这消除了缩放警告,但有关大坡度的警告仍然存在.

This gets rid of scaling warnings, but the warning about large gradients persists.

使用一些实用程序代码将相同的模型与许多不同的优化器配合使用:

Use some utility code to fit the same model with many different optimizers:

afurl <- "https://raw.githubusercontent.com/lme4/lme4/master/misc/issues/allFit.R"
## http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
library(RCurl)
eval(parse(text=getURL(afurl)))
aa <- allFit(m4)
is.OK <- sapply(aa,is,"merMod")  ## nlopt NELDERMEAD failed, others succeeded
## extract just the successful ones
aa.OK <- aa[is.OK]

发出警告:

lapply(aa.OK,function(x) x@optinfo$conv$lme4$messages)

(除了nlminb和nloptr BOBYQA以外的所有对象都发出收敛警告.)

(All but nlminb and nloptr BOBYQA give convergence warnings.)

对数可能性大致相同:

summary(sapply(aa.OK,logLik),digits=6)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -107.127 -107.114 -107.111 -107.114 -107.110 -107.110 

(同样,nlminb和nloptr BOBYQA具有最佳拟合/最高对数可能性)

(again, nlminb and nloptr BOBYQA have the best fits/highest log-likelihoods)

比较优化程序中的固定效果参数:

Compare fixed effect parameters across optimizers:

aa.fixef <- t(sapply(aa.OK,fixef))
library(ggplot2)
library(reshape2)
library(plyr)
aa.fixef.m <- melt(aa.fixef)
models <- levels(aa.fixef.m$Var1)
(gplot1 <- ggplot(aa.fixef.m,aes(x=value,y=Var1,colour=Var1))+geom_point()+
    facet_wrap(~Var2,scale="free")+
    scale_y_discrete(breaks=models,
                     labels=abbreviate(models,6)))
## coefficients of variation of fixed-effect parameter estimates:
summary(unlist(daply(aa.fixef.m,"Var2",summarise,sd(value)/abs(mean(value)))))
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## 0.003573 0.013300 0.022730 0.019710 0.026200 0.035810 

比较方差估计值(不那么有趣:除N-M之外的所有优化器都准确给出 Day和SUR.ID为零)

Compare variance estimates (not as interesting: all optimizers except N-M give exactly zero variance for Day and SUR.ID)

aa.varcorr <- t(sapply(aa.OK,function(x) unlist(VarCorr(x))))
aa.varcorr.m <- melt(aa.varcorr)
gplot1 %+% aa.varcorr.m

我尝试使用lme4.0(旧的lme4")运行此文件,但即使使用缩放的数据集,也遇到了各种"Downdated VtV"错误.也许完整的数据集可以解决这个问题?

I tried to run this with lme4.0 ("old lme4"), but got various "Downdated VtV" errors, even with the scaled data set. Perhaps that problem would go away with the full data set?

我还没有探索如果初始拟合返回警告时为什么drop1无法正常工作的原因...

I haven't yet explored why drop1 doesn't work properly if the initial fit returns warnings ...

这篇关于尝试在R中运行glmer时显示警告消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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