我在lme4程序包中为r建立并运行了混合效应逻辑回归模型,以估计不同位置(单元/栖息地)鱼类的占有概率。该数据框包括对68条单条鱼的1,207,140条观测值。对于每个人(每天约1年),它描述了相对于所有位置的总发生次数,每个唯一位置的发生次数。
这是基本模型:
m.base = glmer(cbind(N,t.move-N) ~ jdate + snSurface.Area + Restoration..P.A. +
Release.Location+ Sex + (1|Station) + (0 + jdate|ID), data=allfishdat, family=binomial)
where N=# unique positions, t.move=total positions, jdate=julian date, Station=locations, ID=fish ID
我收到以下警告消息:
Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 3349.26 (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有关,需要进行更多的迭代才能达到收敛,则下面的代码可能会有所帮助。将“20000”替换为对您的特定型号有意义的任何最大迭代次数。 (请注意,您的原始模型代码最后已修改为包含“control = my.control”。)
my.control=lmerControl(optCtrl=list(maxfun=20000); my.control
m.base = glmer(cbind(N,t.move-N) ~ jdate + snSurface.Area + Restoration..P.A. + Release.Location+ Sex + (1|Station) + (0 + jdate|ID), data=allfishdat, family=binomial, control = my.control)
使用以下命令来查看当前的lmeControls也可能对您很有用:
str(lmerControl())
此外,此先前的答案可能对您有所帮助:
increase iterations for new version of lmer?
关于r - 了解r lme4中混合模型的警告消息,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24208780/