120 likes | 220 Views
Day 11 Methodological Lecture. Migration. Measuring migration. Create a event variable from comparison of unique values of UNIQUE_VILLAGE_ID Make sure to exclude Guosantun 1780 and Aerjishan 1906. Make sure to exclude observations with missing values.
E N D
Day 11Methodological Lecture Migration
Measuring migration • Create a event variable from comparison of unique values of UNIQUE_VILLAGE_ID • Make sure to exclude Guosantun 1780 and Aerjishan 1906. • Make sure to exclude observations with missing values. • Some location names in the data were originally administrative units ( annotated with suoshugetun) and have been converted to missing. • Because of problems in the original data, some people appear to move somewhere, then move back in the next register. • Need to address those in creation of a variable.
Creating a variable for village moves use "C:\Users\Cameron Campbe\Documents\Baqi\CMGPD-LN from ICPSR\ICPSR_27063\DS0001\27063-0001-Data.dta", clear merge 1:1 RECORD_NUMBER using "C:\Users\Cameron Campbe\Documents\Baqi\CMGPD-LN from ICPSR\ICPSR_27063\DS0003\27063-0003-Data.dta" drop if (DATASET == 10 & YEAR == 1780) | (DATASET == 25 & YEAR == 1906) drop if UNIQUE_VILLAGE_ID == -99 bysort PERSON_ID (YEAR): generate at_risk_move = PRESENT == 1 & _n < _N & YEAR[_n+1] == YEAR+3 bysort PERSON_ID (YEAR): generate next_move = (UNIQUE_VILLAGE_ID[_n+1] != UNIQUE_VILLAGE_ID) & at_risk_move bysort PERSON_ID (YEAR): generate move_back = next_move & UNIQUE_VILLAGE_ID[_n+2] == UNIQUE_VILLAGE_ID & _n+2 <= _N tab move_back if next_move bysort PERSON_ID (YEAR): replace move_back = 1 if next_move & _n < _N & UNIQUE_VILLAGE_ID[_n-1]==UNIQUE_VILLAGE_ID[_n+1] & UNIQUE_VILLAGE_ID != UNIQUE_VILLAGE_ID[_n+1] tab move_back if next_move replace next_move = next_move & (move_back == 0)
. bysort PERSON_ID (YEAR): generate move_back = next_move & UNIQUE_VILLAGE_ID[_n+2] == UNIQUE_VILLAGE > _ID & _n+2 <= _N . tab move_back if next_move move_back | Freq. Percent Cum. ------------+----------------------------------- 0 | 14,802 88.79 88.79 1 | 1,869 11.21 100.00 ------------+----------------------------------- Total | 16,671 100.00 . bysort PERSON_ID (YEAR): replace move_back = 1 if next_move & _n < _N & UNIQUE_VILLAGE_ID[_n-1]==UN > IQUE_VILLAGE_ID[_n+1] & UNIQUE_VILLAGE_ID != UNIQUE_VILLAGE_ID[_n+1] (2773 real changes made) . tab move_back if next_move move_back | Freq. Percent Cum. ------------+----------------------------------- 0 | 12,029 72.16 72.16 1 | 4,642 27.84 100.00 ------------+----------------------------------- Total | 16,671 100.00 . replace next_move = next_move & (move_back == 0) (4642 real changes made)
keep if at_risk_move bysort YEAR: egenmean_next_move = mean(next_move) bysort YEAR: generate first_in_year = _n == 1 twoway bar mean_next_move YEAR if first_in_year & YEAR >= 1789, scheme(s1mono) xtitle("Year") ytitle("Prop. individuals changing village in next 3 years") /* Note that this is picking up if anyone in the household moves in the next 3 years */ bysort YEAR HOUSEHOLD_ID: egenhh_next_move = max(next_move) bysort YEAR HOUSEHOLD_ID: keep if _n == 1 bysort YEAR: egenmean_hh_next_move = mean(hh_next_move) bysort YEAR: replace first_in_year = _n == 1 twoway bar mean_hh_next_move YEAR if first_in_year & YEAR >= 1789, scheme(s1mono) xtitle("Year") ytitle("Prop. households changing village in next 3 years")
Illegal departure (tao) • ABSCONDED • Indicates that a male is currently annotated in the register as tao. • Never annotated for females. • EVER_ABSCONDED • Indicates that a male at some point in his life was annotated as tao, even if it wasn’t in this register. • May be used to exclude observations in mortality analysis, since recording of men ever identified as tao seems poor.
use "C:\Users\Cameron Campbe\Documents\Baqi\CMGPD-LN from ICPSR\ICPSR_27063\DS0001\27063-0001-Data.dta", clear merge 1:1 RECORD_NUMBER using "C:\Users\Cameron Campbe\Documents\Baqi\CMGPD-LN from ICPSR\ICPSR_27063\DS0003\27063-0003-Data.dta" generate at_risk_tao = ABSCONDED == 0 & PRESENT == 1 & NEXT_3 == 1 bysort PERSON_ID (YEAR): generate next_tao = at_risk_tao & _n < _N & ABSCONDED[_n+1] == 1 keep if at_risk_tao bysort YEAR: egenmean_next_tao = mean(next_tao) bysort YEAR: generate first_in_year = _n == 1 twoway bar mean_next_tao YEAR if first_in_year, scheme(s1mono) ytitle("Proportion of men absconding in next 3 years")