clear ed gen i=_n gen iso=substr(ccyy,1,2) gen year = real(substr(ccyy,3,4)) reshape long c, i(i) j(x) replace x=(x-7)/2 bysort iso: egen may=max(year) bysort iso: egen miy=min(year) two /// (li c x if ptt==1 & year==may, lc(red)) (li c x if ptt==2 & year==may, lc(blue)) /// (li c x if ptt==1 & year==miy, lp(dash) lc(red)) (li c x if ptt==2 & year==miy, lp(dash) lc(blue)) /// if x>-2 & c<.6, by(iso, imargin(zero) legend(off) )