亲爱的Stack Overflow社区,
目前我试图在最新版本的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, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 1L,
1L, 2L, 2L, 3L, 3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 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?
我搜索了谷歌和堆栈溢出以寻找上述警告消息的潜在解决方案,但是我无法理解它们,以及它如何应用于我的特定模型/数据。
随后,我尝试使用Chi ^ 2测试在R中使用drop1()函数找到MAM,并一次删除1个非重要变量。忽略上述警告消息,执行以下命令:
drop1(m1,test="Chi")
但是,如果首先没有解决/处理上述警告,则不能使用此命令(即返回添加警告消息)。
有谁知道这里发生了什么?请问,有人可以帮我解决这些警告吗?忽略不是一种选择。
非常感谢,
祝福, Maurits
答案 0 :(得分:17)
tl; dr 至少基于您提供的数据子集,这是一个相当不稳定的契合度。如果您扩展连续预测因子,那么关于近乎不可识别性的警告就会消失。尝试使用各种各样的优化器,我们得到相同的对数似然,并且参数估计变化几个百分点;两个优化器(来自基础R的nlminb
和来自nloptr
包的BOBYQA)在没有警告的情况下收敛,并且可能正在给出&#34;正确的&#34;回答。我没有计算置信区间,但我怀疑它们非常宽。 (您的里程数可能与您的完整数据集有所不同......)
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
(同样,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
(&#34;旧lme4&#34;)来运行它,但得到了各种各样的&#34;倒退的VtV&#34;错误,即使使用缩放数据集也是如此。也许这个问题会随着完整的数据集而消失?
我还没有探究为什么drop1
如果初始拟合返回警告,{{1}}无法正常工作......