研究的分层模型 - 我可以在r中使用混合效果吗?
这是一项研究,其中3只小鼠用作对照,而3只是突变体。 > 2000测量是每只鼠标的。我想拟合一个模型如下:
lmer(测量值〜鼠标 +(鼠标|处理),data = alldata,reml = true),
但这不会收敛。我尝试使用Nelder-Mead方法和L-BFGS-B修改控件。不同的模型提供了不同的错误消息。
上面的简单模型产生:
CheckConv中的警告(attr(opt,“ derivs”),opt $ par,ctrl = control $ checkconv,:: 无法评估
CheckConv中的缩放梯度警告(attr(opt,“ derivs”),opt $ par,ctrl = control $ checkConv,: 模型无法收敛:归化Hessian,具有7个负特征值
,如果可以的话,最“复杂”的模型,模型:
lmer: lmer(测量〜鼠标 + |处理),data = alldata,control = lmercontrol(lmercontrol(lmercontrol)( Optimizer ='Optimx',optctrl = list(方法='l-bfgs-b')),reml = false)
屈服:
边界(单数)拟合:请参阅?isingular
,并且尝试另一种型号的另一种警告。我的问题是小鼠也没有得到其他治疗方法吗?如果是这样,我将如何调整模型以反映已经发生的事情并融合了?
我的印象是随机效应应该是处理,固定效应是鼠标。也许我想要的模型被错误地命名了?也许我有这个随机/固定的效果思维过程错误。请指教。
This is a study in which 3 mice were used as control, and 3 were mutant. >2000 measurements were taken per mouse. I want to fit a model as follows:
lmer(measurements ~ mouseID + (mouseID|treatment), data = alldata, REML = TRUE)
but this does not converge. I have tried modifying control using Nelder-Mead Method, and L-BFGS-B. Different models give different error messages.
The simple model above yields:
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
unable to evaluate scaled gradient
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge: degenerate Hessian with 7 negative eigenvalues
and the most "complex" if you will, model:
lmer(measurements ~ mouseID + (mouseID|treatment), data = alldata, control = lmerControl(
optimizer ='optimx', optCtrl=list(method='L-BFGS-B')), REML = FALSE)
yields:
boundary (singular) fit: see ?isSingular
and there was at least one more warning with another model attempted. Is my problem that the mice did not also receive the other treatment? And if so, how would I adjust the model to reflect what did already happen AND converge?
I am of the impression that the random effect should be the treatment, and the fixed effect is the mouseID. Maybe my desired model is misnamed? Or maybe I have this random/fixed effect thought process wrong. Please advise.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我正确解释,那么您正在寻找治疗对鼠标ID是随机效果的小鼠的影响。您是否尝试过
lmer(测量值〜处理 +(1 |鼠标_id),data = alldata,reml = true)
?这通常是在LMER中制定随机效应模型的方式。没有更多有关您的研究设计/目标的信息,很难回答您的问题。If I'm interpreting correctly, you're looking for the effect of treatment on mice, where the mouse ID is the random effect. Have you tried
lmer(measurements ~ treatment + (1|mouse_ID), data = alldata, REML = TRUE)
? This is usually how random effects models are formulated in lmer. It is difficult to answer your question without more info about your study design/objectives.