1

I run 15 different regression models (it is basically the same regression with the same variables, just different years) and plot the coefficents using plot_coefs.

In the plot, however, coefficents are only displayed for the first 12 of the 15 models. The legend on the other hand shows all models.

My command is:

cdu_1965b <- glm(cduwahl ~  alter + bildung + mann + konfessi 
                 , data = Wahl1965, family = "binomial")

cdu_1969b <- glm(cduwahl ~  alter + bildung + mann + konfessi 
                 , data = Wahl1969, family = "binomial")

.... (same for other 13 models)

library(jtools)
plot_coefs (cdu_1965b,cdu_1969b, ...other models..., colors = "Rainbow", omit.coefs = c("(Intercept)", "altermittel", "alteralt", "bildunghoch", "bildungmittel", "bildungalt", "mann"))

Is there a maximum number that can be plotted?

Thank you!

What else could I try?

L--
  • 565
  • 1
  • 12
  • Hi @JohannesH, welcome to SO! Please make sure you note any non-base R packages you're using; it seems this might be about the `plot_coef` function you're using. Is it this one? https://jtools.jacob-long.com/reference/plot_summs.html – Michael Roswell Mar 20 '23 at 14:18
  • Thank you for the suggestion, I'm sorry, I didn't know as I'm new SO. – Johannes H. Mar 20 '23 at 14:38

1 Answers1

1

This seems to be because plot_coefs only has 12 different shapes.

If you set point.shape = F all models should appear.

13th model missing with point.shape

library(jtools)

lm1 <- lm(mpg ~ cyl, mtcars)

plot_coefs(lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, 
           colors = "Rainbow", 
           omit.coefs = c("(Intercept)", "altermittel", "alteralt", 
                          "bildunghoch", "bildungmittel", "bildungalt", "mann"))

enter image description here

But appears without point.shape

plot_coefs(lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, lm1, 
           colors = "Rainbow", point.shape = F,
           omit.coefs = c("(Intercept)", "altermittel", "alteralt", 
                          "bildunghoch", "bildungmittel", "bildungalt", "mann"))

enter image description here

L--
  • 565
  • 1
  • 12