Dear Statalist community,
Hi! I am struggling to find ways to overlay graph A, the graph of the adjusted predictions of "percent employed" from an OLS diff-in-diff regression I plotted using "margins" and "marginsplot", with graph B, the purely descriptive graph of "percent employed" I plotted using "graph two way (line ...)" into one graph.
I also wish to change the lines in the purely descriptive graph B into dotted lines once the overlaid graph is achieved.
Here is the graph A I plotted:
Here are the Stata codes I used to plot graph A:
Here is the graph B I plotted:
Here are the Stata codes I used to graph the purely descriptive graph B:
Any suggestions on how I can overlay the above two graphs into one? (Ideally I want to overlay graph B onto graph A and change the two lines in graph B into dotted lines)
Thank you!
Hi! I am struggling to find ways to overlay graph A, the graph of the adjusted predictions of "percent employed" from an OLS diff-in-diff regression I plotted using "margins" and "marginsplot", with graph B, the purely descriptive graph of "percent employed" I plotted using "graph two way (line ...)" into one graph.
I also wish to change the lines in the purely descriptive graph B into dotted lines once the overlaid graph is achieved.
Here is the graph A I plotted:
Here are the Stata codes I used to plot graph A:
Code:
regress employ FEMALE##after edu age age_sq married NumberChild agricultural NorthEast Coastal Central, robust
margins, at(after = (0 1) FEMALE = (0 1))
marginsplot, plot( , label("Men (Aged 17-25)" "Women (Aged 17-25)")) ytitle ("Predicted Percent Employed") xtitle ("Pre-Policy vs. Post-Policy") xlabel (0 "2012" 1 "2014")
Here is the graph B I plotted:
Here are the Stata codes I used to graph the purely descriptive graph B:
Code:
use "data.dta", clear
gen yearreal = 2012 if year == 3
replace yearreal = 2014 if year == 5
bysort yearreal FEMALE:egen employ_mean=mean(employ)
graph twoway (line employ_mean yearreal if FEMALE==1) (line employ_mean yearreal if FEMALE == 0), xlabel(2012(2)2014) ytitle("Percent Employed") xtitle("2012 vs. 2014") legend(pos(5) label(1 "women (17-25) percent employed") label(2 "men (17-25) percent employed") cols(1))
Thank you!

Comment