Hello everyone,

I have the following problem; I have produced scatterplots displaying the median income from 1997 to 2012 with a visual cut off in 2004. I have done this for a treatment and a control group. Since it will get messy as soon as I include multiple groups, I would like to do reduce the coefficients before 2004 and after to the means of the medians. So that I will only display the mean before and after for each group. I have already generated variables with the means, but I am not able to display both means with a line (2004) in the middle.

How I have produced the scatterplot with all medians:

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))

How I have generated the mean of the medians pre and post:

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

Thanks for your help!