Hi Statalists,
I'm estimating a model using:
I'm trying to generate a graph for a placebo test displaying marginal effects for my regression of the effect of treatment (X) on four different Y variables.
I've managed to create four separate graphs for each dependent variable, however, I'm struggling with how to put them all in the same graph (i.e. one graph showcasing four lines of the marginal effect for each of the four dependent variables). Essentially, I want it to look similar to this:
Anyone know the code for how to make one graph showing marginal effects for multiple dependent variables?
In addition, I'm trying to create another graph displaying the marginal effects of the effect of treatment (X) on one dependent variable Y for three groups: women, men, and overall effect. It should look something like this:
I've managed to get the marginal effects for men and women using this code below, however, I'm struggling to add the full sample:
Anyone know the code for adding a line for the full sample (0 + 1) on the graph?
Kind regards
I'm estimating a model using:
Code:
reg Y i.treatment, robust margins, dydx(treatment) marginsplot, horizontal
I've managed to create four separate graphs for each dependent variable, however, I'm struggling with how to put them all in the same graph (i.e. one graph showcasing four lines of the marginal effect for each of the four dependent variables). Essentially, I want it to look similar to this:
Anyone know the code for how to make one graph showing marginal effects for multiple dependent variables?
In addition, I'm trying to create another graph displaying the marginal effects of the effect of treatment (X) on one dependent variable Y for three groups: women, men, and overall effect. It should look something like this:
I've managed to get the marginal effects for men and women using this code below, however, I'm struggling to add the full sample:
Code:
reg Y i.treatment##i.sex, rob margins, dydx(treatment) at(sex=(0 1)) marginsplot, recast(scatter)
Kind regards
Comment