Hi list,
I have issues with the margins command and (too many) overlaping confidence intervals. As you might see from the picture, it is hard to tell what is actually happening at the right most side of the plot beneath. I have runned what is sometimes refered to as a "difference-in-differnce-in-differences" (http://www.nber.org/WNE/lect_10_diffindiffs.pdf) model and then I use margins to show linear predictions. My problem is that the confidence interval makes it look messy, and I can't tell them apart.
Year is a time indicator [0;1], D is a treatment indicator [0;1] and dE [0;1 ]is the third variable that I'm interested in. (I want to see if the treatment is different for persons who have dE==0 and 1.)
My question is: is there a way to get Stata to estimate margins for year=0.98 for one group, or something like that - so I can visually distinguish the confidence intervals?
When I try to do
I get a warning saying: "at level for factor year not present in estimation".
I tried to do something like this:
But the lines are not exactly the same as in the margins plot, and there is of course no confidence intervals at all.
In other words, I would simply like to push e.g. the two dashed lines a little down the axis to better see what is actually happening in the plot.
I have issues with the margins command and (too many) overlaping confidence intervals. As you might see from the picture, it is hard to tell what is actually happening at the right most side of the plot beneath. I have runned what is sometimes refered to as a "difference-in-differnce-in-differences" (http://www.nber.org/WNE/lect_10_diffindiffs.pdf) model and then I use margins to show linear predictions. My problem is that the confidence interval makes it look messy, and I can't tell them apart.
Year is a time indicator [0;1], D is a treatment indicator [0;1] and dE [0;1 ]is the third variable that I'm interested in. (I want to see if the treatment is different for persons who have dE==0 and 1.)
Code:
reg outcome year##D##dE, vce(cluster identifyer) margins, at (year=(0 1) D=(0 1) dE=(9 1)) marginsplot, xline(0.3)
When I try to do
Code:
reg outcome year##D##dE, vce(cluster identifyer) margins, at (year=(0 0.98 1) D=(0 1) dE=(9 1)) marginsplot, xline(0.3)
I tried to do something like this:
Code:
reg outcome year##D##dE, vce(cluster identifyer) predict Y replace year = 0.98 if dE==1 & year==1 collpase Y, by(year D dE) gr two (connect Y year if D==0 & dE==0)/// (connect Y year if D==0 & dE==1)/// (connect Y year if D==1 & dE==0)/// (connect Y year if D==1 & dE==1), xline(0.3)
In other words, I would simply like to push e.g. the two dashed lines a little down the axis to better see what is actually happening in the plot.
Comment