Announcement

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

  • Changing marker symbols for each level of an interaction using marginsplot

    Hi everyone,

    I am using Stata 14.2 and the default scheme (s2color) to plot the conditional marginal effects of an interaction between two continuous variables (indvar1 and indvar2) at four different values of indvar2 using -marginsplot- and the following code:

    ologit depvar c.indvar1##c.indvar2 ${controlvars}
    margins, dydx(indvar2) at(indvar1=(0(.1)1) indvar2=(0 .01972556 .19057263 1)) atmeans predict(outcome(1))
    marginsplot, xtitle("indvar1") ytitle("Effects on Pr(Outcome1)") plotopts(msymbol(D))

    This results in a graph (attached) with four lines, one at each level of indvar2. I would like to change the marker symbols so that the markers are different for each of the four lines. That is, I would like the markers to be diamonds for one line, circles for the second line, squares for the third line, and X's for the fourth line. However, when I use plotopts, it changes all the symbols at the same time. Is there a way to change the marker symbols so that they are different for each of the four lines?

    Thank you.
    Attached Files

  • #2
    Options for markers in marginsplot are documented here:

    Code:
    help marker_options
    The main example in the help file seems to address what you are asking directly.

    Comment

    Working...
    X