Hi all, I saw this code somewhere trying to carryforward the ID and ID names after applying tsfill. But I don't understand why they create a years_reverse and carry forward by years_reverse. What does this mean?
Code:
tsset ID_adm2_num year
tsfill, full
*//fill out data gaps
gen years_reverse =-year
*// carryforward, countryname etc
bysort ID_adm2_num (year): carryforward ID_adm* name* iso3c ID_* id* , replace
bysort ID_adm2_num (years_reverse): carryforward ID_adm* ID_adm2 name* iso3c ID_*, replace

Comment