尝试在 r 中运行 glmer 时出现警告消息

2023-12-20

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

我的数据集的一个子集:

    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, 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, 3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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, 4L, 5L, 1L, 0L, 3L, 
    3L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 23L, 12L, 
    16L, 10L, 23L, 10L, 2L, 2L, 1L, 1L), FalseDetections = c(0L, 
    0L, 1L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 
    0L, 1L, 0L, 0L, 0L, 0L, 1L, 2L, 0L, 0L, 1L, 0L, 0L, 4L, 0L, 
    0L, 1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 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))

(单位=用于计算决定系数的分散参数)

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

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?

我搜索了谷歌和堆栈溢出以寻找上述警告消息的潜在解决方案,但是我无法理解它们,以及如何将其应用于我的特定模型/数据。

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

drop1(m1,test="Chi")

但是,如果未首先解决/处理上述警告,则无法使用此命令(即返回附加警告消息)。

有谁知道这里发生了什么?请问有人可以帮我解决这些警告吗?忽视不是一个选择。


tl;dr至少根据您提供的数据子集,这是一个相当不稳定的拟合。如果您缩放连续预测变量,有关几乎不可识别性的警告就会消失。尝试使用各种优化器,我们得到了大约相同的对数似然,并且参数估计值相差几个百分点;两个优化器(nlminb来自基础 R 和 BOBYQA 来自nloptr包)在没有警告的情况下收敛,并且可能给出“正确”的答案。我还没有计算置信区间,但我怀疑它们非常宽。 (您的里程可能与您的完整数据集有所不同......)

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

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

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))

我或多或少收到与您相同的警告,但由于开发版本进行了一些改进/调整,因此数量略有减少:

## 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?

我尝试了各种小事情(从之前的拟合值重新启动,切换优化器),结果没有太大变化(即相同的警告)。

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)))

按照警告消息中的建议(重新调整连续预测变量):

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

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

使用一些实用程序代码来使用许多不同的优化器来拟合同一模型:

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 给出收敛警告。)

对数似然都大致相同:

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 

(again, nlminb和 nloptr BOBYQA 具有最佳拟合/最高对数似然)

比较优化器之间的固定效应参数:

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 的零方差)

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

我尝试运行这个lme4.0(“old lme4”),但即使使用缩放的数据集,也会出现各种“Downdated VtV”错误。也许这个问题会随着完整的数据集而消失?

我还没有探究为什么drop1如果初始拟合返回警告,则无法正常工作...

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

