Hello everyone,
I have the following problem; I have created a scatter plot of displaying medians of a treatment and a control group from 1997 to 20012 with a visual cutpoint in 2004. To make it easier to read I now want to reduce the coefficients on both sides of the cutpoint to the mean value. I have been able to calculate the mean value before 2004 and after but I don't know which command to use to reduce the scatterplot to display the mean values devided by a visual cutpoint in 2004.
I used this to produce the scatterplot with medians in each year:
twoway (scatter med_inc_t year, xlabel(1997(3)2012) xtitle("Years") ytitle("Median Income in EUR") title("Wage Employment: Treated vs. Control") xline(2004, lcolor (red)) connect(line) lcolor(black) mcolor(black) legend(label(1 "Treated"))) ///
(scatter med_inc_c year , connect(line) lpattern(dash) lcolor(black) mcolor(black) legend(label(2 "Control")) msymbol(Oh))
graph save scatter_treated_control, replace
and I used this to calculate the mean of the medians before 2004 and after:
egen mean_inc_male_t_post=mean(med_inc_male_t) if year>2004
egen mean_inc_male_t_pre=mean(med_inc_male_t) if year<2004
egen mean_inc_male_c_post=mean(med_inc_male_c) if year>2004
egen mean_inc_male_c_pre=mean(med_inc_male_c) if year<2004
egen mean_inc_fem_t_post=mean(med_inc_fem_t) if year>2004
egen mean_inc_fem_t_pre=mean(med_inc_fem_t) if year<2004
egen mean_inc_fem_c_post=mean(med_inc_fem_c) if year>2004
egen mean_inc_fem_c_pre=mean(med_inc_fem_c) if year<2004
Thank you for your help!
Related Posts with Scatterplot only displaying means
(Technical) Problem with instrumental variables regression: (not existing) variable not foundDear statalisters, After having used other people's questions on the forum a lot during my research…
ivreg2 command for woolridge version of LPHi, Can you please let me know the ivreg2 command for estimating productivity using Woolridge versio…
Missing Standard Errors when vce(r) specified in xtreg, feDear All, Before I added 'vce(r)' option at the end of my xtreg, fe model I got standard error in th…
Counting observations of nearest neighboursDear forum members, my data is a panel structured as follows: id change nid1 nid2 nid3 nid4 nid5 Fo…
creating one dummy from many dummiesDear Members, I have seven dummies; region1 region2 region3 region4 region5 region6 region7; now i w…
Subscribe to:
Post Comments (Atom)
0 Response to Scatterplot only displaying means
Post a Comment