首页 > 解决方案 > 如何为 glmer 添加 CI 误差线并在 plot_model 中编辑截距图?

问题描述

我正在研究与健康人相比,被诊断患有精神疾病的人需要多长时间才能检测到恐惧、快乐和中性的情绪面孔。

我正在使用广义线性混合模型进行分析,最佳拟合模型如下:

gmod3.5 <- glmer(rt ~ Group * Emotion + trialnum2 +(1+Emotion|ID)+(1|Actor), data=CFS_21, family=Gamma(link="identity"))

因子组有两个层次(SZ、CG),因子情感有树层次(F、H、N),以年龄为中心。

对于情节,我编写了以下代码:

set_theme(base = theme_classic(), #To remove the background color and the grids
          axis.title.size = 1.0,  #To change axis title size
          axis.textsize.x = 1.0,  #To change x axis text size
          axis.textsize.y = 1.0,
          legend.item.backcol = "white",
          legend.item.bordercol = "white",
          legend.backgroundcol = "white",
          legend.inside = TRUE)

p<-plot_model(gmod3.5, type = "int", vars = c("Emotion", "Group", "trialnum2"),
           title="Response time per group considering the emotion",
           colors = "Set2",
           show.values = TRUE,
           value.offset = .2,
           value.size = 2,
           dot.size = 2,
           line.size = 1,
           width = 1)

p + scale_y_continuous(limits = c(0, 4), breaks = c(0, 1, 2, 3, 4))

单击此处查看 GLMM 图

但是,我需要使用 CI 作为误差线并使组(CG 和 SZ)彼此更接近

有谁知道如何使用 plot_model 函数来做到这一点?

标签: rplotmixed-models

解决方案


推荐阅读