Announcement

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

  • Plot of Interaction Term

    I am trying to use margins and marginsplot to plot the effect of X1 in a regression as follows:

    Y=a+b1*X1+b2*X2+b3*X1*X2+e

    This is straightforward, as outlined by Maarten Buis here: https://www.statalist.org/forums/for...=1659532544301. However, this gives me graphs that look like this:


    Click image for larger version

Name:	eg.png
Views:	1
Size:	94.4 KB
ID:	1676251




    However, both X1 and X2 are continuous in my case and so I would like to produce a graph that replaced the individual confidence interval markers with dotted lines (or similar) as in the Brambor example in the linked post:

    [ATTACH=CONFIG]n1453608[/ATTACH]
    Click image for larger version

Name:	fetch?id=1453608&d=1531751177&type=full.png
Views:	1
Size:	18.9 KB
ID:	1676250



    However, despite my best efforts I haven't worked out how to achieve this. I would be grateful for any pointers.

    Cheers,

    Stu

  • #2
    In the end this turned out to simply require the use of recastci(area) , why that hadn't worked previously was either a bug or the result of some complication with addplot.

    Comment

    Working...
    X