混合模型 lme4 中的警告消息

发布于 2025-01-06 02:56:04 字数 446 浏览 0 评论 0原文

使用包 lme4 拟合“glmer”模型时,以下警告消息的含义是什么?

Warning messages:
1: glm.fit: fitted probabilities numerically 0 or 1 occurred 
2: In mer_finalize(ans) : false convergence (8)

我想要拟合的模型是这样的:

glmer(dummy ~ constituency.coa + I(governat.part) + I(district2) + gdp.cap + lula.power + ifdm + bf.cap + year + (1 | munname), data=pool, family=binomial(link = "logit"), REML=T, verbose=T)

谢谢

What is the meaning of the following warning message when fitting a 'glmer' model using package lme4?

Warning messages:
1: glm.fit: fitted probabilities numerically 0 or 1 occurred 
2: In mer_finalize(ans) : false convergence (8)

The model I'm trying to fit is like this:

glmer(dummy ~ constituency.coa + I(governat.part) + I(district2) + gdp.cap + lula.power + ifdm + bf.cap + year + (1 | munname), data=pool, family=binomial(link = "logit"), REML=T, verbose=T)

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

定格我的天空 2025-01-13 02:56:04

警告 1:对于一个或多个观测值,拟合值变为 0 或 1,但这在逻辑回归下是不可能的。原因有很多; ?glm 的帮助页面上讨论了其中一个,但这只不过是指向其他一些文档的指针。这只是一个警告,所以可能不是问题,但它是一个警告,表明有些东西不太合适。

警告 2:我不知道确切的含义,但代码告诉您优化例程声明拟合过程已收敛到估计值,但此声明是错误的并且拟合并未真正收敛。

需要注意的一件事是是否存在可分离性问题,即一个预测变量或预测变量的线性组合可以完美分割 01 事件。

我建议您在 R-SIG-Mixed 邮件列表上跟进,那里有真正的专家可以提供进一步的帮助。您可能需要提供拟合过程的更多详细信息(打开详细模式)甚至数据,以便诊断问题。

Warning 1: the fitted values became 0 or 1 for one or more observations, but this should not be possible under a logistic regression. The causes are many; one is discussed on the help page for ?glm but that is little more than a pointer to some other documentation. It is only a warning so may not be a problem, but it is a warning that something is not quite right with the fit.

Warning 2: I don't know the exact meaning, but the code is telling you that the optimisation routine declared the fitting procedure to have converged to the estimated values but that this claim is false and that the fitting did not really converge.

One thing to look at is whether there is a separability problem, where one predictor or a linear combination of predictors can perfectly split 0 and 1 events.

I suggest you follow this up on the R-SIG-Mixed mailing list where there are real experts who can help further. You may need to provide further details of the fitting process (turn on verbose mode) or even the data so the problem can be diagnosed.

锦上情书 2025-01-13 02:56:04

对于警告2,您可以增加迭代次数,默认为300,看看当您添加更多迭代时是否收敛。尝试:

glmer(dummy ~ constituency.coa + I(governat.part) + I(district2) + gdp.cap + lula.power + ifdm + bf.cap + year + (1 | munname), data=pool, family=binomial(link = "logit"), REML=T, verbose=T, control = list(maxIter = 600))

这会将迭代次数从 300 次更改为 600 次,但如果不起作用,您可以尝试更多次。

For Warning 2, you can up the number of iterations, the default is 300, to see if it converges when you add more iterations. try:

glmer(dummy ~ constituency.coa + I(governat.part) + I(district2) + gdp.cap + lula.power + ifdm + bf.cap + year + (1 | munname), data=pool, family=binomial(link = "logit"), REML=T, verbose=T, control = list(maxIter = 600))

this changes it from 300 iterations to 600, but you could try more if that doesn't work.

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