当我尝试从Glmer Poisson模型中提取置信区间和赔率比时,为什么rstudio冻结?

发布于 2025-01-23 06:56:35 字数 1012 浏览 3 评论 0原文

我正在尝试运行混合效果模型。我在下面包括了一个简化的版本;

Poisson1 = 
    glmer(
    formula = 
      wheezing_InD ~ 
      age_InD + 
      (1|countryfactor),
    family=poisson(link="log"),
    data = Data46)

然后,我正在尝试使用以下代码从中获得ORS和置信区间:

exp(cbind(OR = coef(Poisson1), confint(Poisson1)))

数据的示例如下(在dput表单中):

structure(list(wheezing_InD = c("0", "1", "1", "0", "0", 
"0", "0", "0", "1", "0", "0", "0", "0", "1", "0", 
"0", "1", "1", "1", "0"), age_InD = c(55L, 24L, 23L, 
30L, 40L, 43L, 37L, 38L, 18L, 23L, 28L, 33L, 27L, 54L, 23L, 23L, 
42L, 48L, 31L, 18L), countryfactor = structure(c(1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L), .Label = c("cameroon", "ghana", "kenya"), class = "factor")), row.names = c(NA, 
20L), class = "data.frame") 

代码运行良好,但是该软件在尝试时会冻结计算置信区间。它被卡在“计算配置文件置信区间...”上,直到我手动中止代码后才进展。

这种提取ORS + CIS的方法过去对我有用,具有固定的效果二项式模型。有原因在这里不工作吗?

提前致谢

I'm trying to run a mixed effects model. I've included a simplified version of it below;

Poisson1 = 
    glmer(
    formula = 
      wheezing_InD ~ 
      age_InD + 
      (1|countryfactor),
    family=poisson(link="log"),
    data = Data46)

I am then trying to get the ORs and confidence intervals from it using the code below:

exp(cbind(OR = coef(Poisson1), confint(Poisson1)))

A sample of the data is as follows (in dput form):

structure(list(wheezing_InD = c("0", "1", "1", "0", "0", 
"0", "0", "0", "1", "0", "0", "0", "0", "1", "0", 
"0", "1", "1", "1", "0"), age_InD = c(55L, 24L, 23L, 
30L, 40L, 43L, 37L, 38L, 18L, 23L, 28L, 33L, 27L, 54L, 23L, 23L, 
42L, 48L, 31L, 18L), countryfactor = structure(c(1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L), .Label = c("cameroon", "ghana", "kenya"), class = "factor")), row.names = c(NA, 
20L), class = "data.frame") 

The code runs fine, but the software freezes when trying to compute the confidence intervals. It gets stuck at "Computing profile confidence intervals ..." and won't progress until I manually abort the code.

This method of extracting ORs + CIs has worked for me in the past with fixed effects binomial models. Is there a reason it isn't working here?

Thanks in advance

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文