尝试在 r 中运行 glmer 时出现警告消息 的相关文章

  • 连接路径的函数?

    是否有现有的函数来连接路径 我知道实施起来并不困难 但仍然 除了照顾尾随 or 我需要注意正确的操作系统路径格式检测 即我们是否编写C dir file or dir file 正如我所说 我相信我知道如何实施它 问题是 我应该这样做吗 现
  • 在 Shiny 应用程序中更改 bsModal 的背景

    我正在开发一个 Shiny 应用程序 我需要确保最终用户不会意外关闭 bsModal 因为它上面有一些操作按钮 我做了一些研究并了解到我需要覆盖背景和键盘参数 但即使我看到了一些建议 我也不知道这到底需要放在我的代码中的哪里 我不精通 Ja
  • 正则表达式在 R 中同时多次包含字母/特殊字符时删除单词

    我想删除那些单词中字母 特殊字符的数量同时出现两次以上的单词 例如 输入就像 Google in theee lland of whhhat c c and e 输出应该是 Google in lland of c c and x lt G
  • 将一长行带空格的数据导入R中

    这个问题是我上一个问题的后续问题 将一长行数据导入到 R 中 https stackoverflow com questions 8389913 我有一个由单行文本组成的大型数据文件 格式类似于 Cat 14 15 Horse 16 我最终
  • 闪亮的仪表板侧边栏中的可折叠菜单项

    我的侧边栏中有两个菜单项 目前 如果我单击任何菜单项 则会显示所有菜单项的选项卡项 我想让它可折叠 如果我单击多个名称菜单 单个分析应该折叠 如果我单击单个分析 多个分析应该折叠 目前的设计是 相同的可重现代码是 library shiny
  • Dplyr 过滤多个类似条件

    我正在尝试在 dplyr 中做一个过滤器 其中的列就像某些观察结果 我可以使用 sqldf 作为 Test lt sqldf select from database Where SOURCE LIKE ALPHA OR SOURCE LI
  • 如何使用 Rcpp 将 C 结构从 C 库公开到 R

    我正在尝试将 C 结构从 C 库公开到 R 中 例如 struct A int flag 库提供 API 来构造和销毁是很常见的A A initA void freeA A a 感谢RCPP MODULE 很容易暴露它而不考虑析构函数 in
  • 包什么时候需要为它自己的对象使用 :::

    考虑这个 R 包有两个函数 一个是导出函数 另一个是内部函数 hello R export hello lt function internalFunctions hello internal 你好 内部 R hello internal
  • 缩放geom_密度以将geom_bar与y上的百分比相匹配

    因为我对数学感到困惑上次我尝试问这个问题 https stackoverflow com questions 32412805 ggplot2 histogram with density curve that sums to 1 这是另一
  • 二部图匹配以匹配两个集合

    我是新手igraphR 中的包 我有两套A and B 每个都有N顶点 A1 A2 AN and B1 B2 BN 每个元素之间都有一个边缘A对每一个元素B 我有一个函数fWgt Ai Bj 返回之间的边的权重Ai and Bj 我一直在尝
  • 将 r 中的一列从出生日期更改为年龄

    我是第一次使用 data table 我的表中有大约 400 000 个年龄的列 我需要将它们从出生日期转换为年龄 做这个的最好方式是什么 我一直在思考这个问题 到目前为止对这两个答案都不满意 我喜欢用lubridate 就像 KFB 所做
  • 从 r 中的多个列表创建二进制(存在/不存在)数据矩阵

    我有一系列不同长度的单独变量列表 字符串 我想将它们组合成一个数据帧以形成存在 1 不存在 0 矩阵 鉴于它们的长度不同 我什至不知道如何创建初始数据框 这是我的例子 data1 lt c a b c d e f data2 lt c e
  • mtext:使用布局时较小的标签描述

    使用 mtext 作为标签描述与使用 xlab 的作用不同 如何使 mtext 标签始终与使用 xlab 时的大小相同 无需始终定义 cex 参数 在下面的最小示例中 两个图的 cex cex lab 1 不过大小不同 layout mat
  • 按值对 geom_bar ggplot2 中的条形重新排序

    我正在尝试制作一个条形图 其中的图是从miRNA与最高的value to the miRNA与最低的 为什么我的代码不起作用 gt head corr m miRNA variable value 1 mmu miR 532 3p pos
  • 从数据帧创建 sf 多边形

    我有一个包含一组多边形坐标的数据框 这就是我将其转换为spatialPolygons 包sp 的方法 my df lt data frame Plot c A A A A A B B B B B Corner c SW NW NE SE S
  • 使用带有字边界的 mgsub 函数作为替换值

    我试图用空格替换向量中字符串元素的子字符串 以下是我们正在考虑的向量 test lt c PALMA DE MALLORCA THE RICH AND THE POOR A CAMEL IN THE DESERT SANTANDER SL
  • 可以使用部分名称访问列表成员吗?这是一个功能吗?

    考虑这个 R 代码 gt l list key 1 gt l k 1 1 gt l ke 1 1 gt l k NULL gt names l 1 key 这是否意味着您可以使用以下方式访问列表成员 及其部分名称 当我在一次令人沮丧的错误搜
  • R 语言 NaN + NA 行为

    我有一个关于 R 中算术行为的问题 看下面这段代码 gt NaN NA 1 NaN gt gt gt NaN as integer NA gt NA 所以 我很困惑这两个添加给出了不同的结果 有谁知道这是否是真正想要的行为还是只是某种错误
  • r - ggplot2 - 突出显示选定的点和奇怪的行为

    我想突出显示选定的点并遇到一些奇怪的行为 首先是一些虚拟数据 a lt 1 50 b lt rnorm 50 mydata lt data frame a a b b ggplot mydata aes x a y b geom point
  • 将数据帧单列中的值向上移动

    使用这样的示例数据 example data frame x c 1 2 3 4 5 6 7 8 y c 1 2 3 4 5 6 7 8 z c 1 2 3 4 5 6 7 8 看起来像这样 x y z 1 1 1 1 2 2 2 2 3

