Uloading
Uloading
This commit is contained in:
24
Chililabdata/GenLongDeath.do
Normal file
24
Chililabdata/GenLongDeath.do
Normal file
@@ -0,0 +1,24 @@
|
||||
clear
|
||||
cd e:\chililabdata\data
|
||||
use observation
|
||||
sort observeid
|
||||
save, replace
|
||||
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 rounds eventid year individidGuid
|
||||
duplicates drop individkey, force
|
||||
sort observeid
|
||||
merge m:1 observeid using observation, keepusing(locationid)
|
||||
keep if _merge ==3
|
||||
drop observeid _merge
|
||||
drop if round < 0
|
||||
save rDeaths, replace
|
Reference in New Issue
Block a user