Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Group by dependent variable in coefplot with multiple models

    Hello, I am using coefplot in Stata 17. I am making a bar chart using coefplot that includes multiple models. The default for the coefplot bar chart groups results by outcome along the x-axis. However, I would like to group by model. Is this possible?

    Code:
     coefplot hpvmarg1 menmarg1 tetmarg1, recast(bar) vertical barw(.3)  title("") ciopts(recast(rcap) color(gs10)) citop
    This is the graph that the code produces:
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	21.6 KB
ID:	1681953


    However, I would like to produce something that looks like this graph made in Excel:
    Click image for larger version

Name:	excel.png
Views:	1
Size:	34.0 KB
ID:	1681954


    Thanks in advance!

  • #2
    Try separating the models with || in the command and/or adding the bycoefs option?

    Also, when using a community-contributed command, please specify where it is available from, so others can also use it. In this case, -coefplot- is available from SSC.
    Last edited by Hemanshu Kumar; 14 Sep 2022, 12:32.

    Comment


    • #3
      Thank you! I will be sure to specify where the package is available from in the future.

      Option 1 worked by splitting the coefplot into three graphs, which is okay, but not exactly ideal. I appreciate your help.

      Comment

      Working...
      X