随机推荐

  • /lib64/libc.so.6:找不到版本“GLIBC_2.32”

    我正在使用基本示例在 Ubuntu 上构建 lambda 它构建时没有任何错误 但如果我在 aws 上上传并测试它 则会崩溃 errorMessage RequestId 7f4d0aca 125c 4032 98dd 9ff387e525
  • 如何在tomcat服务器上部署reactJS应用程序?

    我正在尝试构建一个 ReactJS 应用程序 我想将其托管在 tomcat 服务器上 我已经使用了命令 npm run build 并且构建已准备就绪 我应该在 Tomcat 服务器中的哪里复制这些文件 我是否需要创建另一个应用程序并将其部
  • Hibernate Inverse 属性

    我正在创建一对多关系 所以 我有父母和孩子 级联属性设置为全部 我想知道 我们是否考虑以下代码 Parent p Parent session load Parent class pid Child c new Child child el
  • Material-ui:如何停止嵌套组件中单击事件的传播

    我有一个IconMenu里面的组件Paper成分 我想阻止内部组件 IconMenu 这就是我想出来的 没有显着的结果 我也尝试用 onClick 代替onTouchTap onMouseUp具有相同的效果 iconMenuClick方法从
  • Java:递增/递减运算符的前缀/后缀

    从下面的程序或here http download oracle com javase tutorial java nutsandbolts examples PrePostDemo java 为什么最后一个调用System out pri
  • 如何移动 JPanel

    我有一个JDialog其中包含JPanel和其他元素 例如JTextField 我想搬家JDialog加载到屏幕上后从一个位置到另一个位置 当我尝试使用时jdialog setLocation 我无法动弹JDialog并且添加到其中的所有其
  • 多个使用者和查询 C# BlockingCollection

    我使用 NET 4 0 BlockingCollection 来处理一个项目队列 每个项目都需要通过一个操作来处 理 该操作最多需要一秒钟来处理每个项目 该项目队列可以由不同的线程添加到该队列中 我对此有几个问题 a 允许多个消费者处理此
  • 如何确定某个日期是否位于当前星期的日期之间?

    In C 我们如何检查特定日期与周内日期 例如 2014 年 6 月 2 日 当前几周 2014年2月2日 2014年2月8日 所以这个日期是在上周 使用它进行检查 如果您希望从 fromDate 开始始终是 1 周 则最后一个参数是可选的
  • 消除 BigQuery 表中的重复记录

    我计划每天将增量数据附加到 BigQuery 表中 每次我向现有表添加增量数据时 我都想从表中的现有数据中消除重复记录 基于主键列 一种方法是 从增量数据中收集密钥集 我们称其为INCR KEYS 对以下行运行查询 SELECT all c
  • 将 mkv 转换为 h264 FFmpeg

    EDIT 这个问题已经变得非常流行 并且是搜索 convert mkv to h264 ffmpeg 的最佳结果之一 因此我认为对于任何偶然发现这个问题的人来说 添加这一点是适当的 而不是使用 ffmpeg i input mkv c v
  • C# Outlook 2007 - 如何直接从我的插件访问附件内容?

    我正在尝试解析基于文本的文件附件 txt doc 等 但是 我似乎无法获取二进制信息本身 我可以获取文件名 也可以将文件保存到某个临时文件夹并从那里打开它 但这看起来很混乱 有没有什么方法可以访问附件的内容而不保存它 阅读它 然后删除它 或
  • 使用 Visual Studio 管理源代码管理中的引用

    我在 Visual Studio 项目中管理 dll 引用时遇到问题 所有注册的 NET 和 COM 引用都工作正常 但当涉及磁盘上的 dll 文件时 如果我引用磁盘上的文件 我的同事将丢失引用 因为他们可能将其放在磁盘上的不同位置等 Vi
  • 如何使用layoutIfNeeded?

    何时以及如何layoutIfNeeded用过的 我知道当我们改变视图的布局时 我们可以调用setNeedsLayout更新布局但不确定何时layoutIfNeeded应该使用 注意 我有layoutIfNeeded在实际代码中使用但忘记了它
  • 无法在iOS中将统一的CNContact添加到CNGroup中

    这就是我正在做的 void doCreateGroup self contentView endEditing true NSString newString self contentView groupNameField text str
  • 检索 SQLite 中所有项目的最快方法是什么?

    我在 Windows 上编程 我将信息存储在 sqlite 中 然而我发现获取所有物品有点慢 我正在使用以下方式 select from XXX 检索 1 7MB SQLite DB 中的所有项目大约需要 200 400 毫秒 太慢了 有人
  • 在 NodeJS 中可靠地读取 FIFO

    我正在编写一个与第三方应用程序交互的 NodeJS 脚本 第三方应用程序将在文件打开期间将数据写入文件 我希望我的 NodeJS 应用程序能够实时接收这些数据 我的脚本创建一个 fifo child process spawnSync mk
  • 在 C++ 中从 WMI(Win32_LogicalDisk 类)调用 Chkdsk ->“参数无效”

    我正在尝试从 C 中的 WMI 运行 Chkdsk 我正在使用 Qt Framework ExecMethod 返回 参数无效 我已经根据设置参数http msdn microsoft com en us library cc250766
  • 如何获取隐藏父元素的大小?

    1 4 4 返回隐藏元素的大小 但是另一个隐藏元素中的元素呢 除了 getWidth 还有更好的解决方案吗
  • SqlAlchemy:如何实现 DROP TABLE ... CASCADE?

    我需要删除 PostgreSQL 数据库中具有外键约束并且需要的表DROP TABLE CASCADE 我可以执行原始 SQL engine execute DROP TABLE s CASCADE table name 但是 我想实现这种
  • 尝试在 r 中运行 glmer 时出现警告消息

    目前 我正在尝试在最新版本的 R 和 lme4 上重新运行旧的数据分析 二项式 glmer 模型 从 2013 年初开始 因为我不再有旧版本的 R 和 lme4 但是 我遇到了与 dmartin 和 carine 之前的线程 第一条警告消息