- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在努力将缩放和居中的模型系数从 glmer 模型转换回未居中和未缩放的值。
我在 lme4 (v1.1.7) 包中使用 GLMM 分析了一个数据集。它涉及计算声学接收器的最大探测范围和环境变量的影响。
样本数据:
dd <- structure(list(SUR.ID = c(10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L, 10186L,
10186L, 10186L, 10186L, 10249L, 10249L, 10249L, 10249L, 10249L,
10249L, 10249L, 10249L, 10249L, 10249L, 10249L, 10249L, 10249L,
10249L, 10249L, 10249L, 10249L, 10249L, 10249L, 10249L, 10249L,
10249L, 10249L, 10249L, 10249L, 10249L, 10249L, 10249L, 10249L,
10249L, 10249L, 10249L, 10249L, 10249L, 10249L, 10249L, 10249L,
10249L, 10249L, 10249L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L, 10250L,
10250L, 10250L, 10250L), Valid.detections = c(1L, 4L, 0L, 1L,
6L, 7L, 0L, 1L, 0L, 0L, 6L, 5L, 3L, 5L, 0L, 0L, 1L, 0L, 0L, 0L,
2L, 3L, 0L, 1L, 5L, 1L, 0L, 0L, 1L, 1L, 0L, 0L, 5L, 3L, 1L, 1L,
0L, 0L, 5L, 8L, 0L, 1L, 0L, 0L, 3L, 7L, 1L, 2L, 7L, 0L, 7L, 6L,
0L, 3L, 0L, 1L, 0L, 1L, 2L, 5L, 0L, 3L, 0L, 2L, 1L, 5L, 3L, 0L,
0L, 2L, 0L, 0L, 0L, 0L, 0L, 3L, 4L, 0L, 2L, 2L, 0L, 3L, 0L, 0L,
9L, 8L, 0L, 2L, 9L, 0L, 7L, 4L, 0L, 5L, 0L, 2L, 0L, 1L, 2L, 4L,
3L, 2L, 1L, 1L, 3L, 4L, 1L, 2L, 1L, 3L, 0L, 0L, 0L, 6L, 0L, 5L,
6L, 1L, 3L, 1L, 1L, 0L, 2L, 1L, 6L, 5L, 2L, 1L, 2L, 0L, 1L, 7L,
5L, 4L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 1L, 0L, 4L, 2L, 6L, 0L, 0L,
0L, 1L, 0L, 0L, 3L, 9L, 0L, 7L, 0L, 2L, 7L, 3L, 0L, 5L, 0L, 1L,
1L, 9L, 2L, 9L, 1L, 0L, 6L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 3L, 13L,
0L, 4L, 1L, 1L, 1L, 2L, 1L, 6L, 0L, 2L, 0L, 0L, 0L, 1L, 1L, 11L,
5L, 0L, 6L, 5L), distance = c(200L, 200L, 200L, 200L, 100L, 100L,
300L, 300L, 400L, 400L, 50L, 50L, 50L, 50L, 300L, 300L, 200L,
200L, 400L, 400L, 200L, 200L, 100L, 100L, 100L, 100L, 300L, 300L,
300L, 300L, 400L, 400L, 50L, 50L, 50L, 50L, 400L, 400L, 100L,
100L, 200L, 200L, 200L, 200L, 100L, 100L, 100L, 100L, 50L, 300L,
50L, 300L, 300L, 300L, 400L, 400L, 400L, 400L, 50L, 50L, 200L,
200L, 200L, 100L, 200L, 100L, 100L, 100L, 300L, 300L, 400L, 400L,
400L, 50L, 400L, 50L, 50L, 300L, 50L, 300L, 200L, 200L, 200L,
200L, 100L, 100L, 100L, 100L, 50L, 300L, 50L, 300L, 300L, 300L,
400L, 400L, 400L, 400L, 50L, 50L, 200L, 200L, 200L, 100L, 200L,
100L, 100L, 100L, 300L, 300L, 400L, 400L, 400L, 50L, 400L, 50L,
50L, 300L, 50L, 300L, 200L, 200L, 200L, 200L, 100L, 100L, 300L,
300L, 400L, 400L, 50L, 50L, 50L, 50L, 300L, 300L, 200L, 200L,
400L, 400L, 200L, 200L, 100L, 100L, 100L, 100L, 300L, 300L, 300L,
300L, 400L, 400L, 50L, 50L, 50L, 50L, 400L, 400L, 100L, 100L,
200L, 200L, 200L, 200L, 100L, 100L, 100L, 100L, 50L, 300L, 50L,
300L, 300L, 300L, 400L, 400L, 400L, 400L, 50L, 50L, 200L, 200L,
200L, 100L, 200L, 100L, 100L, 100L, 300L, 300L, 400L, 400L, 400L,
50L, 400L, 50L, 50L, 300L, 50L, 300L), wind.speed = c(8.9939016,
8.9939016, 8.9939016, 8.9939016, 8.9939016, 8.9939016, 8.9939016,
8.9939016, 8.9939016, 8.9939016, 8.9939016, 8.9939016, 8.9939016,
8.9939016, 8.9939016, 8.9939016, 10.8187512, 10.8187512, 8.9939016,
8.9939016, 10.8187512, 10.8187512, 10.8187512, 10.8187512, 10.8187512,
10.8187512, 10.8187512, 10.8187512, 10.8187512, 10.8187512, 10.8187512,
10.8187512, 10.8187512, 10.8187512, 10.8187512, 10.8187512, 10.8187512,
10.8187512, 8.9939016, 8.9939016, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 8.9939016, 8.9939016, 8.9939016, 8.9939016,
8.9939016, 8.9939016, 8.9939016, 8.9939016, 8.9939016, 8.9939016,
8.9939016, 8.9939016, 8.9939016, 8.9939016, 8.9939016, 8.9939016,
10.8187512, 10.8187512, 8.9939016, 8.9939016, 10.8187512, 10.8187512,
10.8187512, 10.8187512, 10.8187512, 10.8187512, 10.8187512, 10.8187512,
10.8187512, 10.8187512, 10.8187512, 10.8187512, 10.8187512, 10.8187512,
10.8187512, 10.8187512, 10.8187512, 10.8187512, 8.9939016, 8.9939016,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
2.389683519, 2.389683519, 2.389683519, 2.389683519, 2.389683519,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038,
4.779367038, 4.779367038, 4.779367038, 4.779367038, 4.779367038
), receiver.depth = c(0.65, 0.65, 0.69, 0.69, 0.685, 0.685, 0.645,
0.645, 0.645, 0.645, 0.67, 0.67, 0.665, 0.665, 0.705, 0.705,
1.12, 1.12, 0.73, 0.73, 1.155, 1.155, 1.13, 1.13, 1.155, 1.155,
1.105, 1.105, 1.155, 1.155, 1.095, 1.095, 1.145, 1.145, 1.14,
1.14, 1.15, 1.15, 0.65, 0.65, 0.41, 0.41, 0.455, 0.455, 0.405,
0.405, 0.49, 0.49, 0.415, 0.42, 0.415, 0.42, 0.45, 0.45, 0.43,
0.43, 0.45, 0.45, 0.51, 0.51, 1.01, 1.01, 1.095, 1.045, 1.095,
1.045, 1.09, 1.09, 1, 1, 0.975, 0.975, 1.08, 1.055, 1.08, 1.055,
1.085, 1.095, 1.085, 1.095, 0.41, 0.41, 0.455, 0.455, 0.405,
0.405, 0.49, 0.49, 0.415, 0.42, 0.415, 0.42, 0.45, 0.45, 0.43,
0.43, 0.45, 0.45, 0.51, 0.51, 1.01, 1.01, 1.095, 1.045, 1.095,
1.045, 1.09, 1.09, 1, 1, 0.975, 0.975, 1.08, 1.055, 1.08, 1.055,
1.085, 1.095, 1.085, 1.095, 0.65, 0.65, 0.69, 0.69, 0.685, 0.685,
0.645, 0.645, 0.645, 0.645, 0.67, 0.67, 0.665, 0.665, 0.705,
0.705, 1.12, 1.12, 0.73, 0.73, 1.155, 1.155, 1.13, 1.13, 1.155,
1.155, 1.105, 1.105, 1.155, 1.155, 1.095, 1.095, 1.145, 1.145,
1.14, 1.14, 1.15, 1.15, 0.65, 0.65, 0.41, 0.41, 0.455, 0.455,
0.405, 0.405, 0.49, 0.49, 0.415, 0.42, 0.415, 0.42, 0.45, 0.45,
0.43, 0.43, 0.45, 0.45, 0.51, 0.51, 1.01, 1.01, 1.095, 1.045,
1.095, 1.045, 1.09, 1.09, 1, 1, 0.975, 0.975, 1.08, 1.055, 1.08,
1.055, 1.085, 1.095, 1.085, 1.095), water.temperature = c(20.33,
20.33, 20.9, 20.9, 20.72, 20.72, 20.365, 20.365, 20.505, 20.505,
20.445, 20.445, 20.62, 20.62, 20.88, 20.88, 22.775, 22.775, 20.92,
20.92, 22.86, 22.86, 22.755, 22.755, 22.835, 22.835, 22.765,
22.765, 22.86, 22.86, 22.78, 22.78, 22.835, 22.835, 22.78, 22.78,
22.835, 22.835, 20.32, 20.32, 27.925, 27.925, 27.62, 27.62, 27.82,
27.82, 27.58, 27.58, 27.67, 27.98, 27.67, 27.98, 27.63, 27.63,
27.64, 27.64, 27.96, 27.96, 27.52, 27.52, 26.21, 26.21, 25.725,
26.14, 25.725, 26.14, 25.605, 25.605, 26.205, 26.205, 26.255,
26.255, 25.92, 26.07, 25.92, 26.07, 25.525, 25.795, 25.525, 25.795,
27.925, 27.925, 27.62, 27.62, 27.82, 27.82, 27.58, 27.58, 27.67,
27.98, 27.67, 27.98, 27.63, 27.63, 27.64, 27.64, 27.96, 27.96,
27.52, 27.52, 26.21, 26.21, 25.725, 26.14, 25.725, 26.14, 25.605,
25.605, 26.205, 26.205, 26.255, 26.255, 25.92, 26.07, 25.92,
26.07, 25.525, 25.795, 25.525, 25.795, 20.33, 20.33, 20.9, 20.9,
20.72, 20.72, 20.365, 20.365, 20.505, 20.505, 20.445, 20.445,
20.62, 20.62, 20.88, 20.88, 22.775, 22.775, 20.92, 20.92, 22.86,
22.86, 22.755, 22.755, 22.835, 22.835, 22.765, 22.765, 22.86,
22.86, 22.78, 22.78, 22.835, 22.835, 22.78, 22.78, 22.835, 22.835,
20.32, 20.32, 27.925, 27.925, 27.62, 27.62, 27.82, 27.82, 27.58,
27.58, 27.67, 27.98, 27.67, 27.98, 27.63, 27.63, 27.64, 27.64,
27.96, 27.96, 27.52, 27.52, 26.21, 26.21, 25.725, 26.14, 25.725,
26.14, 25.605, 25.605, 26.205, 26.205, 26.255, 26.255, 25.92,
26.07, 25.92, 26.07, 25.525, 25.795, 25.525, 25.795), Habitat = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Drug Channel", class = "factor"),
Distance = c(-0.078078746, -0.078078746, -0.078078746, -0.078078746,
-0.858866211, -0.858866211, 0.702708718, 0.702708718, 1.483496183,
1.483496183, -1.249259944, -1.249259944, -1.249259944, -1.249259944,
0.702708718, 0.702708718, -0.078078746, -0.078078746, 1.483496183,
1.483496183, -0.078078746, -0.078078746, -0.858866211, -0.858866211,
-0.858866211, -0.858866211, 0.702708718, 0.702708718, 0.702708718,
0.702708718, 1.483496183, 1.483496183, -1.249259944, -1.249259944,
-1.249259944, -1.249259944, 1.483496183, 1.483496183, -0.858866211,
-0.858866211, -0.078078746, -0.078078746, -0.078078746, -0.078078746,
-0.858866211, -0.858866211, -0.858866211, -0.858866211, -1.249259944,
0.702708718, -1.249259944, 0.702708718, 0.702708718, 0.702708718,
1.483496183, 1.483496183, 1.483496183, 1.483496183, -1.249259944,
-1.249259944, -0.078078746, -0.078078746, -0.078078746, -0.858866211,
-0.078078746, -0.858866211, -0.858866211, -0.858866211, 0.702708718,
0.702708718, 1.483496183, 1.483496183, 1.483496183, -1.249259944,
1.483496183, -1.249259944, -1.249259944, 0.702708718, -1.249259944,
0.702708718, -0.078078746, -0.078078746, -0.078078746, -0.078078746,
-0.858866211, -0.858866211, -0.858866211, -0.858866211, -1.249259944,
0.702708718, -1.249259944, 0.702708718, 0.702708718, 0.702708718,
1.483496183, 1.483496183, 1.483496183, 1.483496183, -1.249259944,
-1.249259944, -0.078078746, -0.078078746, -0.078078746, -0.858866211,
-0.078078746, -0.858866211, -0.858866211, -0.858866211, 0.702708718,
0.702708718, 1.483496183, 1.483496183, 1.483496183, -1.249259944,
1.483496183, -1.249259944, -1.249259944, 0.702708718, -1.249259944,
0.702708718, -0.078078746, -0.078078746, -0.078078746, -0.078078746,
-0.858866211, -0.858866211, 0.702708718, 0.702708718, 1.483496183,
1.483496183, -1.249259944, -1.249259944, -1.249259944, -1.249259944,
0.702708718, 0.702708718, -0.078078746, -0.078078746, 1.483496183,
1.483496183, -0.078078746, -0.078078746, -0.858866211, -0.858866211,
-0.858866211, -0.858866211, 0.702708718, 0.702708718, 0.702708718,
0.702708718, 1.483496183, 1.483496183, -1.249259944, -1.249259944,
-1.249259944, -1.249259944, 1.483496183, 1.483496183, -0.858866211,
-0.858866211, -0.078078746, -0.078078746, -0.078078746, -0.078078746,
-0.858866211, -0.858866211, -0.858866211, -0.858866211, -1.249259944,
0.702708718, -1.249259944, 0.702708718, 0.702708718, 0.702708718,
1.483496183, 1.483496183, 1.483496183, 1.483496183, -1.249259944,
-1.249259944, -0.078078746, -0.078078746, -0.078078746, -0.858866211,
-0.078078746, -0.858866211, -0.858866211, -0.858866211, 0.702708718,
0.702708718, 1.483496183, 1.483496183, 1.483496183, -1.249259944,
1.483496183, -1.249259944, -1.249259944, 0.702708718, -1.249259944,
0.702708718), Receiver.depth = c(-0.744681049, -0.744681049,
-0.612233214, -0.612233214, -0.628789194, -0.628789194, -0.761237028,
-0.761237028, -0.761237028, -0.761237028, -0.678457132, -0.678457132,
-0.695013111, -0.695013111, -0.562565277, -0.562565277, 0.811581001,
0.811581001, -0.47978538, -0.47978538, 0.927472856, 0.927472856,
0.84469296, 0.84469296, 0.927472856, 0.927472856, 0.761913064,
0.761913064, 0.927472856, 0.927472856, 0.728801105, 0.728801105,
0.894360898, 0.894360898, 0.877804918, 0.877804918, 0.910916877,
0.910916877, -0.744681049, -0.744681049, -1.539368053, -1.539368053,
-1.390364239, -1.390364239, -1.555924032, -1.555924032, -1.274472385,
-1.274472385, -1.522812073, -1.506256094, -1.522812073, -1.506256094,
-1.406920219, -1.406920219, -1.473144136, -1.473144136, -1.406920219,
-1.406920219, -1.208248468, -1.208248468, 0.447349458, 0.447349458,
0.728801105, 0.563241313, 0.728801105, 0.563241313, 0.712245126,
0.712245126, 0.414237499, 0.414237499, 0.331457603, 0.331457603,
0.679133167, 0.596353271, 0.679133167, 0.596353271, 0.695689147,
0.728801105, 0.695689147, 0.728801105, -1.539368053, -1.539368053,
-1.390364239, -1.390364239, -1.555924032, -1.555924032, -1.274472385,
-1.274472385, -1.522812073, -1.506256094, -1.522812073, -1.506256094,
-1.406920219, -1.406920219, -1.473144136, -1.473144136, -1.406920219,
-1.406920219, -1.208248468, -1.208248468, 0.447349458, 0.447349458,
0.728801105, 0.563241313, 0.728801105, 0.563241313, 0.712245126,
0.712245126, 0.414237499, 0.414237499, 0.331457603, 0.331457603,
0.679133167, 0.596353271, 0.679133167, 0.596353271, 0.695689147,
0.728801105, 0.695689147, 0.728801105, -0.744681049, -0.744681049,
-0.612233214, -0.612233214, -0.628789194, -0.628789194, -0.761237028,
-0.761237028, -0.761237028, -0.761237028, -0.678457132, -0.678457132,
-0.695013111, -0.695013111, -0.562565277, -0.562565277, 0.811581001,
0.811581001, -0.47978538, -0.47978538, 0.927472856, 0.927472856,
0.84469296, 0.84469296, 0.927472856, 0.927472856, 0.761913064,
0.761913064, 0.927472856, 0.927472856, 0.728801105, 0.728801105,
0.894360898, 0.894360898, 0.877804918, 0.877804918, 0.910916877,
0.910916877, -0.744681049, -0.744681049, -1.539368053, -1.539368053,
-1.390364239, -1.390364239, -1.555924032, -1.555924032, -1.274472385,
-1.274472385, -1.522812073, -1.506256094, -1.522812073, -1.506256094,
-1.406920219, -1.406920219, -1.473144136, -1.473144136, -1.406920219,
-1.406920219, -1.208248468, -1.208248468, 0.447349458, 0.447349458,
0.728801105, 0.563241313, 0.728801105, 0.563241313, 0.712245126,
0.712245126, 0.414237499, 0.414237499, 0.331457603, 0.331457603,
0.679133167, 0.596353271, 0.679133167, 0.596353271, 0.695689147,
0.728801105, 0.695689147, 0.728801105), Transmitter.depth = c(-1.126364339,
-1.126364339, -0.821720789, -0.821720789, -0.702512443, -0.702512443,
-0.066734598, -0.066734598, 0.06571912, 0.06571912, 0.118700607,
0.118700607, 0.118700607, 0.118700607, 0.171682094, 0.171682094,
0.317381183, 0.317381183, 0.343871927, 0.343871927, 0.343871927,
0.343871927, 0.754478451, 0.754478451, 0.780969195, 0.780969195,
1.337274809, 1.337274809, 1.416747039, 1.416747039, 1.469728526,
1.469728526, 1.509464642, 1.509464642, 1.509464642, 1.509464642,
1.602182244, 1.602182244, -0.742248558, -0.742248558, -0.848211532,
-0.848211532, -0.689267071, -0.689267071, -0.583304097, -0.583304097,
-0.119716085, -0.119716085, 0.211418209, 0.211418209, 0.211418209,
0.211418209, 0.264399696, 0.264399696, 0.343871927, 0.343871927,
0.37036267, 0.37036267, 0.608779362, 0.608779362, 0.780969195,
0.780969195, 1.072367374, 1.072367374, 1.072367374, 1.072367374,
1.469728526, 1.469728526, 1.774372077, 1.774372077, 1.800862821,
1.800862821, 1.999543397, 1.999543397, 1.999543397, 1.999543397,
2.065770256, 2.065770256, 2.065770256, 2.065770256, -0.848211532,
-0.848211532, -0.689267071, -0.689267071, -0.583304097, -0.583304097,
-0.119716085, -0.119716085, 0.211418209, 0.211418209, 0.211418209,
0.211418209, 0.264399696, 0.264399696, 0.343871927, 0.343871927,
0.37036267, 0.37036267, 0.608779362, 0.608779362, 0.780969195,
0.780969195, 1.072367374, 1.072367374, 1.072367374, 1.072367374,
1.469728526, 1.469728526, 1.774372077, 1.774372077, 1.800862821,
1.800862821, 1.999543397, 1.999543397, 1.999543397, 1.999543397,
2.065770256, 2.065770256, 2.065770256, 2.065770256, -1.126364339,
-1.126364339, -0.821720789, -0.821720789, -0.702512443, -0.702512443,
-0.066734598, -0.066734598, 0.06571912, 0.06571912, 0.118700607,
0.118700607, 0.118700607, 0.118700607, 0.171682094, 0.171682094,
0.317381183, 0.317381183, 0.343871927, 0.343871927, 0.343871927,
0.343871927, 0.754478451, 0.754478451, 0.780969195, 0.780969195,
1.337274809, 1.337274809, 1.416747039, 1.416747039, 1.469728526,
1.469728526, 1.509464642, 1.509464642, 1.509464642, 1.509464642,
1.602182244, 1.602182244, -0.742248558, -0.742248558, -0.848211532,
-0.848211532, -0.689267071, -0.689267071, -0.583304097, -0.583304097,
-0.119716085, -0.119716085, 0.211418209, 0.211418209, 0.211418209,
0.211418209, 0.264399696, 0.264399696, 0.343871927, 0.343871927,
0.37036267, 0.37036267, 0.608779362, 0.608779362, 0.780969195,
0.780969195, 1.072367374, 1.072367374, 1.072367374, 1.072367374,
1.469728526, 1.469728526, 1.774372077, 1.774372077, 1.800862821,
1.800862821, 1.999543397, 1.999543397, 1.999543397, 1.999543397,
2.065770256, 2.065770256, 2.065770256, 2.065770256), Water.temperature = c(-1.820795427,
-1.820795427, -1.57382909, -1.57382909, -1.65181846, -1.65181846,
-1.805630828, -1.805630828, -1.744972429, -1.744972429, -1.770968885,
-1.770968885, -1.695145887, -1.695145887, -1.582494576, -1.582494576,
-0.761439823, -0.761439823, -1.565163604, -1.565163604, -0.724611509,
-0.724611509, -0.770105308, -0.770105308, -0.735443366, -0.735443366,
-0.765772566, -0.765772566, -0.724611509, -0.724611509, -0.759273452,
-0.759273452, -0.735443366, -0.735443366, -0.759273452, -0.759273452,
-0.735443366, -0.735443366, -1.82512817, -1.82512817, 1.469922697,
1.469922697, 1.337774043, 1.337774043, 1.424428898, 1.424428898,
1.320443072, 1.320443072, 1.359437757, 1.493752783, 1.359437757,
1.493752783, 1.342106786, 1.342106786, 1.346439529, 1.346439529,
1.485087297, 1.485087297, 1.294446616, 1.294446616, 0.726857314,
0.726857314, 0.516719291, 0.696528115, 0.516719291, 0.696528115,
0.464726378, 0.464726378, 0.724690943, 0.724690943, 0.746354657,
0.746354657, 0.601207774, 0.666198916, 0.601207774, 0.666198916,
0.430064436, 0.54704849, 0.430064436, 0.54704849, 1.469922697,
1.469922697, 1.337774043, 1.337774043, 1.424428898, 1.424428898,
1.320443072, 1.320443072, 1.359437757, 1.493752783, 1.359437757,
1.493752783, 1.342106786, 1.342106786, 1.346439529, 1.346439529,
1.485087297, 1.485087297, 1.294446616, 1.294446616, 0.726857314,
0.726857314, 0.516719291, 0.696528115, 0.516719291, 0.696528115,
0.464726378, 0.464726378, 0.724690943, 0.724690943, 0.746354657,
0.746354657, 0.601207774, 0.666198916, 0.601207774, 0.666198916,
0.430064436, 0.54704849, 0.430064436, 0.54704849, -1.820795427,
-1.820795427, -1.57382909, -1.57382909, -1.65181846, -1.65181846,
-1.805630828, -1.805630828, -1.744972429, -1.744972429, -1.770968885,
-1.770968885, -1.695145887, -1.695145887, -1.582494576, -1.582494576,
-0.761439823, -0.761439823, -1.565163604, -1.565163604, -0.724611509,
-0.724611509, -0.770105308, -0.770105308, -0.735443366, -0.735443366,
-0.765772566, -0.765772566, -0.724611509, -0.724611509, -0.759273452,
-0.759273452, -0.735443366, -0.735443366, -0.759273452, -0.759273452,
-0.735443366, -0.735443366, -1.82512817, -1.82512817, 1.469922697,
1.469922697, 1.337774043, 1.337774043, 1.424428898, 1.424428898,
1.320443072, 1.320443072, 1.359437757, 1.493752783, 1.359437757,
1.493752783, 1.342106786, 1.342106786, 1.346439529, 1.346439529,
1.485087297, 1.485087297, 1.294446616, 1.294446616, 0.726857314,
0.726857314, 0.516719291, 0.696528115, 0.516719291, 0.696528115,
0.464726378, 0.464726378, 0.724690943, 0.724690943, 0.746354657,
0.746354657, 0.601207774, 0.666198916, 0.601207774, 0.666198916,
0.430064436, 0.54704849, 0.430064436, 0.54704849), Wind.speed = c(0.342568876,
0.342568876, 0.342568876, 0.342568876, 0.342568876, 0.342568876,
0.342568876, 0.342568876, 0.342568876, 0.342568876, 0.342568876,
0.342568876, 0.342568876, 0.342568876, 0.342568876, 0.342568876,
0.860769967, 0.860769967, 0.342568876, 0.342568876, 0.860769967,
0.860769967, 0.860769967, 0.860769967, 0.860769967, 0.860769967,
0.860769967, 0.860769967, 0.860769967, 0.860769967, 0.860769967,
0.860769967, 0.860769967, 0.860769967, 0.860769967, 0.860769967,
0.860769967, 0.860769967, 0.342568876, 0.342568876, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, 0.342568876,
0.342568876, 0.342568876, 0.342568876, 0.342568876, 0.342568876,
0.342568876, 0.342568876, 0.342568876, 0.342568876, 0.342568876,
0.342568876, 0.342568876, 0.342568876, 0.342568876, 0.342568876,
0.860769967, 0.860769967, 0.342568876, 0.342568876, 0.860769967,
0.860769967, 0.860769967, 0.860769967, 0.860769967, 0.860769967,
0.860769967, 0.860769967, 0.860769967, 0.860769967, 0.860769967,
0.860769967, 0.860769967, 0.860769967, 0.860769967, 0.860769967,
0.860769967, 0.860769967, 0.342568876, 0.342568876, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -1.532825682,
-1.532825682, -1.532825682, -1.532825682, -1.532825682, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153, -0.854229153,
-0.854229153, -0.854229153, -0.854229153, -0.854229153)), .Names = c("SUR.ID",
"Valid.detections", "distance", "wind.speed", "receiver.depth",
"water.temperature", "Habitat", "Distance", "Receiver.depth",
"Transmitter.depth", "Water.temperature", "Wind.speed"), class = "data.frame", row.names = c(NA,
-200L))
scale(... , center=T, scale=T)
m1 <- glmer(Valid.detections ~ Transmitter.depth + Receiver.depth + Water.temperature +
Wind.speed + Distance + (Distance | SUR.ID), data=df, family = poisson)
x <- seq(from=1, to=1000)
X <- as.data.frame(x)
y <- exp(fixef(m2gg)["(Intercept)"] + fixef(m2gg)["Distance"]*X + fixef(m2gg)["Transmitter.depth"]*0.6067926 +
fixef(m2gg)["Receiver.depth"]*-0.1610828 + fixef(m2gg)["Water.temperature"]*-0.1128282 +
fixef(m2gg)["Wind.speed"]*-0.2959290)
sample2 <- structure(list(X.Intercept. = c(-0.101691254, -0.184443307),
distance = c(0.002089427, -0.00065884), SUR.ID = 10185:10186,
water.temperature = c(24.272, 24.272), transmitter.depth = c(1.54925,
1.54925), receiver.depth = c(0.82625, 0.82625), wind.speed = c(6.745425839,
6.745425839), Water.temperature = c(-0.112828232, -0.112828232
), Transmitter.depth = c(0.606792556, 0.606792556), Receiver.depth = c(-0.16108278,
-0.16108278), Wind.speed = c(-0.295928998, -0.295928998)), .Names = c("X.Intercept.",
"distance", "SUR.ID", "water.temperature", "transmitter.depth",
"receiver.depth", "wind.speed", "Water.temperature", "Transmitter.depth",
"Receiver.depth", "Wind.speed"), class = "data.frame", row.names = c(NA,
-2L))
L <- length(sample2$SUR.ID)
for (i in 1:L){
vals[i] <- '(Intercept)'=sample2[i,1],Transmitter.depth=sample2[i,11],
Receiver.depth=sample2[i,8],Water.temperature=sample2[i,10],
Wind.speed=sample2[i,13],distance=dist)
pred.obs[i] <- exp(cc %*% t(vals[i]))
max(dist[pred.obs>1])[i]
}
最佳答案
读入数据:
source("SO_unscale.txt")
Transmitter.depth
似乎没有缩放变体)
unsc.vars <- subset(dd,select=c(Transmitter.depth,
receiver.depth,water.temperature,
wind.speed,distance))
sc.vars <- subset(dd,select=c(Transmitter.depth,
Receiver.depth,Water.temperature,
Wind.speed,Distance))
colMeans(sc.vars)
apply(sc.vars,2,sd)
cm <- colMeans(unsc.vars)
csd <- apply(unsc.vars,2,sd)
## changed data name to dd
library(lme4)
cs. <- function(x) scale(x,center=TRUE,scale=TRUE)
m1 <- glmer(Valid.detections ~ Transmitter.depth +
receiver.depth + water.temperature +
wind.speed + distance + (distance | SUR.ID),
data=dd, family = poisson,
control=glmerControl(optimizer=c("bobyqa","Nelder_Mead")))
## FAILS with bobyqa alone
m1.sc <- glmer(Valid.detections ~ cs.(Transmitter.depth) +
cs.(receiver.depth) + cs.(water.temperature) +
cs.(wind.speed) + cs.(distance) + (cs.(distance) | SUR.ID),
data=dd, family = poisson,
control=glmerControl(optimizer=c("bobyqa","Nelder_Mead")))
logLik(m1)-logLik(m1.sc) ## 1e-7
rescale.coefs <- function(beta,mu,sigma) {
beta2 <- beta ## inherit names etc.
beta2[-1] <- sigma[1]*beta[-1]/sigma[-1]
beta2[1] <- sigma[1]*beta[1]+mu[1]-sum(beta2[-1]*mu[-1])
beta2
}
(cc <- rescale.coefs(fixef(m1.sc),mu=c(0,cm),sigma=c(1,csd)))
## (Intercept) cs.(Transmitter.depth) cs.(receiver.depth)
## 3.865879406 0.011158402 -0.554392645
## cs.(water.temperature) cs.(wind.speed) cs.(distance)
## -0.050833325 -0.042188495 -0.007231021
fixef(m1)
## (Intercept) Transmitter.depth receiver.depth water.temperature
## 3.865816422 0.011180213 -0.554498582 -0.050830611
## wind.speed distance
## -0.042179333 -0.007231004
ddist <- 1:1000
vals <- cbind(`(Intercept)`=1,Transmitter.depth=0.6067926,
Receiver.depth=-0.1610828,Water.temperature=-0.1128282,
Wind.speed=-0.2959290,distance=ddist)
pred.obs <- exp(cc %*% t(vals))
max(ddist[pred.obs>1])
m2 <- update(m1,. ~ . + wind.speed:distance)
m2.sc <- update(m1.sc,. ~ . + I(cs.(wind.speed*distance)))
logLik(m2)-logLik(m2.sc)
X <- getME(m2,"X")
cm2 <- colMeans(X)[-1]
csd2 <- apply(X,2,sd)[-1]
(cc2 <- rescale.coefs(fixef(m2.sc),mu=c(0,cm2),sigma=c(1,csd2)))
all.equal(unname(cc2),unname(fixef(m2)),tol=1e-3) ## TRUE
model.matrix([formula],data)
推导出模型矩阵。也就是说,如果您还没有安装
m2
你想得到
X
获得列均值和标准差,即
X <- model.matrix(Valid.detections ~ Transmitter.depth + receiver.depth +
water.temperature +
wind.speed + distance +
wind.speed:distance,
data=dd)
sigma(fitted_model)
)乘以响应变量的原始 SD。
关于r - unscale 和 uncenter glmer 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24268031/
我正在使用广义线性混合模型(glmer、lme4-package)用 R 分析我的二项式数据集。我想使用 Tukey 的事后测试(glht,multcomp-package)对某个固定效果(“声音”)
我是 R 新手,我正在使用 glmer 来拟合几个二项式模型,我只需要它们来调用 predict使用得到的概率。但是,我有一个非常大的数据集,即使只有一个模型的大小也会变得非常大: > library
我制作了一个模型,可以查看许多变量以及对怀孕结果的影响。结果是分组的二进制文件。一群动物有 34 只怀孕和 3 只空,接下来会有 20 只怀孕和 4 只空,以此类推。 我使用 glmer 对这些数据进
问题: 我有一个数据集,其中缺少一些预测变量值。我想将已应用于这些插补集的 glmer 模型汇集在一起。我使用 mice 包来创建插补(我也使用过 amelia 和 mi 但没有成功)。我想主要提
我正在测试不同生境和柱头类型的植物柱头上花粉粒数量的差异。 我的样本设计包括两个栖息地,每个栖息地有 10 个站点。 在每个地点,我有多达 3 种柱头类型(湿、干和半干),对于每种柱头类型,我有不同数
我有关于跨纬度感染特定宿主物种的病原体多样性的数据。设计涉及在不同纬度的4个地点的3个地点收集20个人,因此我有20个人,嵌套在3个地点内,嵌套在4个地点内。 鉴于我的病原体多样性数据是带有许多零的计
我一直在用我的(非 r-savvy)大脑来让 R 产生二项式 glmer 模型的正确预测的百分比。我知道这不是统计上的 super 信息,但经常被报道;所以我也想举报。 数据: 因变量:Tipo,它有
我正在使用 glmer 并且我希望提取随机效应(截距和斜率)的方差分量的标准偏差。 我试过使用: VarCorr(model) 它返回两个标准偏差值(加上相关性),但我只想提取截距和斜率 SD 值。
我正在尝试根据我的二项式数据运行的glmer模型随时间(x轴上的天数)预测值。 Total Alive和Total Dead是计数数据。这是我的模型,以及下面的相应步骤。 full.model.dre
我的变量是在一个带有二次抽样设计的随机块上测量的,其中我的处理是 23 次加入。我有 3 个完整的块和每块 6 个样本。示例数据帧有 4 个响应变量(LH、REN、FTT、DFR)、Accesion(
生态学中的一种常见情况是具有二元结果(0 = 死亡,1 = 存活)的生存模型,其中个体(在此示例中考虑鸟类的个体嵌套尝试)在面临死亡风险的天数方面存在差异。为了解决这个问题,我们使用修改后的逻辑回归,
我希望有人能帮助我。我正在尝试进行一项分析,检查在海拔梯度上捕获的膜翅目样本的数量。我想检查与海拔相关的单峰分布以及线性分布的可能性。因此,我将 I(Altitude^2) 作为分析中的解释变量。 我
我正在尝试通过 effect来自 effects 的函数与 (gl)merMod 一起打包来自 lme4 的对象包通过lapply循环并遇到我不期望的错误。看来effect函数无法在循环内查找对象。
我正在处理面板数据集并尝试运行具有固定效果的逻辑回归。 我发现 lme4 包和 bife 包中的 glmer 模型适合这种工作。 然而,当我对每个模型进行回归时,我没有得到相同的结果(估计值、标准误差
glmmPQL 中多重随机效应的语法是什么? 使用 glmer 我的代码如下所示: fit<- glmer(A~B+C+ (1 | D)+ (1 | E), family = gaussian, da
我正在使用 R 中的 lme4 的 glmer 函数分析数据(包括在下面)。我正在构建的模型包含一个泊松分布响应变量 (obs)、一个随机因子 (area)、一个连续偏移量 (duration ),
glmmPQL 中多重随机效应的语法是什么? 使用 glmer 我的代码如下所示: fit<- glmer(A~B+C+ (1 | D)+ (1 | E), family = gaussian, da
我正在使用 R 中的 lme4 的 glmer 函数分析数据(包括在下面)。我正在构建的模型包含一个泊松分布响应变量 (obs)、一个随机因子 (area)、一个连续偏移量 (duration ),
这可能更像是一个错误报告而不是一个问题,但是:为什么显式使用 newdata 参数来使用与训练数据相同的数据集进行预测有时会产生与省略 不同的预测>newdata 参数并明确使用训练数据集? libr
出于报告原因,我试图从 glmer 模型的 emmeans 获取自由度,但它们只显示 Inf。 这是一些示例数据。在真实数据中,没有嵌套结构,这只是我构建数据框的结果: set.seed(1234)
我是一名优秀的程序员,十分优秀!