I noticed that some of the error bar values plotted in the forest plots for my negative binomial GLMs were different to those using exp(confint(<model>)). It looks like this is due to the hardcoded p.val = "wald" line in the call to tidy_model in plot_type_est.R (so the CIs are calculated using Wald instead of profile).
I've included example code below. This could be fixed by just setting p.val = NULL in plot_type_est.R. However, the submitted pull request allows you to specify the method you want to use from the plot_model function.
Thanks
library(MASS)
library(sjPlot)
set.seed(2)
y <- rnbinom(n = 500, mu = 1.8, size = 0.7266)
group <- sample(c(rep("GroupA",450), rep("GroupB",47), rep("GroupC",3)))
dat <- data.frame(y,group)
m <- glm.nb(y ~ group, dat)
#Profile CIs
round(exp(confint(m)),2)[-1,]
#Wald CIs
round(exp(confint.default(m)),2)[-1,]
#sjPlot CIs
p <- plot_model(m)
round(p$data$conf.low,2)
round(p$data$conf.high,2)
Hi Daniel
I noticed that some of the error bar values plotted in the forest plots for my negative binomial GLMs were different to those using
exp(confint(<model>))
. It looks like this is due to the hardcodedp.val = "wald"
line in the call totidy_model
in plot_type_est.R (so the CIs are calculated using Wald instead of profile).I've included example code below. This could be fixed by just setting
p.val = NULL
in plot_type_est.R. However, the submitted pull request allows you to specify the method you want to use from theplot_model
function.Thanks