You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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!
128
128
* 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
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.
136
131
if(_rc){
@@ -217,7 +212,7 @@ foreach file of local raw_files {
217
212
// 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
218
213
capture confirm variable household_id
219
214
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)
221
216
ren household_id2 hhid
222
217
replace hhid = household_id if hhid ==""// These would have been households that did not carry over to W2 due to panel attrition
223
218
}
@@ -331,7 +326,7 @@ foreach file of local raw_files {
331
326
// 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
332
327
capture confirm variable household_id
333
328
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)
335
330
ren household_id2 hhid
336
331
replace hhid = household_id if hhid ==""// These would have been households that did not carry over to W2 due to panel attrition
337
332
}
@@ -445,7 +440,7 @@ foreach file of local raw_files {
445
440
// 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
446
441
capture confirm variable household_id
447
442
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)
449
444
ren household_id2 hhid
450
445
replace hhid = household_id if hhid ==""// These would have been households that did not carry over to W2 due to panel attrition
451
446
}
@@ -498,7 +493,7 @@ use "`directory_raw'/`file'", clear
498
493
// 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
499
494
capture confirm variable household_id
500
495
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)
502
497
ren household_id2 hhid
503
498
replace hhid = household_id if hhid ==""// These would have been households that did not carry over to W2 due to panel attrition
0 commit comments