Code:
use "Dataset.dta", replace
drop if 5*365>dis_end
tempfile A0
save `A0'
// Panel a
use `A0',clear
keep if 5*365<=dis_end
forvalue dfe = 1/5 { //
g c_`dfe' = ned>`dfe'*365/2 if !mi(ned)
replace c_`dfe' = 1 if mi(ned)
}
keep c_*
collapse (mean) c_*
duplicates drop
g n =1
reshape long c_, i(n) j(week)
drop n
replace week = week/2
g cd_ = int(c_*1000)/1000
twoway ///
(line c_ week, lc(black) lp(dash)) ///
(line c2 week, lc(black) lp(dash) ) ///
(connect c_ week, lcolor(black) mcolor(black) msize(vsmall)) ///
(scatter c_ week if int(week)==week, mcolor(black) msize(vsmall) mlabel(cd_) mlabang(90)) ///
, leg(off) ytitle("Survival rate") xtitle("Years since layoff") ///
xline(30 39, lp(dash) lcolor(gs10)) yline(0, lcolor(gs10))
graphregion(fcolor(white)) xl(1(1)5, grid) ylabel(0(.03).2, grid) ///
subtitle("Survival Rate (Prob. of Remaining Unemployed)", size(m)) ///
subt("Panel a") xtitle("Weeks since layoff")
keep c_ week
rename c_ survlevel
merge 1:1 week using `A1', nogen
tempfile A1
save `A1', replace
No comments:
Post a Comment