Announcement

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

  • marginsplot and clustered column (bar) graphs

    Hi,

    I'm a new user and cannot get marginsplot to do a basic clustered column (bar) graph with categories on x axis and 2 groups for each category plotted on the y aix (e.g., treated, control).

    I tried this code with STAT v15:

    margins, over(treated_lanham grade3)
    marginsplot, xdim(grade3) plot(treated_lanham) recast(bar) allx

    but it's stacking the 2 groups in one column (that are differently colored) instead of 2 differently colored columns side by side. Any help would be appreciated!

    ​​​​​​​Taletha

  • #2
    You can get separate graphs with the -by()- option, otherwise I think you need to save the margins and generate your graph using twoway.

    Code:
    marginsplot, xdim(grade3) plot(treated_lanham) recast(bar) allx by(treated_lanham)

    Comment

    Working...
    X