Hello,
I'm working with a data set and I would like to plot 4 event study graphs in square with 2 on the first row and 2 on the second. Each graph plot the estimates of 4 subgroups so I have 4 lines on each graph, I also need a vertical line in x = 3.5 and an horizontal one in y = 0. I would like to have a common legend. I would like each graph to be vertical in the same way it is in the picture. Here is my current code :
coefplot (Pre_Indep_1) (Indep_1) (Post_Tulip_1) (Parliamentary_1), recast(connected) level(90) ///
yline(0) xline(3.5, lcolor(black)) vertical drop(_cons) ///
graphregion(color(white)) title("Self-employed among workers") xtitle("Years from 1st birth",size(medlarge)) ///
|| (Pre_Indep_2) (Indep_2) (Post_Tulip_2) (Parliamentary_2), recast(connected) level(90) ///
yline(0) xline(3.5, lcolor(black)) vertical drop(_cons) ///
graphregion(color(white)) title("Contributing family worker among workers") xtitle("Years from 1st birth",size(medlarge)) ///
|| (Pre_Indep_3) (Indep_3) (Post_Tulip_3) (Parliamentary_3), recast(connected) level(90) ///
yline(0) xline(3.5, lcolor(black)) vertical drop(_cons) ///
graphregion(color(white)) title("Employed among individuals in the labor force") xtitle("Years from 1st birth",size(medlarge)) ///
||(Pre_Indep_4) (Indep_4) (Post_Tulip_4) (Parliamentary_4), recast(connected) level(90) ///
yline(0) xline(3.5, lcolor(black)) vertical drop(_cons) ///
graphregion(color(white)) title("Out of the Labor Force") xtitle("Years from 1st birth",size(medlarge)) ///
However stata tells me the vertical option is not allowed. I also tried to run the coefplot separately and combining them afterward with graph combine as it follows but it doesn't work.
graph combine `graph1' `graph2' `graph3' `graph4', ///
rows(2) cols(2) xsize(12) imargin(zero) xtitle("Year from 1st birth", size(medlarge)) ///
legend(off) common legend(label(1 "< 1993") label(2 "< 2005") label(3 "< 2010") label(4 "< 2019")
/// title("Periods") rows(1))
I would be really grateful if someone could help me.
Thank you in advance.
I'm working with a data set and I would like to plot 4 event study graphs in square with 2 on the first row and 2 on the second. Each graph plot the estimates of 4 subgroups so I have 4 lines on each graph, I also need a vertical line in x = 3.5 and an horizontal one in y = 0. I would like to have a common legend. I would like each graph to be vertical in the same way it is in the picture. Here is my current code :
coefplot (Pre_Indep_1) (Indep_1) (Post_Tulip_1) (Parliamentary_1), recast(connected) level(90) ///
yline(0) xline(3.5, lcolor(black)) vertical drop(_cons) ///
graphregion(color(white)) title("Self-employed among workers") xtitle("Years from 1st birth",size(medlarge)) ///
|| (Pre_Indep_2) (Indep_2) (Post_Tulip_2) (Parliamentary_2), recast(connected) level(90) ///
yline(0) xline(3.5, lcolor(black)) vertical drop(_cons) ///
graphregion(color(white)) title("Contributing family worker among workers") xtitle("Years from 1st birth",size(medlarge)) ///
|| (Pre_Indep_3) (Indep_3) (Post_Tulip_3) (Parliamentary_3), recast(connected) level(90) ///
yline(0) xline(3.5, lcolor(black)) vertical drop(_cons) ///
graphregion(color(white)) title("Employed among individuals in the labor force") xtitle("Years from 1st birth",size(medlarge)) ///
||(Pre_Indep_4) (Indep_4) (Post_Tulip_4) (Parliamentary_4), recast(connected) level(90) ///
yline(0) xline(3.5, lcolor(black)) vertical drop(_cons) ///
graphregion(color(white)) title("Out of the Labor Force") xtitle("Years from 1st birth",size(medlarge)) ///
However stata tells me the vertical option is not allowed. I also tried to run the coefplot separately and combining them afterward with graph combine as it follows but it doesn't work.
graph combine `graph1' `graph2' `graph3' `graph4', ///
rows(2) cols(2) xsize(12) imargin(zero) xtitle("Year from 1st birth", size(medlarge)) ///
legend(off) common legend(label(1 "< 1993") label(2 "< 2005") label(3 "< 2010") label(4 "< 2019")
/// title("Periods") rows(1))
I would be really grateful if someone could help me.
Thank you in advance.