Skip to content

Commit aed836e

Browse files
UGA Consumption Fix (#586)
* Corrected a mistaken internal raw data name change * Updated data for waves 3-7 to versions released August 2025. --------- Co-authored-by: Amelia Ball <aball12@uw.edu>
1 parent 3d246cc commit aed836e

File tree

6 files changed

+24
-30
lines changed

6 files changed

+24
-30
lines changed

Uganda UNPS/Uganda UNPS Wave 1/EPAR_UW_Uganda_UNPS_W1.do

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3874,7 +3874,7 @@ ren nrrexp total_cons
38743874
*ren cpexp30 total_cons
38753875
ren equiv_m adulteq
38763876
ren welfare peraeq_cons
3877-
ren hhid HHID
3877+
rename hhid HHID
38783878
tostring HHID, format(%18.0f) replace
38793879
merge 1:1 HHID using "${Uganda_NPS_W1_created_data}/Uganda_NPS_W1_weights.dta", nogen keep(1 3) // all merges
38803880

@@ -3890,8 +3890,9 @@ keep HHID total_cons peraeq_cons percapita_cons daily_peraeq_cons daily_percap_c
38903890
save "${Uganda_NPS_W1_created_data}/Uganda_NPS_W1_consumption.dta", replace
38913891

38923892
**We create an adulteq dataset for summary statistics sections
3893-
use "${Uganda_NPS_W1_raw_data}/UNPS 2009-10 Consumption Aggregate.dta", clear
3893+
use "${Uganda_NPS_W1_raw_data}/pov2009_10", clear
38943894
rename equiv adulteq
3895+
rename hhid HHID
38953896
keep HHID adulteq
38963897
tostring HHID, format(%18.0f) replace
38973898
save "${Uganda_NPS_W1_created_data}/Uganda_NPS_W1_hh_adulteq.dta", replace
@@ -3906,11 +3907,13 @@ rename h15bq5 fd_home
39063907
rename h15bq7 fd_awayhome
39073908
rename h15bq9 fd_ownp
39083909
rename h15bq11 fd_gift
3910+
rename HHID hhid
39093911
egen food_total = rowtotal(fd*)
3910-
collapse (sum) fd* food_total, by(HHID)
3911-
duplicates report HHID
3912-
merge 1:1 HHID using "${Uganda_NPS_W1_raw_data}/UNPS 2009-10 Consumption Aggregate.dta", nogen keep(1 3)
3913-
tostring HHID, format(%18.0f) replace
3912+
collapse (sum) fd* food_total, by(hhid)
3913+
duplicates report hhid
3914+
merge 1:1 hhid using "${Uganda_NPS_W1_raw_data}/pov2009_10.dta", nogen keep(1 3)
3915+
tostring hhid, format(%18.0f) replace
3916+
rename hhid HHID
39143917
merge 1:1 HHID using "${Uganda_NPS_W1_created_data}/Uganda_NPS_W1_weights.dta", nogen keep(1 3)
39153918
drop if equiv ==.
39163919
recode fd* food_total (0=.)

Uganda UNPS/Uganda UNPS Wave 2/EPAR_UW_Uganda_UNPS_W2.do

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ set maxvar 8000
148148
// set directories
149149
* These paths correspond to the folders where the raw data files are located
150150
* and where the created data and final data will be stored.
151-
global directory "../.."
151+
global directory "../.."
152152
global Uganda_NPS_W2_raw_data "$directory/Uganda UNPS/Uganda UNPS Wave 2/Raw DTA Files"
153153
global Uganda_NPS_W2_created_data "$directory/Uganda UNPS/Uganda UNPS Wave 2/Final DTA Files/created_data"
154154
global Uganda_NPS_W2_final_data "$directory/Uganda UNPS/Uganda UNPS Wave 2/Final DTA Files/final_data"
@@ -3827,15 +3827,15 @@ save "${Uganda_NPS_W2_created_data}/Uganda_NPS_W2_shannon_diversity_index.dta",
38273827
********************************************************************************
38283828
* CONSUMPTION *
38293829
********************************************************************************
3830-
use "${Uganda_NPS_W2_raw_data}/UNPS 2011-12 Consumption Aggregate.dta", clear
3830+
use "${Uganda_NPS_W2_raw_data}/pov2010_11.dta", clear
38313831
*gen nrrexp = cpexp30 * (100.000000 / 66.67894615) // (CPI 2010&11 / CPI 2005&06) 2010/2005
38323832
gen nrrexp = cpexp30 * (116.5643496 / 71.55362795) // (CPI 2010&11 / CPI 2005&06) 2011/2006
38333833
ren nrrexp total_cons
38343834
*ren cpexp30 total_cons
38353835
ren equiv adulteq
38363836
ren welfare peraeq_cons
3837-
ren HHID hhid
3838-
tostring hhid, format(%18.0f) replace
3837+
ren hh hhid
3838+
tostring hhid district, format(%18.0f) replace
38393839
merge 1:1 hhid using "${Uganda_NPS_W2_created_data}/Uganda_NPS_W2_hhsize.dta", nogen keep(1 3)
38403840
gen percapita_cons = (total_cons / hh_members)
38413841
gen daily_peraeq_cons = peraeq_cons/30
@@ -3846,13 +3846,13 @@ lab var percapita_cons "Consumption per capita, in 05/06 prices, spatially and t
38463846
lab var daily_peraeq_cons "Daily consumption per adult equivalent, in 05/06 prices, spatially and temporally adjusted in 11/12"
38473847
lab var daily_percap_cons "Daily consumption per capita, in 05/06 prices, spatially and temporally adjusted in 11/12"
38483848

3849-
keep hhid total_cons peraeq_cons percapita_cons daily_peraeq_cons daily_percap_cons adulteq
3849+
keep hhid poor total_cons peraeq_cons percapita_cons daily_peraeq_cons daily_percap_cons adulteq
38503850
save "${Uganda_NPS_W2_created_data}/Uganda_NPS_W2_consumption.dta", replace
38513851

38523852
**We create an adulteq dataset for summary statistics sections
3853-
use "${Uganda_NPS_W2_raw_data}/UNPS 2011-12 Consumption Aggregate.dta", clear
3853+
use "${Uganda_NPS_W2_raw_data}/pov2010_11", clear
38543854
rename equiv adulteq
3855-
rename HHID hhid
3855+
rename hh hhid
38563856
keep hhid adulteq
38573857
tostring hhid, format(%18.0f) replace
38583858
save "${Uganda_NPS_W2_created_data}/Uganda_NPS_W2_hh_adulteq.dta", replace
@@ -3862,18 +3862,15 @@ save "${Uganda_NPS_W2_created_data}/Uganda_NPS_W2_hh_adulteq.dta", replace
38623862
********************************************************************************
38633863

38643864
use "${Uganda_NPS_W2_raw_data}/GSEC15B", clear
3865-
rename hh HHID
38663865
rename h15bq5 fd_home
38673866
rename h15bq7 fd_awayhome
38683867
rename h15bq9 fd_ownp
38693868
rename h15bq11 fd_gift
38703869
egen food_total = rowtotal(fd*)
3871-
collapse (sum) fd* food_total, by(HHID)
3872-
duplicates report HHID
3873-
tostring HHID, format(%18.0f) replace
3874-
merge 1:1 HHID using "${Uganda_NPS_W2_raw_data}/UNPS 2011-12 Consumption Aggregate.dta", nogen keep(1 3)
3875-
ren HHID hhid
3876-
tostring hhid, format(%18.0f) replace
3870+
collapse (sum) fd* food_total, by(hh)
3871+
merge 1:1 hh using "${Uganda_NPS_W2_raw_data}/pov2010_11.dta", nogen keep(1 3)
3872+
ren hh hhid
3873+
tostring hhid district, format(%18.0f) replace
38773874
merge 1:1 hhid using "${Uganda_NPS_W2_created_data}/Uganda_NPS_W2_hhsize.dta", nogen keep(1 3)
38783875
drop if equiv ==.
38793876
recode fd* food_total (0=.)
@@ -4891,13 +4888,7 @@ la var poverty_under_215 "Household per-capita consumption is below $2.15 in 201
48914888
gen poverty_under_300 = (daily_percap_cons < $Uganda_NPS_W2_poverty_300)
48924889
la var poverty_under_300 "Household per-capita consumption is below $3.00 in 2021 $ PPP"
48934890

4894-
rename hhid HHID
4895-
*We merge the national poverty line provided by the World bank
4896-
tostring HHID, format(%18.0f) replace
4897-
merge 1:1 HHID using "${Uganda_NPS_W2_raw_data}/UNPS 2011-12 Consumption Aggregate.dta", keep(1 3) nogen
4898-
*gen poverty_under_npl = daily_percap_cons < $Nigeria_GHS_W1_poverty_nbs
48994891
rename poor poverty_under_npl
4900-
rename HHID hhid
49014892
la var poverty_under_npl "Household per-capita consumption is below national poverty line in 05/06 PPP prices"
49024893

49034894
*generating clusterid and strataid

Uganda UNPS/Uganda UNPS Wave 3/EPAR_UW_Uganda_UNPS_W3.do

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
*Date : September 5th, 2025
88
9-
*Dataset Version: UGA_2011_UNPS_v03_M
9+
*Dataset Version: UGA_2011_UNPS_v02_M
1010
--------------------------------------------------------------------------------------*/
1111

1212

Uganda UNPS/Uganda UNPS Wave 4/EPAR_UW_Uganda_UNPS_W4.do

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
*Date : September 5th, 2025
88
9-
*Dataset Version: UGA_2013_UNPS_v03_M
9+
*Dataset Version: UGA_2013_UNPS_v02_M
1010
--------------------------------------------------------------------------------------*/
1111

1212

Uganda UNPS/Uganda UNPS Wave 5/EPAR_UW_Uganda_UNPS_W5.do

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
*Date : September 5th, 2025
99
10-
*Dataset Version: UGA_2015_UNPS_v03_M
10+
*Dataset Version: UGA_2015_UNPS_v02_M
1111
--------------------------------------------------------------------------------------
1212
*/
1313

Uganda UNPS/Uganda UNPS Wave 7/EPAR_UW_Uganda_UNPS_W7.do

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
*Date : September 5th, 2025
88
9-
*Dataset Version: UGA_2018_UNPS_v03_M
9+
*Dataset Version: UGA_2018_UNPS_v02_M
1010
--------------------------------------------------------------------------------------*/
1111

1212

0 commit comments

Comments
 (0)