1

I would like to hear of possible solutions to the following problem. I want to integrate the confintcommand with the general logistic regression glm command on R so that it can be default provide the confidence intervals when runing logistic regression models. I am posting another discussion post that refers to confint and it is a useful link to avoid any misunderstandings as I rarely post questions here. Computing Confidence Intervals for Coefficients in Logistic Regression

I tried the following code for generating the effects plot but it did not work due to the lack of confidence intervals:

M1<-glm(formula=approval_binary~compliance+militarism2+internationalism2+political_views+culture+income+education+language+religion+gender+age,family="binomial", data=dataset1)
summary(M1)
effects_M1=margins(M1)
print(effects_M1)
plot(effects_M1)
effects_M1=summary(effects_M1)

ggplot(data=effects_M1)+
  geom_point(aes(factor, AME)) +
  geom_errorbar(aes(x = factor, ymin = lower, ymax = upper)) +
  geom_hline(yintercept = 0) +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45))

Alternatively, I would like to know whether is is possible to integrate the confint command into a normal effects plot (see the one above) which will allow me to graph it together with the confidence intervals.

Zlatin
  • 11
  • 1
  • Welcome to the site. Unfortunately software implementation is off-topic here. If you have trouble with the actual calculation of confidence intervals, please edit your question with the button below it. – Frans Rodenburg Nov 19 '19 at 04:32

0 Answers0