Skip to content

Commit 89601ad

Browse files
committed
Finishing ETH reorganization for hhid panel key.
1 parent ae54297 commit 89601ad

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

Ethiopia ESS/Ethiopia ESS Wave 1/EPAR_UW_Ethiopia_ESS_W1.do

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ save "${Ethiopia_ESS_W1_created_data}/Ethiopia_ESS_W1_cropname_table.dta", repla
126126
********************************************************************************
127127
* UNIQUELY IDENTIFIABLE GEOGRAPHIES AND PLOTS - note that without this code, collapsing by [zone, woreda, kebele, ea] using raw data (as we do to get median prices) will result in inaccurate medians. We need to create unique identifiers to collapse on!
128128
* UNIQUELY IDENTIFIABLE PARCELS AND FIELDS AT THE HOUSEHOLD LEVEL (for AqQuery+)
129-
130-
* STEPS:
131-
* Create a "temp_data" folder in the "Final DTA Files" folder, similar to "created_data" and "final_data"
132-
* Create a Global for temp_data (e.g. global Ethiopia_ESS_W5_temp_data "$directory/Ethiopia ESS/Ethiopia ESS Wave 1/Final DTA Files/temp_data")
133-
* Insert hhid_panel_key.dta in the "temp_data" folder
134129
********************************************************************************
135130
capture confirm file "$Ethiopia_ESS_W1_temp_data/sect_cover_hh_w1.dta" //Simple check for an output file; this block only needed one time, so code will only run the code if it's missing from the temp_data folder. Delete it to make the code re-run.
136131
if(_rc){
@@ -217,7 +212,7 @@ foreach file of local raw_files {
217212
// HHID - using household_id2 from W2 - note that these are more data rich as they contain city and subcity codes and this allows us to track panel households over the first three waves
218213
capture confirm variable household_id
219214
if(!_rc) {
220-
merge m:1 household_id using "`directory_temp'/hhid_panel_key.dta", keep(1 3) nogen // Note that this file does not exist in the WB W1 download. EPAR created it to track panel households in the first three waves. After downloading from GitHub, add to the temp folder.(see directory globals above)
215+
merge m:1 household_id using "$directory/Ethiopia ESS/Panel Key/hhid_panel_key.dta", keep(1 3) nogen // Note that this file does not exist in the WB W1 download. EPAR created it to track panel households in the first three waves. After downloading from GitHub, add to the temp folder.(see directory globals above)
221216
ren household_id2 hhid
222217
replace hhid = household_id if hhid == "" // These would have been households that did not carry over to W2 due to panel attrition
223218
}
@@ -331,7 +326,7 @@ foreach file of local raw_files {
331326
// HHID - using household_id2 from W2 - note that these are more data rich as they contain city and subcity codes and this allows us to track panel households over the first three waves
332327
capture confirm variable household_id
333328
if(!_rc) {
334-
merge m:1 household_id using "`directory_temp'/hhid_panel_key.dta", keep(1 3) nogen // Note that this file does not exist in the WB W1 download. EPAR created it to track panel households in the first three waves. After downloading from GitHub, add to the temp folder.(see directory globals above)
329+
merge m:1 household_id using "$directory/Ethiopia ESS/Panel Key/hhid_panel_key.dta", keep(1 3) nogen // Note that this file does not exist in the WB W1 download. EPAR created it to track panel households in the first three waves. After downloading from GitHub, add to the temp folder.(see directory globals above)
335330
ren household_id2 hhid
336331
replace hhid = household_id if hhid == "" // These would have been households that did not carry over to W2 due to panel attrition
337332
}
@@ -445,7 +440,7 @@ foreach file of local raw_files {
445440
// HHID - using household_id2 from W2 - note that these are more data rich as they contain city and subcity codes and this allows us to track panel households over the first three waves
446441
capture confirm variable household_id
447442
if(!_rc) {
448-
merge m:1 household_id using "`directory_temp'/hhid_panel_key.dta", keep(1 3) nogen // Note that this file does not exist in the WB W1 download. EPAR created it to track panel households in the first three waves. After downloading from GitHub, add to the temp folder.(see directory globals above)
443+
merge m:1 household_id using "$directory/Ethiopia ESS/Panel Key/hhid_panel_key.dta", keep(1 3) nogen // Note that this file does not exist in the WB W1 download. EPAR created it to track panel households in the first three waves. After downloading from GitHub, add to the temp folder.(see directory globals above)
449444
ren household_id2 hhid
450445
replace hhid = household_id if hhid == "" // These would have been households that did not carry over to W2 due to panel attrition
451446
}
@@ -498,7 +493,7 @@ use "`directory_raw'/`file'", clear
498493
// HHID - using household_id2 from W2 - note that these are more data rich as they contain city and subcity codes and this allows us to track panel households over the first three waves
499494
capture confirm variable household_id
500495
if(!_rc) {
501-
merge m:1 household_id using "`directory_temp'/hhid_panel_key.dta", keep(1 3) nogen // Note that this file does not exist in the WB W1 download. EPAR created it to track panel households in the first three waves. After downloading from GitHub, add to the temp folder.(see directory globals above)
496+
merge m:1 household_id using "$directory/Ethiopia ESS/Panel Key/hhid_panel_key.dta", keep(1 3) nogen // Note that this file does not exist in the WB W1 download. EPAR created it to track panel households in the first three waves. After downloading from GitHub, add to the temp folder.(see directory globals above)
502497
ren household_id2 hhid
503498
replace hhid = household_id if hhid == "" // These would have been households that did not carry over to W2 due to panel attrition
504499
}
Binary file not shown.
Binary file not shown.

Ethiopia ESS/Ethiopia ESS Wave 3/EPAR_UW_Ethiopia_ESS_W3.do

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ foreach file of local raw_files {
480480
}
481481

482482
* LOCAL AREA UNIT CONVERSION
483-
use "${Ethiopia_ESS_W3_temp_data}\ET_local_area_unit_conversion.dta", clear
483+
use "${Ethiopia_ESS_W3_raw_data}\ET_local_area_unit_conversion.dta", clear
484484
// ZONE
485485
capture confirm variable zone
486486
if(!_rc) {
Binary file not shown.

Ethiopia ESS/Panel Key/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Panel Key
2+
3+
This file is used to harmonize household IDs in Wave 1 with later waves for easier panel merges

0 commit comments

Comments
 (0)