/** Append Bell & Miller cohort life tables, then calculate 2-year mortality probability by birth cohort for the relevant years of simulation */ global scen : env SCEN foreach yr in 1910 1920 1930 1940 1950 { local bellmillertabs `bellmillertabs' BellMiller2005_lifetables/BellMiller2005_cohort_lifetable_byr`yr'.dta } append using `bellmillertabs', gen(src) gen birthcohort = 1900 + 10 * src tab birthcohort gen year = birthcohort + age sort male birthcohort year drop if age < 55 | age > 99 gen pdied2yr_bm = 1 - (1 - qx[_n-1])*(1 - qx) if mod(year, 2)==0 & age > 55 * drop odd years for merging with FEM results drop if mod(year,2)==1 * keep only simulate years drop if year < 2004 keep male year age pdied2yr_bm rename age agegrp merge 1:1 male year age using data/${scen}_cdc_mortbyage.dta, gen(_mergenew) keep if _mergenew==3 drop _mergenew gen mortprobdiff = pdied2yr_bm - pdied2yr_cdc gen series = "Bell & Miller vs. CDC" keep male age year mortprobdiff series append using data/${scen}_cdc_mortbyage.dta, gen(src) replace mortprobdiff = pdied2yr - pdied2yr_cdc if src==1 replace series = "FEM vs. CDC" if src==1 keep male age year mortprobdiff series save data/${scen}_cdc_bellmiller_mortprobdiff.dta, replace