Files
Dss/Chililabdata/code/GenLongDeath.do
admin 8c43da1d1c Uloading
Uloading
2025-08-02 05:26:16 +07:00

18 lines
498 B
Plaintext

clear
cd e:\chililabdata\data
use death
gen socialgpid = substr(observeid,1,9)
replace dth_date=dth_date/86400000
format dth_date %td
gen year = year( dth_date)
gen h = halfyear(dth_date)
gen round = yh(year,h)-89
tostring round, generate(rounds)
replace rounds = "0" + rounds if strlen(rounds) ==1
gen socialkey = socialgpid+ rounds
gen individkey = individid+ rounds
drop EID h eventid observeid year individidGuid
duplicates drop individkey, force
drop if round < 0
save rDeaths, replace