研究的分层模型 - 我可以在r中使用混合效果吗?

发布于 2025-02-07 22:09:58 字数 775 浏览 2 评论 0原文

这是一项研究,其中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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

假情假意假温柔 2025-02-14 22:09:58

如果我正确解释,那么您正在寻找治疗对鼠标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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文