首页 > 解决方案 > 模型未能与 max|grad| 收敛

问题描述

当我使用 lme4 运行混合模型时,我收到了此错误消息,但我仍然从摘要中得到一些结果:

model2<-lmer(rating.Hz.dif ~ is.congruent + is.positive + (1 |num)+ (1|Hz.Hz.dif) + (1+is.congruent|dot.Hz.dif), data=data_pilot)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
## Model failed to converge with max|grad| = 0.00432249 (tol = 0.002, component 1)
summary(model2)
## Linear mixed model fit by REML ['lmerMod']
## Formula: rating.Hz.dif ~ is.congruent + is.positive + (1 | num) + (1 |  
##     Hz.Hz.dif) + (1 + is.congruent | dot.Hz.dif)
##    Data: data_pilot
## 
## REML criterion at convergence: 5446.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.5399 -0.5047  0.0209  0.5152  6.1482 
## 
## Random effects:
##  Groups     Name          Variance Std.Dev. Corr 
##  num        (Intercept)   0.05640  0.2375        
##  dot.Hz.dif (Intercept)   0.05210  0.2282        
##             is.congruent1 0.02351  0.1533   -0.75
##  Hz.Hz.dif  (Intercept)   1.04776  1.0236        
##  Residual                 0.94025  0.9697        
## Number of obs: 1920, groups:  num, 30; dot.Hz.dif, 17; Hz.Hz.dif, 8
## 
## Fixed effects:
##               Estimate Std. Error t value
## (Intercept)    0.77491    0.51899   1.493
## is.congruent1  0.05780    0.08282   0.698
## is.positive1  -1.67257    0.72602  -2.304
## 
## Correlation of Fixed Effects:
##             (Intr) is.cn1
## is.congrnt1 -0.088       
## is.positiv1 -0.699  0.000
## convergence code: 0
## Model failed to converge with max|grad| = 0.00432249 (tol = 0.002, component 1)

这是数据集的样子:

structure(list(ï..num = 1:6, trial = c("1030", "1030", "1030", 
"1030", "1030", "1030"), rating = c(-3L, 1L, 2L, 1L, 2L, 1L), 
    is.congruent = c(1L, 1L, 1L, 1L, 1L, 1L), is.positive = c(1L, 
    1L, 1L, 1L, 1L, 1L), AQ = c(21L, 20L, 26L, 22L, 13L, 27L), 
    IRI_empathy = c(16L, 25L, 21L, 23L, 21L, 11L), is.social = c(0L, 
    0L, 0L, 0L, 0L, 0L), dot.Hz.dif = c(0L, 0L, 0L, 0L, 0L, 0L
    ), Hz = c(1030L, 1030L, 1030L, 1030L, 1030L, 1030L), Hz.rank = c(1L, 
    1L, 1L, 1L, 1L, 1L), dot.position = c(1L, 1L, 1L, 1L, 1L, 
    1L), rating.Hz.dif = c(-4L, 0L, 1L, 0L, 1L, 0L), Hz.Hz.dif = c("3.00%", 
    "3.00%", "3.00%", "3.00%", "3.00%", "3.00%")), row.names = c(NA, 
6L), class = "data.frame")

是因为百分比变量吗?别的东西?如果我收到此错误,summery 是否有任何意义?先感谢您!

标签: r

解决方案


推荐阅读