Hello all,
I am trying to present a graph using marginsplot but I find the values from an interaction stack on top of each other. I know that this is supposed to be and that it might be useful when comparing two trends over different values of a variables, but I'm dealing strictly with categories. Here's an idea of what I'm trying to do:

As you can see from the chart, domestic and foreign are on top of each other, which means their CIs overlap. Is there anyway to use marginsplot so that all values of domestic are offset by -.1 on the x axis and that all values of foreign are offset by +.1 on the x axis? It would make for a more understandable chart in regards to comparing domestic and foreign over each categories... In my dataset, the interaction is between a variable with three categories and one with four categories... so having 4 markers on top of each other is even harder to read.
I know there must be a way to do this with coefplot, but I couldn't find it. I thought I'd ask if there was an "easy" way with marginsplot.
Thanks!
JP Gauvin
I am trying to present a graph using marginsplot but I find the values from an interaction stack on top of each other. I know that this is supposed to be and that it might be useful when comparing two trends over different values of a variables, but I'm dealing strictly with categories. Here's an idea of what I'm trying to do:
Code:
sysuse auto reg price i.rep78##i.foreign margins rep78#foreign marginsplot, recast(scatter)
As you can see from the chart, domestic and foreign are on top of each other, which means their CIs overlap. Is there anyway to use marginsplot so that all values of domestic are offset by -.1 on the x axis and that all values of foreign are offset by +.1 on the x axis? It would make for a more understandable chart in regards to comparing domestic and foreign over each categories... In my dataset, the interaction is between a variable with three categories and one with four categories... so having 4 markers on top of each other is even harder to read.
I know there must be a way to do this with coefplot, but I couldn't find it. I thought I'd ask if there was an "easy" way with marginsplot.
Thanks!
JP Gauvin
Comment