*********************************************************************************************************************** ** Human Development Report Office (HDRO), United Nations Development Programme ** Multidimensional Poverty Index 2024 release ** Methodology developed in partnership with the Oxford Poverty and Human Development Initiative, University of Oxford ************************************************************************************************************************ clear all set more off set maxvar 10000 set mem 500m cap log close *** Working Folder Path *** global path_in "C:\UNDP\MPI\MPI_Computation\MPI_2024\National\Bhutan_2022\StataDatasets" global path_out "C:\UNDP\MPI\MPI_Computation\MPI_2024\National\Bhutan_2022\Output" global path_logs "C:\UNDP\MPI\MPI_Computation\MPI_2024\National\Bhutan_2022" global path_qc "C:\UNDP\MPI\MPI_Computation\MPI_2024\National\Bhutan_2022" global path_ado "C:" *** Log file *** log using "$path_logs/Bhutan_BLSS2022dataprep.log", replace ******************************************************************************** *** Bhutan BLSS 2022 *** ******************************************************************************** ******************************************************************************** *** Step 1: Data preparation ******************************************************************************** ******************************************************************************** *** Step 1.1 KR - CHILDREN's RECODE (under 5) ******************************************************************************** *No nutrition data available for under-five children. ******************************************************************************** *** Step 1.2 Fertility information ******************************************************************************** use "$path_in/block1_health_cleaned.dta", clear des interview__id hhroster__id gen hh_id=interview__id gen ind_id=hhroster__id duplicates report hh_id ind_id //52822 total samples des f1 f2 f3_male f3_female m_living f_living f5 f6_male f6_female sum age if f1!=. tab sex if f1 //Fertility info collected from thw women aged 15-49 aged group. keep hh_id ind_id f1 f2 f3_male f3_female m_living f_living f5 f6_male f6_female save "$path_out/Bhutan22_BR.dta", replace ******************************************************************************** *** Step 1.3 HH-Household RECODE ***(All households interviewed) ******************************************************************************** use "$path_in/block2_puf.dta", clear des interview__id gen hh_id=interview__id sort hh_id duplicates report hh_id //13340 households in the dataset. save "$path_out/Bhutan22_HH.dta", replace ******************************************************************************** *** Step 1.3 HH Assets-Assets RECODE ******************************************************************************** use "$path_in/block3_puf.dta", clear des interview__id gen hh_id=interview__id sort hh_id duplicates report hh_id //13340 households in the dataset. save "$path_out/Bhutan22_Assets.dta", replace ******************************************************************************** *** Step 1.4 HL - HOUSEHOLD MEMBER ******************************************************************************** use "$path_in/block1_puf.dta", clear gen year = "2022" gen survey = "BLSS" gen country = "Bhutan" gen countrycode = "BTN" gen hh_id=interview__id gen ind_id=hhroster__id duplicates report hh_id ind_id //52822 samples in the dataset. ******************************************************************************** *** 1.5 DATA MERGING ******************************************************************************** *** Merging BR Recode ***************************************** merge 1:1 hh_id ind_id using "$path_out/Bhutan22_BR.dta" drop _merge erase "$path_out/Bhutan22_BR.dta" *** Merging HH Recode ***************************************** merge m:1 hh_id using "$path_out/Bhutan22_HH.dta", force drop _merge erase "$path_out/Bhutan22_HH.dta" *** Merging Assets Recode ***************************************** merge m:1 hh_id using "$path_out/Bhutan22_Assets.dta", force drop _merge erase "$path_out/Bhutan22_Assets.dta" ******************************************************************************** *** 1.6 CONTROL VARIABLES ******************************************************************************** /* Households are identified as having 'no eligible' members if there are no no reproductive aged women 15-49 years. As such, these households are considered as non-deprived in those relevant indicators.*/ *** No Eligible Women 15-49 years ***************************************** count if age>=15 & age<=49 & sex==2 gen fem_eligible= (age>=15 & age<=49 & sex==2) bys hh_id: egen hh_n_fem_eligible = sum(fem_eligible) //Number of eligible women for interview in the hh gen no_fem_eligible = (hh_n_fem_eligible==0) //Takes value 1 if the household had no eligible females for an interview lab var no_fem_eligible "Household has no eligible women" tab no_fem_eligible, miss sort hh_id ind_id ******************************************************************************** *** 1.11 SUBSAMPLE VARIABLE *** ******************************************************************************** ******************************************************************************** *** 1.12 RENAMING DEMOGRAPHIC VARIABLES *** ******************************************************************************** //Sample weight lookfor weight desc weights clonevar weight = weights label var weight "Sample weight" //Area: urban or rural lookfor area codebook area, tab (5) replace area=0 if area==2 label define lab_area 1 "urban" 0 "rural", modify label values area lab_area label var area "Area: urban-rural" //Relationship to the head of household lookfor relationship clonevar relationship = d2 codebook relationship, tab (99) recode relationship (1=1)(2=2)(3/4=3)(5/22=4)(23/28=3) (29/31=4)(32=6) (33=5)(96=.) label define lab_rel 1"head" 2"spouse" 3"child" 4"extended family" /// 5"not related" 6"maid", modify label values relationship lab_rel label var relationship "Relationship to the head of household" tab d2 relationship, miss //Sex of household member codebook sex, tab (10) // 1: Male & 2:Female label var sex "Sex of household member" //Age of household member lookfor age codebook age, tab (1000) label var age "Age of household member" //Age group recode age (0/4 = 1 "0-4")(5/9 = 2 "5-9")(10/14 = 3 "10-14") /// (15/17 = 4 "15-17")(18/59 = 5 "18-59")(60/max=6 "60+"), gen(agec7) lab var agec7 "age groups (7 groups)" recode age (0/9 = 1 "0-9") (10/17 = 2 "10-17")(18/59 = 3 "18-59") /// (60/max=4 "60+"), gen(agec4) lab var agec4 "age groups (4 groups)" //Marital status of household member clonevar marital = d4 codebook marital, tab (20) recode marital (2=1)(3=2)(6=3) label define lab_mar 1"never married" 2"currently married" /// 3"widowed" 4"divorced" 5"not living together", modify label values marital lab_mar label var marital "Marital status of household member" tab d4 marital, miss //Total number of de jure hh members in the household gen member = 1 bysort hh_id: egen hhsize = sum(member) label var hhsize "Household size" tab hhsize, miss drop member //Subnational region lookfor region tab dcode codebook dcode, tab (100) clonevar region = dcode lab var region "Region for subnational decomposition" tab dcode region, miss ******************************************************************************** *** Step 2 Data preparation *** *** Standardization of the 10 Global MPI indicators *** Identification of non-deprived & deprived individuals ******************************************************************************** ******************************************************************************** *** Step 2.1 Years of Schooling *** ******************************************************************************** ** official entrance age = 5 yrs ** duration of primary = 7 yrs codebook ed2 ed3 ed11, tab(99) gen eduyears=ed3 //currently attending individuals replace eduyears=0 if ed3==19 // ECCD or Day care coded as zero school years. replace eduyears=ed11 if eduyears==. //attended in the past replace eduyears=0 if ed11==19 // ECCD or Day care coded as zero school years. replace eduyears=0 if ed2==4 //never attended school *total number of years of education tab eduyears ed2,m replace eduyears = . if eduyears>30 *recode any unreasonable years of highest education as missing value list age eduyears if eduyears>=age & age>0 & eduyears!=. //12 individuals eduyears>=age replace eduyears = . if eduyears>=age & age>0 & eduyears!=. replace eduyears = 0 if age < 10 replace eduyears = 0 if (age==10 ) & eduyears < 6 /*The variable "eduyears" was replaced with a '0' given that the criteria for this indicator is household member aged 11 years or older (primary entrace age= 5 years+ 6 years of schooling) */ /*A control variable is created on whether there is information on years of education for at least 2/3 of the household members. */ gen temp = 1 if (eduyears!=. & (age>=11 & age!=.)) | (((age==10) & eduyears>=6 & eduyears<.)) bysort hh_id: egen no_missing_edu = sum(temp) /*Total household members who are 12 years and older with no missing years of education but recognizing as an achievement if the member is 10 or 11 and already completed 6 yrs of schooling */ gen temp2 = 1 if (age>=11 & age!=.) | (((age==10) & eduyears>=6 & eduyears<.)) bysort hh_id: egen hhs = sum(temp2) //Total number of household members who are 13 years and older replace no_missing_edu = no_missing_edu/hhs replace no_missing_edu = (no_missing_edu>=2/3) /*Identify whether there is information on years of education for at least 2/3 of the household members aged 13 years and older */ tab no_missing_edu, miss label var no_missing_edu "No missing edu for at least 2/3 of the HH members aged 12 years & older" drop temp temp2 hhs /*The entire household is considered deprived if no household member aged 12 years or older has completed SIX years of schooling. */ gen years_edu6 = (eduyears>=6) /* The years of schooling indicator takes a value of "1" if at least someone in the hh has reported 6 years of education or more */ replace years_edu6 = . if eduyears==. bysort hh_id: egen hh_years_edu6_1 = max(years_edu6) gen hh_years_edu6 = (hh_years_edu6_1==1) replace hh_years_edu6 = . if hh_years_edu6_1==. replace hh_years_edu6 = . if hh_years_edu6==0 & no_missing_edu==0 lab var hh_years_edu6 "Household has at least one member with 6 years of edu" tab hh_years_edu6, m ******************************************************************************** *** Step 2.2 Child School Attendance *** ******************************************************************************** codebook ed2 ed3, tab(99) gen attendance=1 if ed2==1 replace attendance=0 if ed2==2| ed2==3 | ed2==4 tab attendance, m tab attendance ed2, m *** New Standard MPI *** ******************************************************************* /* Note: The school entrance age for primary level education changed from 6 years to 5 years in 2021. We use 6 year as the school entrance age for gMPI computation since for the BLSS 2022, NSB used 6 years as the primary school extrance age. In addtion, the data also indicate that the large majority of the five-year olds are still attending pre-primary rather than primary grade.*/ ta ed3 if age==5,m /*The entire household is considered deprived if any school-aged child is not attending school up to class 8. */ gen child_schoolage = (age>=6 & age<=14) /* Note: In Bhutan, the official school entrance age is 5 years. So, age range is 5-13 (5+8) Source: http://data.uis.unesco.org*/ /*A control variable is created on whether there is no information on school attendance for at least 2/3 of the school age children */ count if child_schoolage==1 & attendance==. //Understand how many eligible school aged children are not attending school gen temp = 1 if child_schoolage==1 & attendance!=. /*Generate a variable that captures the number of eligible school aged children who are attending school */ bysort hh_id: egen no_missing_atten = sum(temp) /*Total school age children with no missing information on school attendance */ gen temp2 = 1 if child_schoolage==1 bysort hh_id: egen hhs = sum(temp2) //Total number of household members who are of school age replace no_missing_atten = no_missing_atten/hhs replace no_missing_atten = (no_missing_atten>=2/3) /*Identify whether there is missing information on school attendance for more than 2/3 of the school age children */ tab no_missing_atten, miss label var no_missing_atten "No missing school attendance for at least 2/3 of the school aged children" drop temp temp2 hhs bysort hh_id: egen hh_children_schoolage = sum(child_schoolage) replace hh_children_schoolage = (hh_children_schoolage>0) //Control variable: //It takes value 1 if the household has children in school age lab var hh_children_schoolage "Household has children in school age" gen child_not_atten = (attendance==0) if child_schoolage==1 replace child_not_atten = . if attendance==. & child_schoolage==1 bysort hh_id: egen any_child_not_atten = max(child_not_atten) gen hh_child_atten = (any_child_not_atten==0) replace hh_child_atten = . if any_child_not_atten==. replace hh_child_atten = 1 if hh_children_schoolage==0 replace hh_child_atten = . if hh_child_atten==1 & no_missing_atten==0 /*If the household has been intially identified as non-deprived, but has missing school attendance for at least 2/3 of the school aged children, then we replace this household with a value of '.' because there is insufficient information to conclusively conclude that the household is not deprived */ lab var hh_child_atten "Household has all school age children up to class 8 in school" tab hh_child_atten, miss /*Note: The indicator takes value 1 if ALL children in school age are attending school and 0 if there is at least one child not attending. Households with no children receive a value of 1 as non-deprived. The indicator has a missing value only when there are all missing values on children attendance in households that have children in school age. */ ******************************************************************************** *** Step 2.3 Nutrition *** ******************************************************************************** *No nutrition indicator ******************************************************************************** *** Step 2.4 Child Mortality *** ******************************************************************************** /*Bhutan BLSS 2022 survey collected the fertility information from the women aged 15-49 years, but the dataset lacked the timing of the death. So, we proceed with preparing child mortality indicator based on death occuring at any time and at any age.*/ codebook f1 f3_male f3_female m_living f_living //f3_male and f3_female (number of male and female children born) //m_living and f_living (number of male and female chidren living) //Generating total child death as reported by women egen total_birth=rowtotal(f3_male f3_female) if f1==1 egen total_alive=rowtotal (m_living f_living) if f1==1 gen total_died=total_birth-total_alive replace total_died=0 if f1==2 //Never given birth coded as zero child death. replace total_died=0 if no_fem_eligible==1 //No female eligible in the household bysort hh_id: egen child_mortality_f = sum(total_died), missing lab var child_mortality_f "Occurrence of child mortality reported by women" tab child_mortality_f, miss /*Deprived if any children died in the household */ ************************************************************************ gen hh_mortality = (child_mortality_f==0) /*Household is replaced with a value of "1" if there is no incidence of child mortality*/ replace hh_mortality = . if child_mortality_f==. lab var hh_mortality "Household had no child mortality" tab hh_mortality, m ******************************************************************************** *** Step 2.5 Electricity *** ******************************************************************************** /*Members of the household are considered deprived if the household has no electricity */ gen electricity = 1 replace electricity=0 if hs27==4 codebook electricity, tab (10) label var electricity "Household has electricity" ******************************************************************************** *** Step 2.6 Sanitation *** ******************************************************************************** /*Members of the household are considered deprived if the household's sanitation facility is not improved, according to MDG guidelines, or it is improved but shared with other household. In cases of mismatch between the MDG guideline and country report, we followed the country report. */ lookfor toilet des hs24 hs25 codebook hs24 hs25, tab(100) recode hs24 (1/3 5 6=1 "yes") (4 7 8=0 "No"), gen(toilet_mdg) replace toilet_mdg=0 if hs25==1 //shared toilet lab var toilet_mdg "Household has improved sanitation with MDG Standards" tab hs24 toilet_mdg, miss /* tab hs24, m type of toilet that is used in | your household | Freq. Percent Cum. -------------------------------+----------------------------------- Flush to piped sewer system | 5,207 9.86 9.86 1 y Flush to septic tank | 43,499 82.35 92.21 2 y Flush to pit latrine | 2,337 4.42 96.63 3 y Flush to open drain/open space | 48 0.09 96.72 4 n Ventilated improved pit | 464 0.88 97.60 5 y Pit latrine with slab | 695 1.32 98.92 6 y Pit latrine without slab | 511 0.97 99.88 7 n No facility/bush/field | 61 0.12 100.00 8 n -------------------------------+----------------------------------- Total | 52,822 100.00 */ */ ******************************************************************************** *** Step 2.7 Drinking Water *** ******************************************************************************** /*Members of the household are considered deprived if the household does not have access to safe drinking water according to MDG guidelines, or safe drinking water is more than a 30-minute walk from home roundtrip. In cases of mismatch between the MDG guideline and country report, we followed the country report.*/ lookfor water codebook hs19 hs20b, tab(99) tab hs19 hs20b, m recode hs19 (1/7 9 = 1 "yes") (8 10 11 12 =0 "no"), gen (water_mdg) //Tanker classified as unimproved source as the country report (pg. 54) replace water_mdg=0 if hs20b>=30 & hs20b<. //Deprived if water is at more than 30 minutes' walk (roundtrip) lab var water_mdg "Household has drinking water with MDG standards (considering distance)" tab water water_mdg, miss /* tab hs19, m main source of drinking water | Freq. Percent Cum. ----------------------------------------+----------------------------------- Piped in dwelling | 27,110 51.32 51.32 1 y Pipe in compound but outside the dwelli | 25,439 48.16 99.48 2 y Public tap/standpipe | 199 0.38 99.86 3 y Protected dug well | 6 0.01 99.87 5 y Protected spring | 27 0.05 99.92 7 y Unprotected spring | 15 0.03 99.95 8 n Rain water collection (covered reservoi | 8 0.02 99.97 9 y Rain water collection (uncovered reserv | 1 0.00 99.97 10 n Tanker truck | 6 0.01 99.98 11 n Surface water (river, stream, dam, lake | 11 0.02 100.00 12 n ----------------------------------------+----------------------------------- Total | 52,822 100.00 */ ******************************************************************************** *** Step 2.8 Housing *** ******************************************************************************** /* Members of the household are considered deprived if the household has a dirt, sand or dung floor */ lookfor floor codebook hs13, tab(99) codebook hs13oth, tab(99) recode hs13 (1/4 6/10 96=1 "yes") (5 =0 "no"), gen (floor_imp) tab hs13 floor_imp lab var floor_imp "Household has floor that it is not earth/sand/dung" tab floor_imp, m tab floor floor_imp, miss /* Members of the household are considered deprived if the household has wall made of natural or rudimentary materials */ lookfor wall codebook hs11, tab(99) recode hs11 (1 3 5 6 10 11 13=1 "yes") (2 4 7/9 12 96=0 "no"), gen (wall_imp) replace wall_imp = 1 if hs11oth=="CJI sheet" | hs11oth=="Cement Slape" | /// hs11oth=="Cement With Wood" | hs11oth=="Cement with thermacol" | /// hs11oth=="cement and wood" | hs11oth=="cement with wood" | /// hs11oth=="plank with cement" lab var wall_imp "Household has wall that it is not of low quality materials" tab wall_imp, m tab hs11 wall_imp, miss /* Members of the household are considered deprived if the household has roof made of natural or rudimentary materials */ lookfor roof codebook hs12, tab (99) recode hs12 (1 6/9 = 1 "yes") (2/5 96 = 0 "no"), gen (roof_imp) /*Deprived if "no roof" "thatch/palm leaf" "mud/earth/lump of earth" "sod/grass" "plastic/polythene sheeting" "rustic mat" "cardboard" "canvas/tent" "wood planks/reused wood" "unburnt bricks" "other"*/ replace roof_imp=1 if hs12oth=="Have metal sheet around like skirt and it is cement in center" tab hs12 roof_imp lab var roof_imp "Household has roof that it is not of low quality materials" tab roof_imp, m tab hs12 roof_imp, miss /*Household is deprived in housing if the roof, floor OR walls uses low quality materials.*/ gen housing_1 = 1 replace housing_1 = 0 if floor_imp==0 | wall_imp==0 | roof_imp==0 replace housing_1 = . if floor_imp==. & wall_imp==. & roof_imp==. lab var housing_1 "Household has roof, floor & walls that it is not low quality material" tab housing_1, miss ******************************************************************************** *** Step 2.9 Cooking Fuel *** ******************************************************************************** /* Members of the household are considered deprived if the household cooks with solid fuels: wood, charcoal, crop residues or dung. "Indicators for Monitoring the Millennium Development Goals", p. 63 */ lookfor cooking codebook hs31__1 hs31__2 hs31__3 hs31__4 hs31__5 hs31__6 hs31__7 hs31__96 hs31Oth tab1 hs31__1 hs31__2 hs31__3 hs31__4 hs31__5 hs31__6 hs31__7 hs31__96 hs31Oth gen cooking_mdg=1 if hs31__1==1 | hs31__2==1 | hs31__5==1 | hs31__7==1 replace cooking_mdg=0 if hs31__3==1 | hs31__4==1 | hs31__6==1 replace cooking_mdg=0 if hs31Oth=="thap" | hs31Oth=="traditional thab" & hs31__96==1 replace cooking_mdg=1 if hs31Oth=="uses from institute Karma Lekshey Ling" tab cooking_mdg,m ******************************************************************************** *** Step 2.10 Assets ownership *** ******************************************************************************** /* Members of the household are considered deprived if the household does not own more than one of: radio, TV, telephone, bike, motorbike or refrigerator and does not own a car or truck. */ //Check that for standard assets in living standards: "no"==0 and yes=="1" lookfor tv television plasma lcd télé tele codebook as1__108 clonevar television = as1__108 lookfor radio walkman stereo stéréo *No radio lookfor telephone téléphone mobilephone ipod telefone tele celular codebook as1__109 as1__110 gen telephone = as1__109 replace telephone=1 if as1__110==1 lookfor refrigerator réfrigérateur refri freezer codebook as1__104 clonevar refrigerator = as1__104 lookfor car van truck codebook as1__121 as1__124 as1__126 clonevar car = as1__121 //Family car replace car=1 if as1__124==1 //Other vehicle replace car=1 if as1__126==1 //tractor lookfor bicycle cycle bicyclette bicicleta codebook as1__123 clonevar bicycle = as1__123 lookfor mbike moto codebook as1__122 clonevar motorbike = as1__122 lookfor computer ordinateur laptop ipad tablet codebook as1__111 clonevar computer = as1__111 lookfor brouette cart carro carreta *No animal cart foreach var in television /*radio*/ telephone /*mobiletelephone*/ refrigerator /// car bicycle motorbike computer /*animal_cart*/ { replace `var' = . if `var'==9 | `var'==99 | `var'==8 | `var'==98 } //9 , 99 and 8, 98 are missing values /* Members of the household are considered deprived in assets if the household does not own more than one of: radio, TV, telephone, bike, motorbike, refrigerator, computer or animal_cart and does not own a car or truck.*/ egen n_small_assets2 = rowtotal(television /*radio*/ telephone refrigerator bicycle motorbike computer /*animal_cart*/), missing lab var n_small_assets2 "Household Number of Small Assets Owned" gen hh_assets2 = (car==1 | n_small_assets2 > 1) replace hh_assets2 = . if car==. & n_small_assets2==. lab var hh_assets2 "Household Asset Ownership: HH has car or more than 1 small assets incl computer & animal cart" ******************************************************************************** *** Step 2.11 Rename and keep variables for MPI calculation ******************************************************************************** gen subsample=1 *** Rename key global MPI indicators for estimation *** recode hh_mortality (0=1)(1=0) , gen(d_cm) *recode hh_nutrition_uw_st (0=1)(1=0) , gen(d_nutr) recode hh_child_atten (0=1)(1=0) , gen(d_satt) recode hh_years_edu6 (0=1)(1=0) , gen(d_educ) recode electricity (0=1)(1=0) , gen(d_elct) recode water_mdg (0=1)(1=0) , gen(d_wtr) recode toilet_mdg (0=1)(1=0) , gen(d_sani) recode housing_1 (0=1)(1=0) , gen(d_hsg) recode cooking_mdg (0=1)(1=0) , gen(d_ckfl) recode hh_assets2 (0=1)(1=0) , gen(d_asst) *** Keep selected variables for global MPI estimation *** keep hh_id ind_id survey year subsample strata /*psu*/ weight area relationship sex age agec7 agec4 marital hhsize region /*year_interview month_interview date_interview*/ d_cm /*d_nutr*/ d_satt d_educ d_elct d_wtr d_sani d_hsg d_ckfl d_asst hh_mortality /*hh_nutrition_uw_st*/ hh_child_atten hh_years_edu6 electricity water_mdg toilet_mdg housing_1 cooking_mdg hh_assets2 order hh_id ind_id survey year subsample strata /*psu*/ weight area relationship sex age agec7 agec4 marital hhsize region /*year_interview month_interview date_interview*/ d_cm /*d_nutr*/ d_satt d_educ d_elct d_wtr d_sani d_hsg d_ckfl d_asst hh_mortality /*hh_nutrition_uw_st*/ hh_child_atten hh_years_edu6 electricity water_mdg toilet_mdg housing_1 cooking_mdg hh_assets2 *** Sort, compress and save data for estimation *** sort ind_id compress save "$path_out/Bhutan_blss22_pov.dta", replace log close ******************************************************************************** *** MPI Calculation (TTD file) ******************************************************************************** **SELECT COUNTRY POV FILE RUN ON LOOP FOR MORE COUNTRIES use "$path_out\Bhutan_blss22_pov.dta", clear ******************************************************************************** *** Define Sample Weight and total population *** ******************************************************************************** gen sample_weight = weight/1000000 //only DHS gen country = "Bhutan" gen countrycode = "BTN" ******************************************************************************** *** List of the 10 indicators included in the MPI *** ******************************************************************************** gen edu_1 = hh_years_edu6 gen atten_1 = hh_child_atten gen cm_1 = hh_mortality /* change countries with no child mortality 5 year to child mortality ever*/ *gen nutri_1 = hh_nutrition_uw_st gen elec_1 = electricity gen toilet_1 = toilet_mdg gen water_1 = water_mdg gen house_1 = housing_1 gen fuel_1 = cooking_mdg gen asset_1 = hh_assets2 global est_1 edu_1 atten_1 cm_1 /*nutri_1*/ elec_1 toilet_1 water_1 house_1 fuel_1 asset_1 ******************************************************************************** *** List of sample without missing values *** ******************************************************************************** foreach j of numlist 1 { gen sample_`j' = (edu_`j'!=. & atten_`j'!=. & cm_`j'!=. /*& nutri_`j'!=.*/ & elec_`j'!=. & toilet_`j'!=. & water_`j'!=. & house_`j'!=. & fuel_`j'!=. & asset_`j'!=.) replace sample_`j' = . if subsample==0 /* Note: If the anthropometric data was collected from a subsample of the total population that was sampled, then the final analysis only includes the subsample population. */ *** Percentage sample after dropping missing values *** sum sample_`j' [iw = sample_weight] gen per_sample_weighted_`j' = r(mean) sum sample_`j' gen per_sample_`j' = r(mean) } *** ******************************************************************************** *** Define deprivation matrix 'g0' *** which takes values 1 if individual is deprived in the particular *** indicator according to deprivation cutoff z as defined during step 2 *** ******************************************************************************** foreach j of numlist 1 { foreach var in ${est_`j'} { gen g0`j'_`var' = 1 if `var'==0 replace g0`j'_`var' = 0 if `var'==1 } } *** Raw Headcount Ratios foreach j of numlist 1 { foreach var in ${est_`j'} { sum g0`j'_`var' if sample_`j'==1 [iw = sample_weight] gen raw`j'_`var' = r(mean)*100 lab var raw`j'_`var' "Raw Headcount: Percentage of people who are deprived in `var'" } } ******************************************************************************** *** Define vector 'w' of dimensional and indicator weight *** ******************************************************************************** /*If survey lacks one or more indicators, weights need to be adjusted within / each dimension such that each dimension weighs 1/3 and the indicator weights add up to one (100%). CHECK COUNTRY FILE*/ foreach j of numlist 1 { // DIMENSION EDUCATION foreach var in edu_`j' atten_`j' { capture drop w`j'_`var' gen w`j'_`var' = 1/6 } // DIMENSION HEALTH foreach var in cm_`j' /*nutri_`j'*/ { capture drop w`j'_`var' gen w`j'_`var' = 1/3 } // DIMENSION LIVING STANDARD foreach var in elec_`j' toilet_`j' water_`j' house_`j' fuel_`j' asset_`j' { capture drop w`j'_`var' gen w`j'_`var' = 1/18 } } ******************************************************************************** *** Generate the weighted deprivation matrix 'w' * 'g0' ******************************************************************************** foreach j of numlist 1 { foreach var in ${est_`j'} { gen w`j'_g0_`var' = w`j'_`var' * g0`j'_`var' replace w`j'_g0_`var' = . if sample_`j'!=1 /*The estimation is based only on observations that have non-missing values for all variables in varlist_pov*/ } } ******************************************************************************** *** Generate the vector of individual weighted deprivation count 'c' ******************************************************************************** foreach j of numlist 1 { egen c_vector_`j' = rowtotal(w`j'_g0_*) replace c_vector_`j' = . if sample_`j'!=1 *drop w_g0_* } ******************************************************************************** *** Identification step according to poverty cutoff k (20 33.33 50) *** ******************************************************************************** foreach j of numlist 1 { foreach k of numlist 20 33 50 { gen multidimensionally_poor_`j'_`k' = (c_vector_`j'>=`k'/100) replace multidimensionally_poor_`j'_`k' = . if sample_`j'!=1 //Takes value 1 if individual is multidimensional poor } } ******************************************************************************** *** Generate the censored vector of individual weighted deprivation count 'c(k)' ******************************************************************************** foreach j of numlist 1 { foreach k of numlist 20 33 50 { gen c_censured_vector_`j'_`k' = c_vector_`j' replace c_censured_vector_`j'_`k' = 0 if multidimensionally_poor_`j'_`k'==0 } //Provide a score of zero if a person is not poor } * ******************************************************************************** *** Define censored deprivation matrix 'g0(k)' *** ******************************************************************************** foreach j of numlist 1 { foreach var in ${est_`j'} { gen g0`j'_k_`var' = g0`j'_`var' replace g0`j'_k_`var' = 0 if multidimensionally_poor_`j'_33==0 replace g0`j'_k_`var' = . if sample_`j'!=1 } } ******************************************************************************** *** Generates Multidimensional Poverty Index (MPI), *** Headcount (H) and Intensity of Poverty (A) *** ******************************************************************************** *** Multidimensional Poverty Index (MPI) *** foreach j of numlist 1 { foreach k of numlist 20 33 50 { sum c_censured_vector_`j'_`k' [iw = sample_weight] if sample_`j'==1 gen MPI_`j'_`k' = r(mean) lab var MPI_`j'_`k' "MPI with k=`k'" } sum c_censured_vector_`j'_33 [iw = sample_weight] if sample_`j'==1 gen MPI_`j' = r(mean) lab var MPI_`j' "`j' Multidimensional Poverty Index (MPI = H*A): Range 0 to 1" *** Headcount (H) *** sum multidimensionally_poor_`j'_33 [iw = sample_weight] if sample_`j'==1 gen H_`j' = r(mean)*100 lab var H_`j' "`j' Headcount ratio: % Population in multidimensional poverty (H)" *** Intensity of Poverty (A) *** sum c_censured_vector_`j'_33 [iw = sample_weight] if multidimensionally_poor_`j'_33==1 & sample_`j'==1 gen A_`j' = r(mean)*100 lab var A_`j' "`j' Intensity of deprivation among the poor (A): Average % of weighted deprivations" *** Population vulnerable to poverty (who experience 20-32.9% intensity of deprivations) *** gen temp = 0 replace temp = 1 if c_vector_`j'>=0.2 & c_vector_`j'<0.3332 replace temp = . if sample_`j'!=1 sum temp [iw = sample_weight] gen vulnerable_`j' = r(mean)*100 lab var vulnerable_`j' "`j' % Population vulnerable to poverty (who experience 20-32.9% intensity of deprivations)" drop temp *** Population in severe poverty (with intensity 50% or higher) *** gen temp = 0 replace temp = 1 if c_vector_`j'>0.49 replace temp = . if sample_`j'!=1 sum temp [iw = sample_weight] gen severe_`j' = r(mean)*100 lab var severe_`j' "`j' % Population in severe poverty (with intensity 50% or higher)" drop temp } * *** Censored Headcount *** foreach j of numlist 1 { foreach var in ${est_`j'} { sum g0`j'_k_`var' [iw = sample_weight] if sample_`j'==1 gen cen`j'_`var' = r(mean)*100 lab var cen`j'_`var' "Censored Headcount: Percentage of people who are poor and deprived in `var'" } } *** Dimensional Contribution *** foreach j of numlist 1 { foreach var in ${est_`j'} { gen cont`j'_`var' = (w`j'_`var' * cen`j'_`var')/MPI_`j' if sample_`j'==1 lab var cont`j'_`var' "% Contribution in MPI of indicator..." } } ** The line below produces the variance (inequality among the poor) ** sum c_vector_1 if c_vector_1>=1/3 & c_vector_1<=1 [aw = sample_weight], detail gen var=r(Var) *** Prepare results to export *** *keep subsample country year survey per_sample_weighted* per_sample* MPI* H* A* vulnerable* severe* raw* cen* cont* var keep if subsample==1 *gen temp = (_n) *keep if temp==2 *drop temp order hh_id ind_id survey year subsample strata weight area relationship sex age agec7 agec4 marital hhsize region MPI_1 H_1 A_1 severe_1 vulnerable_1 var /*cont1_nutr*/ cont1_cm_1 cont1_edu_1 cont1_atten_1 cont1_fuel_1 cont1_toilet_1 cont1_water_1 cont1_elec_1 cont1_house_1 cont1_asset_1 per_sample_1 per_sample_weighted_1 /*raw1_nutri_1*/ raw1_cm_1 raw1_edu_1 raw1_atten_1 raw1_fuel_1 raw1_toilet_1 raw1_water_1 raw1_elec_1 raw1_house_1 raw1_asset_1 /*cen1_nutri_1*/ cen1_cm_1 cen1_edu_1 cen1_atten_1 cen1_fuel_1 cen1_toilet_1 cen1_water_1 cen1_elec_1 cen1_house_1 cen1_asset_1 codebook, compact