提问人:S_vdp 提问时间:4/18/2023 更新时间:4/18/2023 访问量:91
在 R 中运行 glmer 时出错:特征值比大 - 重缩放变量
Errors when running glmer in R: Large eigenvalue ratio - Rescale variable
问:
我收到一个奇怪的警告,在运行具有二元结果的广义线性混合模型时,我不明白。
型号代码
e = glmer(Sexb ~ `Age class` + `Hunting method def` + group_d + `Age class`:group_d + (1 | `Hunting season`),
data = modeldata,
family = binomial
)
Warning: Model is nearly unidentifiable: large eigenvalue ratio
- Rescale variables?
模型摘要
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: Sexb ~ `Age class` + `Hunting method def` + group_d + `Age class`:group_d + (1 | `Hunting season`)
Data: modeldata
AIC BIC logLik deviance df.resid
2618.3 2696.5 -1295.2 2590.3 1943
Scaled residuals:
Min 1Q Median 3Q Max
-4.9826 -0.8979 -0.6678 1.0882 1.6015
Random effects:
Groups Name Variance Std.Dev.
Hunting season (Intercept) 0.01488 0.122
Number of obs: 1957, groups: Hunting season, 6
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.33915 0.26018 1.304 0.1924
`Age class`1 -0.99888 0.90146 -1.108 0.2678
`Age class`2 0.24938 0.67717 0.368 0.7127
`Age class`3+ 1.08310 0.52225 2.074 0.0381 *
`Hunting method def`HD -0.08716 0.13083 -0.666 0.5053
group_dFamily Pack -0.37231 0.30945 -1.203 0.2289
group_dSolo -0.70229 0.28811 -2.438 0.0148 *
`Age class`1:group_dFamily Pack 21.30707 126.26487 0.169 0.8660
`Age class`2:group_dFamily Pack -17.77823 66.55510 -0.267 0.7894
`Age class`3+:group_dFamily Pack 2.22920 1.15709 1.927 0.0540 .
`Age class`1:group_dSolo 1.21386 0.91569 1.326 0.1850
`Age class`2:group_dSolo -0.62667 0.69968 -0.896 0.3704
`Age class`3+:group_dSolo -0.89530 0.54769 -1.635 0.1021
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation matrix not shown by default, as p = 13 > 12.
Use print(x, correlation=TRUE) or
vcov(x) if you need it
optimizer (Nelder_Mead) convergence code: 0 (OK)
Model is nearly unidentifiable: large eigenvalue ratio
- Rescale variables?
关于数据的几句话
我的数据包含 5 个变量:
- 狩猎方法(HD 或 DD)
- 性别(男性或女性)=>转换为性别b,其中 1 = 女性
- 年龄级别 (0,1,2,3+)
- 狩猎季节(6季)
- Group_d (Sexb)
Summary of the data
Hunting method def Sex Age class Hunting season group_d Sexb
DD:1657 female: 867 0 :416 11_12:338 Duo : 111 0:1090
HD: 300 male :1090 1 :599 12_13:341 Family Pack: 162 1: 867
2 :388 13_14:433 Solo :1684
3+:554 14_15:408
17_18:287
20_21:150
由于我对 glmer 没有经验,我真的不知道如何处理警告。此源 (https://rstudio-pubs-static.s3.amazonaws.com/33653_57fc7b8e5d484c909b615d8633c01d51.html) 给出了重新缩放连续变量的解决方案。但是,由于所有可能的变量都是因素,我不知道我应该如何应用它。
如何处理此警告?
答: 暂无答案
评论