** Surinam 2010 ** ** HH DEPRIVATIONS ** /* REFORMULATED MPI - MAY 7 2013 */ /* A household is deprived in LIVING STANDARDS if it a. Does not have electricity or Has electricity but neither has a television nor a refrigerator b. Does not use improved drinking water sources (MDG indicator 7.8) c. Does not use improved sanitation (MDG indicator 7.9) d. Uses solid fuel for cooking and heating (non-MDG indicator related to target 7) e. Does not have the finished floor (non-MDG indicator related to Target 7). Weighting: each indicator is weighted by 1/5 A household is poor in Living standards if the sum of weighted deprivations is 1/3 or more. */ ******************************************************************************** ** MORTALITY IS EXCLUDED BECAUSE IT WAS NOT COLLECTED IN THE QUESTIONNAIRE ** ** HHs WITH NO CHILDREN UNDER 5Y WILL BE TREATED AS NOT-DEPRIVED IN NUTRITION ** ******************************************************************************** clear clear matrix set maxvar 7000 set more off cd "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Surinam 2010_MICS\" use "hh.dta", clear gen hhmembers_hh = hh11 gen urban=1 if hh6==1 replace urban=0 if hh6==2 | hh6==3 ******************************** ** LIVING STANDARD INDICATORS ** ******************************** gen electricity = 1 if hc8a==1 replace electricity=0 if hc8a==2 gen sanitation = 0 if ws8==14 | ws8==15 | ws8==23 | ws8==41 | ws8==51 | ws8==95 | ws8==96 replace sanitation = 1 if ws8==11 | ws8==12 | ws8==13 | ws8==21 | ws8==22 | ws8==31 replace sanitation = 0 if ws9==1 /*shared*/ /* flush to piped sewer system | 100 1.35 1.35 11 y flush to septic tank | 4,729 63.85 65.20 12 y flush to pit (latrine) | 142 1.92 67.11 13 y flush to somewhere else | 6 0.08 67.19 14 n flush to unknown place / not sure / dk | 5 0.07 67.26 15 n ventilated improved pit latrine (vip) | 47 0.63 67.90 21 y pit latrine with slab | 1,102 14.88 82.77 22 y pit latrine without slab / open pit | 226 3.05 85.82 23 n composting toilet | 4 0.05 85.88 31 y bucket | 6 0.08 85.96 41 n hanging toilet, hanging latrine | 2 0.03 85.99 51 n no facility, bush, field | 960 12.96 98.95 95 n other | 69 0.93 99.88 96 n missing | 9 0.12 100.00 99 */ gen water = 1 if ws1==11 | ws1==12 | ws1==13 | ws1==14 | ws1==21 | ws1==31 | ws1==41 | ws1==51 | (ws1==91 & (ws2==11 | ws2==12 | ws2==13 | ws2==21 | ws2==31 | ws2==41 | ws2==51)) replace water = 0 if ws1==32 | ws1==42 | ws1==61 | ws1==71 | ws1==81 | (ws1==91 & (ws2==42 | ws2==61 | ws2==96 | ws2==99)) | ws1==96 replace water=0 if (ws4>=30 & ws4<=300) | ((ws4==998 | ws4==999) & (ws1==13 | ws1==14 | ws1==21 | ws1==31 | ws1==41 | ws1==51)) * improved drinking water sources: household connection; public standpipe; borehole; protected dug well; protected spring; rainwater /* piped into dwelling | 3,426 36.62 36.62 11 y piped into compound, yard or plot | 875 9.35 45.97 12 y piped to neighbour | 60 0.64 46.61 13 y public tap / standpipe | 99 1.06 47.67 14 y tube well, borehole | 13 0.14 47.81 21 y protected well | 38 0.41 48.22 31 y unprotected well | 34 0.36 48.58 32 n protected spring | 97 1.04 49.62 41 y unprotected spring | 20 0.21 49.83 42 n rainwater collection | 1,897 20.28 70.10 51 y tanker-truck | 7 0.07 70.18 61 n cart with small tank / drum | 4 0.04 70.22 71 n surface water (river, stream, dam, lake | 543 5.80 76.03 81 n bottled water | 241 2.58 78.60 91 n other | 45 0.48 79.08 96 n missing | 8 0.09 79.17 99 */ gen floor = 1 if hc3==21 | hc3==22 | hc3==31 | hc3==32 | hc3==33 | hc3==34 | hc3==35 | hc3==36 replace floor = 0 if hc3==11 | hc3==12 | hc3==96 gen cookingfuel = 0 if hc6==6 | hc6==7 | hc6==8 | hc6==9 | hc6==10 | hc6==11 | hc6==95 | hc6==96 replace cookingfuel = 1 if hc6==1 | hc6==2 | hc6==3 | hc6==4 | hc6==5 * ASSETS * /* Household is not deprived in assets if it owns at least one of the assets for access to information (phone (mobile or fixed), radio, TV) AND either one asset for easy mobility (bicycle, motorbike, motorboat, car, truck or animal wheel cart) OR one asset for livelihood (refrigerator, agricultural land or livestock (at least one cattle or at least one horse or at least two goats or at least two sheep, or at least 10 chicken) */ foreach var in hc8b hc8c hc8d hc8e hc9b hc9c hc9d hc9f hc9e hc11 hc9g { replace `var'=. if `var'==9 replace `var'=0 if `var'==2 } foreach var in hc14a hc14b hc14c hc14d hc14e { replace `var'=. if `var'>=98 } * Information * gen phone = 0 if hc8d==0 & hc9b==0 replace phone = 1 if hc8d==1 | hc9b==1 /* cell phone or landline */ gen radio = 0 if hc8b==0 replace radio = 1 if hc8b==1 gen tv = 0 if hc8c==0 replace tv = 1 if hc8c==1 * Mobility * gen bicycle = 0 if hc9c==0 replace bicycle = 1 if hc9c==1 gen motorcycle = 0 if hc9d==0 replace motorcycle = 1 if hc9d==1 gen motorboat = 0 if hc9g==0 replace motorboat = 1 if hc9g==1 gen car_truck = 0 if hc9f==0 replace car_truck = 1 if hc9f==1 gen animal_cart = 0 if hc9e==0 replace animal_cart = 1 if hc9e==1 * Livelihood * gen refrigerator = 0 if hc8e==0 replace refrigerator = 1 if hc8e==1 gen land = 0 if hc11==0 replace land = 1 if hc11==1 gen cattle = 0 if hc14a==0 replace cattle = 1 if (hc14a>0 & hc14a<=95) gen horses = 0 if hc14b==0 replace horses = 1 if (hc14b>0 & hc14b<=95) gen goats = 0 if hc14c<2 replace goats = 1 if (hc14c>=2 & hc14c<=95) gen sheeps = 0 if hc14d<2 replace sheeps = 1 if (hc14d>=2 & hc14d<=95) gen chicken = 0 if hc14e<10 replace chicken = 1 if (hc14e>=10 & hc14e<=95) foreach var in cattle horses goats sheeps chicken { replace `var'=0 if hc13==2 & `var'==. } egen information_miss = rowmiss(phone radio tv) egen mobility_miss = rowmiss(bicycle motorcycle car_truck animal_cart motorboat) egen livelihood_miss = rowmiss(refrigerator land cattle horses goats sheeps chicken) gen information_depriv = . if information_miss==2 | information_miss==3 replace information_depriv = 0 if phone==1 | radio==1 | tv==1 replace information_depriv = 1 if phone==0 & radio==0 & tv==0 gen mobility_depriv = . if mobility_miss==3 | mobility_miss==4 | mobility_miss==5 replace mobility_depriv = 0 if bicycle==1 | motorcycle==1 | car_truck==1 | animal_cart==1 | motorboat==1 replace mobility_depriv = 1 if bicycle==0 & motorcycle==0 & car_truck==0 & animal_cart==0 & motorboat==0 gen livelihood_depriv = . if livelihood_miss==4 | livelihood_miss==5 | livelihood_miss==6 | livelihood_miss==7 replace livelihood_depriv = 0 if refrigerator== 1 | land==1 | cattle==1 | horses==1 | goats==1 | sheeps==1 | chicken==1 replace livelihood_depriv = 1 if refrigerator==0 & land==0 & cattle==0 & horses==0 & goats==0 & sheeps==0 & chicken==0 gen asset_depriv = . if information_depriv==. | (information_depriv==1 & mobility_depriv==0 & livelihood_depriv==.) | (information_depriv==1 & mobility_depriv==. & livelihood_depriv==0) replace asset_depriv = 0 if information_depriv==0 & (mobility_depriv==0 | livelihood_depriv==0) replace asset_depriv = 1 if information_depriv==1 | (information_depriv==0 & mobility_depriv==1 & livelihood_depriv==1) foreach var in electricity sanitation water floor cookingfuel { gen `var'_depriv=1 if `var'==0 replace `var'_depriv=0 if `var'==1 } egen depriv = rsum(electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv) replace depriv = . if electricity_depriv==. & sanitation_depriv==. & water_depriv==. & floor_depriv==. & cookingfuel_depriv==. & asset_depriv==. gen ls_sample=1 if electricity_depriv<. & sanitation_depriv<. & water_depriv<. & floor_depriv<. & cookingfuel_depriv<. & asset_depriv<. egen livings_miss = rowmiss(electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv) keep if hh9==1 /* completed interviews */ keep hhmembers_hh urban electricity electricity_depriv water sanitation cookingfuel floor sanitation_depriv water_depriv floor_depriv cookingfuel_depriv depriv ls_sample livings_miss hh1 hh2 phone radio tv bicycle motorcycle motorboat car_truck animal_cart refrigerator land cattle horses goats sheeps chicken information_miss mobility_miss livelihood_miss information_depriv mobility_depriv livelihood_depriv asset_depriv sort hh1 hh2 save "hh_MPI2_MCC.dta", replace * BIRTHs' QUESTIONNAIRE TO CALCULATE WHEN THE DEATH OF A CHILD HAPPENED * * Surinam DOES NOT HAVE BIRTH HISTORY INFORMATION * *** NOT ALL MICS WILL HAVE BIRTH HISTORY QUESTIONNAIRE. IF NOT, WE WILL USE THE MORTALITY INFORMATION FROM THE WOMEN QUESTIONNAIRE ONLY FROM WOMEN 35Y OR YOUNGER *** * WOMEN'S QUESTIONNAIRE (15-49 y) * ** MORTALITY SECTION NOT INCLUDED ** /*use "wm.dta", clear gen children_died=1 if cm8==1 replace children_died=0 if cm8==2 replace children_died=0 if cm8==. & cm1==2 * cm0 (never got pregnant) is not in every survey gen children_died2=1 if (cm9b>0 & cm9b<.) | (cm9a>0 & cm9a<.) replace children_died2=0 if cm9b==0 & cm9a==0 replace children_died2=0 if cm9b==. & cm9a==. & cm1<. tab children_died children_died2,m * they are identical * tab cdead children_died,m * they are identical * *egen children_diedhh=sum(children_died), by(hh1 hh2) missing *gen uno=1 *egen nwomen15_49=sum(uno), by(hh1 hh2) *drop uno *sort hh1 hh2 ln *bys hh1 hh2: gen uno=1 if _n==1 *keep if uno==1 *drop uno gen age_w = wb2 keep hh1 hh2 children_died cdead ln cm1 cm8 age_w sort hh1 hh2 ln save "wm_MCC.dta", replace*/ * Children data set use "ch.dta", clear replace haz2=. if hazflag==1 replace haz=. if hazflag==1 sort hh1 hh2 ln save "ch_MCC.dta", replace /* *** Here I will recalculate height-for-age z scores and compare the z scores with the ones provided by MICS *** use "ch.dta", clear * Variable “Sex” tab hl4, miss gen gender = hl4 desc gender tab gender * Variable “Age” can be expresses it in months or days tab cage, miss codebook cage gen age_months = cage desc age_months summ age_months gen str6 ageunit = "months" label var ageunit "Months" * Variable “body weight” – it must be in kilograms ta an3, miss codebook an3 gen weight = an3 desc weight replace weight=. if an3>90 & an3<. tab an2 an3 if an3==99.9 | an3==., miss summ weight * Variable “height” – it must be in centimetres ta an4, miss codebook an4 gen height = an4 desc height replace height=. if an4>=990 & an4<. tab an2 an4 if an4==999.9 | an4==., miss summ height codebook an4a gen measure = "l" if an4a==1 replace measure = "h" if an4a==2 replace measure = " " if an4a==9 | an4a==. desc measure tab measure *Variable “Oedema” gen oedema=. desc oedema *Variable “Sampling weight” gen sw = chweight desc sw summ sw keep hh1 hh2 ln gender age_months ageunit weight height oedema measure sw save "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata\SUR_survey.dta", replace * THIS RUNS THE ANTHRO ADO FILE FROM WHO * /* Example: survey_standard.do using survey.dta */ clear set more 1 /* Higher memory might be necessary for larger datasets */ set memory 20m set maxvar 10000 /* Indicate to the Stata compiler where the igrowup_standard.ado file is stored*/ adopath + "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\" /* Load the data file */ use "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata\SUR_survey.dta", clear /* generate the first three parameters reflib, datalib & datalab */ gen str60 reflib="C:\igrowup_stata" lab var reflib "Directory of reference tables" gen str60 datalib="C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata" lab var datalib "Directory for datafiles" gen str30 datalab="SUR_survey" lab var datalab "Working file" /* check the variable for "sex" 1 = male, 2=female */ desc gender tab gender /* check the variable for "age" */ ren age_months agemons desc agemons summ agemons /* define your ageunit */ *gen str6 ageunit="months" /* or gen ageunit="days" */ *lab var ageunit "=days or =months" /* check the variable for body "weight" which must be in kilograms*/ /* NOTE: if not available, please create as [gen weight=.]*/ desc weight summ weight /* check the variable for "height" which must be in centimeters*/ /* NOTE: if not available, please create as [gen height=.]*/ desc height summ height /* check the variable for "measure"*/ /* NOTE: if not available, please create as [gen str1 measure=" "]*/ desc measure tab measure /* check the variable for "headc" which must be in centimeters*/ /* NOTE: if not available, please create as [gen headc=.]*/ gen headc=. desc head summ head /* check the variable for "armc" which must be in in centimeters*/ /* NOTE: if not available, please create as [gen armc=.]*/ gen muac=. desc muac summ muac /* check the variable for "triskin" which must be in millimeters*/ /* NOTE: if not available, please create as [gen triskin=.]*/ gen triskin=. desc tri summ tri /* check the variable for "subskin" which must be in millimeters*/ /* NOTE: if not available, please create as [gen subskin=.]*/ gen subskin=. desc sub summ sub /* check the variable for "oedema"*/ /* NOTE: if not available, please create as [gen str1 oedema="n"]*/ desc oedema tab oedema /* check the variable for "sw" for the sampling weight*/ /* NOTE: if not available, please create as [gen sw=1]*/ desc sw summ sw /* Fill in the macro parameters to run the command */ igrowup_standard reflib datalib datalab gender agemons ageunit weight height measure head muac tri sub oedema sw sort hh1 hh2 ln save "SUR_anthro.dta", replace */ * INDIVIDUALS' QUESTIONNAIRE * use "hl.dta", clear ren hl1 ln egen hh=group(hh1 hh2) egen hhid=group(hh1 hh2) /*sort hh1 hh2 ln merge hh1 hh2 ln using "wm_MCC.dta" tab _merge ren _merge merge_women*/ sort hh1 hh2 merge hh1 hh2 using "HH_MPI2_MCC.dta" tab _merge drop _merge sort hh1 hh2 ln merge hh1 hh2 ln using "ch_MCC.dta" tab _merge ren _merge merge_children sort hh1 hh2 ln merge hh1 hh2 ln using "SUR_anthro.dta" tab _merge ren _merge merge_anthro capture ren weight weight_child gen sex = 1 if hl4==1 replace sex=0 if hl4==2 gen age = hl6 replace age = . if age==98 | age==99 gen wealthi = windex5 if windex5>0 gen wealths = wscore if windex>0 gen weight = hhweight if hhweight>0 drop if hl3==14 | hl3==98 | hl3==99 /* remove those who are not related to the HH head */ capture drop uno gen uno=1 egen hhmembers=sum(uno), by(hh) compare hhmembers hhmembers_hh label var hhmembers "Number of HH members (excludes those not related to the HH head)" label var hhmembers_hh "Number of HH members (includes those not related to the HH head)" drop uno compress sort hh1 hh2 ln save "Surinam_MPI2_2010.dta", replace * MPI CALCULATION * *** A- EDUCATION DIMENSION *** /* For the indicator on years of education, if we observe at least one member with five or more years of education then, regardless of the number of other members with missing data, we classify the household as non-deprived. If more than 1/3 of the household members have missing information on years of education, and the people for which we observe the years of education have less than five years, the household is given a missing value in this indicator. If we have information of 2/3 (or more) of household members, and these report less than five years of education, the household will be classified as deprived. For the school attendance indicator, if all school-aged children in a household have missing information in enrolment, that value is considered missing. As long as we have information for one of the children in the household, the household will be classified as non-deprived or deprived depending on whether that child is reported to be attending school or not. */ * http://stats.uis.unesco.org/unesco/TableViewer/tableView.aspx?ReportId=163 * Entrance age of primary: 6y * Duration of primary: 6y * Entrance age of lower secondary: 12y * Durantion lower secondary: 4y * Entrance age high secondary: 16y * Duration high secondary: 3y gen yschooling = 0 if ed4a==0 | (ed4a==1 & ed4b==0) | (ed4a==2 & ed4b==0) replace yschooling = 0 if ed3==2 replace yschooling =1 if (ed4a==1 | ed4a==2) & ed4b==1 replace yschooling =2 if (ed4a==1 | ed4a==2) & ed4b==2 replace yschooling =3 if (ed4a==1 | ed4a==2) & ed4b==3 replace yschooling =4 if (ed4a==1 | ed4a==2) & ed4b==4 replace yschooling =5 if (ed4a==1 | ed4a==2) & ed4b==5 replace yschooling =6 if (ed4a==1 | ed4a==2) & ed4b==6 replace yschooling =7 if (ed4a==3 | ed4a==5) & ed4b==1 replace yschooling =8 if (ed4a==3 | ed4a==5) & ed4b==2 replace yschooling =9 if (ed4a==3 | ed4a==5) & ed4b==3 replace yschooling =10 if (ed4a==3 | ed4a==5) & ed4b==4 replace yschooling =11 if ed4a==4 & ed4b==1 replace yschooling =12 if ed4a==4 & ed4b==2 replace yschooling =13 if ed4a==4 & ed4b==3 replace yschooling =14 if ed4a==4 & ed4b==4 replace yschooling =14 if ed4a==6 & ed4b==1 replace yschooling =15 if ed4a==6 & ed4b==2 replace yschooling =16 if ed4a==6 & ed4b==3 replace yschooling =17 if ed4a==6 & ed4b==4 replace yschooling =18 if ed4a==6 & ed4b==5 replace yschooling =19 if ed4a==6 & ed4b==6 replace yschooling =20 if ed4a==6 & ed4b==7 replace yschooling =6 if (ed4a==3 | ed4a==5) & ed4b==0 replace yschooling =10 if ed4a==4 & ed4b==0 replace yschooling =13 if ed4a==6 & ed4b==0 replace yschooling=. if age<5 gen uno14=1 if age>=12 & age<. /* Number of HH members 12y or older */ bys hhid: egen hhmember14 = sum(uno14) ** 1- DEPRIVED IN EDUCATION ** gen yschoolingi=0 if yschooling<6 & age>=12 & age<. replace yschoolingi=1 if yschooling>=6 & yschooling<. replace yschoolingi=1 if yschooling==. & (ed4a==3 | ed4a==4 | ed4a==5 | ed4a==6) & (ed4b==97 | ed4b==98 | ed4b==99) replace yschoolingi=0 if yschooling==. & ed4a==7 & age>=12 & age<. gen schooling_missing = 1 if (((ed4a==8 | ed4a==9 | ed4a==. | ((ed4a==1 | ed4a==2) & (ed4b==97 | ed4b==98 | ed4b==99))) & ed3==1) | ed3==9) & age>=12 & age<. egen schooling_missinghh=sum(schooling_missing), by(hhid) egen yeduchh=sum(yschoolingi), by(hhid) /* assumes that a member has <6 y schooling when there is missing info on that member's schooling */ replace yeduchh=. if schooling_missinghh==hhmember14 * DEPRIVED IN EDUCATION INDICATOR * gen educ_depriv=1 if yeduchh==0 replace educ_depriv=0 if yeduchh>=1 & yeduchh<. replace educ_depriv=. if yeduchh ==0 & schooling_missinghh>0 & schooling_missinghh>(1/3*hhmember14) ** 2- DEPRIVED IN SCHOOL ATTENDANCE 7-14Y (entrance age is 6 but we allow for 1 year of late enrollment) ** gen attendance_missing=1 if (ed5==9 | (ed5==. & (ed3==9 | ed3==.))) & schage>=7 & schage<=14 gen child_7_14=1 if schage>=7 & schage<=14 egen attendance_missinghh=sum(attendance_missing), by(hhid) egen child_7_14hh=sum(child_7_14), by(hhid) gen child_6_14=1 if schage>=6 & schage<=14 egen child_6_14hh=sum(child_6_14), by(hhid) gen attendance_missing_final = 1 if attendance_missinghh==child_7_14hh & child_7_14hh>0 & attendance_missing==1 & child_7_14==1 egen attendance_missing_finalhh = sum(attendance_missing_final), by(hhid) gen child_noattend=1 if (ed5==2 | ed3==2) & schage>=7 & schage<=14 replace child_noattend=0 if ed5==1 & schage>=7 & schage<=14 * DEPRIVED IN SCHOOL ATTENDANCE 6-14Y * egen child_noattendhh=sum(child_noattend), by(hhid) replace child_noattendhh=1 if child_noattendhh>1 & child_noattendhh<. replace child_noattendhh=. if child_noattendhh==0 & attendance_missinghh>=1 & attendance_missinghh>(1/3*child_7_14hh) replace child_noattendhh=0 if child_6_14hh>0 & child_6_14hh<. & child_7_14hh==0 *** B- HEALTH DIMENSION *** /* For the nutritional indicator, in MICS countries, if nutritional information for women and children in the household was missing and these were households with applicable members (that is with children and/or women), we consider the household as missing this indicator. Otherwise, we used the available information. Similarly, for child mortality, households that had applicable members who did not respond to the mortality question are considered to be missing this information; otherwise the household is considered non-deprived. */ ** 1- DEPRIVED IN NUTRITION ** /* Adults are considered malnourished if their BMI is below 18.5. Children are considered malnourished if their z-score of weight-for-age is below minus two standard deviations from the median of the reference population. */ * UNDERNUTRITION USING Z SCORES CALCULATED WITH WHO CODE * * Height-for-age * gen zha = _zlen if _flen==0 gen malnourished5 = 1 if zha<=-2 replace malnourished5=0 if zha>-2 & zha<. egen malnourished5hh=sum(malnourished5), by (hhid) missing gen missing_zha=1 if _flen==1 | (an2>=2 & an2<=9) | (an4>=900 & an4<.) | (uf9>1 & uf9<.) egen missing_zhahh=sum(missing_zha), by(hhid) missing gen nomissing_zha=1 if _flen==0 egen nomissing_zhahh=sum(nomissing_zha), by(hhid) missing gen missing_zha_finalhh=1 if missing_zhahh>=1 & missing_zhahh<. & nomissing_zhahh==. replace missing_zha_finalhh=0 if missing_zha_finalhh==. gen uno_zha=1 if zha<. egen nw_zha=sum(uno_zha), by (hhid) ** IN MICS I AM COUNTING CHILDREN UNDER 5Y BUT NOT INCLUDING 5Y BECAUSE AT LEAST FOR Surinam ONLY CHILDREN UNDER 5Y WERE MEASURED ** ** CHECK FOR OTHER COUNTRIES AND ADJUST IF NECESSARY ** gen uno0_5=1 if age<5 bys hhid: egen hhmember0_5 = sum(uno0_5) ren malnourished5hh nmalnourished5hh gen malnourished5hh=1 if nmalnourished5hh>=1 & nmalnourished5hh<. replace malnourished5hh=0 if nmalnourished5hh==0 replace missing_zha_finalhh=1 if malnourished5hh==0 & hhmember0_5>(2*nw_zha) & nw_zha<. replace malnourished5hh=. if malnourished5hh==0 & hhmember0_5>(2*nw_zha) & nw_zha<. gen w=1 if sex==0 & age>=15 & age<=49 egen whh=sum(w), by(hhid) gen welig=1 if sex==0 & age>=15 & age<. egen welighh=sum(welig), by(hh1 hh2) gen undernutritionhh=0 if malnourished5hh==0 replace undernutritionhh=1 if malnourished5hh>0 & malnourished5hh<. replace undernutritionhh=0 if undernutritionhh==. & hhmember0_5==0 ** 2- DEPRIVED IN MORTALITY ** gen w35=1 if sex==0 & age>=15 & age<=35 & age<. egen w35hh=sum(w35), by(hhid) /*gen child_died5 = children_died replace child_died5=0 if child_died5==1 & age>35 & age<=49 & merge_w==3 replace child_died5=0 if child_died5==. & age>35 & age<=49 & merge_w==3 capture drop uno gen uno=1 if child_died5==. & age>=15 & age<=35 & sex==0 egen missing_child_died5hh=sum(uno), by(hhid) capture drop uno gen uno=1 if child_died5<. & age>=15 & age<=35 & sex==0 egen nomissing_child_died5hh=sum(uno), by(hhid) egen child_died5hh=sum(child_died5), by(hhid) missing egen children_diedhh=sum(children_died), by(hhid) missing replace children_diedhh=0 if children_diedhh==. & whh==0 *replace child_died5hh=0 if children_diedhh==0 & child_died5hh==. replace child_died5hh=0 if w35hh==0 gen mortality5hh=0 if child_died5hh==0 replace mortality5hh=1 if child_died5hh>=1 & child_died5hh<. ren merge_women merge_women_i egen merge_women=max(merge_women_i), by(hhid)*/ gen mortality5hh=. gen region = hh7 compress sort hh1 hh2 ln save "Surinam_MPI2_2010.dta", replace * NON-ELIGIBLE POPULATION * gen uno7_14=1 if schage>=7 & schage<=14 bys hhid: egen hhmember7_14 = sum(uno7_14) gen uno15_49=1 if age>=15 & age<=49 & sex==0 bys hhid: egen hhmember15_49 = sum(uno15_49) capture drop uno0_5 hhmember0_5 gen uno0_5=1 if age<5 bys hhid: egen hhmember0_5 = sum(uno0_5) gen uno7_14hh=0 if hhmember7_14==0 replace uno7_14hh=1 if hhmember7_14>=1 & hhmember7_14<. gen uno15_49hh=0 if hhmember15_49==0 replace uno15_49hh=1 if hhmember15_49>=1 & hhmember15_49<. gen uno0_5hh=0 if hhmember0_5==0 replace uno0_5hh=1 if hhmember0_5>=1 & hhmember0_5<. gen uno15_35=1 if age>=15 & age<=35 & sex==0 bys hhid: egen hhmember15_35 = sum(uno15_35) gen uno15_35hh=0 if hhmember15_35==0 replace uno15_35hh=1 if hhmember15_35>=1 & hhmember15_35<. * Number of eligible children for anthropometrics *egen nch05=sum(hv120), by(hhid) *** THE CASE OF Surinam IS EASY BECAUSE ALL CHILDREN UNDER 5Y WERE SELECTED TO BE MEASURED, NOT LIKE IN BURKINA FASO O SENEGAL WERE A SUBSAMPLE (50%) WERE SELECTED FOR ANTHROPOMETRICS. ALWAYS CHECK FOR THIS SITUATION WHEN COMPUTING THE MPI FOR A NEW COUNTRY *** gen nutrihh=1 if undernutritionhh<. & malnourished5hh<. replace nutrihh=2 if undernutritionhh==. & malnourished5hh==. & hhmember0_5>0 & hhmember0_5<. replace nutrihh=3 if undernutritionhh==0 & malnourished5hh==. & hhmember0_5==0 & welighh>0 & welighh<. replace nutrihh=4 if undernutritionhh==0 & malnourished5hh==. & hhmember0_5==0 & welighh==0 label define nutrihh 1 "HH with nutrition information" 2 "HH with missing information on nutrition" 3 "HH with no eligible population for nutrition (no children 0-5y) but with women 15-49y" 4 "HH with no children 0-5 and no women 15-49y" label values nutrihh nutrihh gen attehh=1 if child_noattendhh<. & uno7_14hh==1 replace attehh=2 if child_noattendhh==. replace attehh=3 if child_noattendhh==0 & uno7_14hh==0 replace attehh=1 if attehh==3 & child_6_14hh>0 & child_6_14hh<. & child_7_14hh==0 label define attehh 1 "HH with attendance information" 2 "HH with missing information on attendance" 3 "HH with no eligible population for attendace (no children 7-14y)" label values attehh attehh gen morthh=. compress sort hh1 hh2 ln save "Surinam_MPI2_2010.dta", replace ** DO FILE FROM OPHI TO COMPUTE MPI ** *************************************************************************** **** Multidimensional Poverty Measure ************************************* **** OPHI-HDCA Summer School 2011 ***************************************** **** 24 August to 3 September 2011 - Delft, the Netherlands *************** *************************************************************************** ** ADAPTED BY CECILIA ON MAY 2013 ** ** Surinam 2010 ** clear set more off set maxvar 10000 set mem 500m cap log close *** Replace here your path to the dataset*** cd "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Surinam 2010_MICS\" *** Replace here the name of your dataset*** capture log close log using "M0_dofile_Surinam2010_MPI2.log", text replace use "Surinam_MPI2_2010.dta", clear ********************************************************************************* ******* Define the deprivation matrix **************************************** ********************************************************************************* *** The dataset can be interpreted as the matrix of achivemnts *** We will now crate the deprivation matrix based on the indicator definition; and deprivation cut-off defined by you *** during the last working session on the normative Issues in Multidimensional Poverty Measure *** In order to do this, we will generate a new variable for each indicator contained in our measure *** This will identify with 0 individuals or households who are not deprived in the specific indicator *** and identify with 1 individual deprived in the specific indicator. *** Note that you will need to replace with dot "." if the information is missing or inconsistent. *** We will assess later the frequency of missing values. ** DEPRIVED IN DRINKING WATER ** (the individual -HH- is considered deprived in drinking water is: unprotected well, spring, river/lake/pond or other) /*lookfor water codebook b2q12, tab(20) gen d_dwater=(b2q12==5 | b2q12==6 | b2q12==7 | b2q12==8) replace d_dwater=. if b2q12==. tab b2q12 d_dwater [aw=weight], miss label variable d_dwater "Deprived in drinking water"ic*/ ** Please follow the same logic for all indicators. ** Note that for advance indicator you may have to use more complex algorithms ***************************************************************************** ******** Create a local variable with all your indicators ********* ***************************************************************************** local varlist_pov electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv educ_depriv child_noattendhh undernutritionhh ***************************************************************************** **** Define the weights ***************************** ***************************************************************************** ** Create a loop for the variables with the same weight ********************* ***************************************************************************** egen ls=rowmiss(electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv) gen hh_missing=0 replace hh_missing=1 if educ_depriv==. | nutrihh==2 | attehh==2 | (ls>0 & ls<.) foreach var in electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv { gen w_`var'=1/18 if ls==0 } gen w_undernutritionhh = 1/3 if nutrihh==1 | nutrihh==3 | nutrihh==4 gen w_child_noattendhh = 1/6 if attehh==1 | attehh==3 gen w_educ_depriv = 1/6 if educ_depriv<. ******************************************************************* ********* Define the weigthed deprivation g0* matrix **** ******************************************************************* foreach var in `varlist_pov' { gen wg0_`var' = `var'*w_`var' } ****************************************************************************** *********** Compute the frequency of missing values for indicator ************ ****************************************************************************** foreach var in `varlist_pov' { gen `var'_miss=1 if `var'==. replace `var'_miss=0 if `var'!=. } sum *_miss ******************************************************************************** ************* Define the (weighted) deprivation count vector "ci" ************ ******************************************************************************** egen ci=rsum(wg0_*) label variable ci "Deprivation Count" egen n_missing=rowmiss(wg0_*) label variable n_missing "Number of missing variables by individual" gen missing=(n_missing>0) label variable missing "Individual with missing variables" *** Check sample drop due to missing values tab missing ******************************************************************************* ***** Create de identification vector (poor/non poor) ************************* ***** and compute individual average of deprivation *************************** ******************************************************************************* forvalues x=1(1)10 { gen h_`x'0p=(ci>=`x'/10) replace h_`x'0p=. if missing==1 gen a_`x'0p=(ci) if h_`x'0p==1 replace a_`x'0p=. if missing==1 label var h_`x'0p "Condition of Multidimensional Poverty k=`x'" label var a_`x'0p "Individual Average deprivation k=`x'" } sum h_10p-a_100p [aw=weight] gen h_33p=(ci>=3.33/10) replace h_33p=. if missing==1 gen a_33p=(ci) if h_33p==1 replace a_33p=. if missing==1 label var h_33p "Condition of Multidimensional Poverty k=33.3" label var a_33p "Individual Average deprivation k=33.3" sum h_33p a_33p [aw=weight] ******************************************************************************** ******* Compute raw headcounts ****************************************** ******************************************************************************** foreach var in `varlist_pov' { gen `var'_raw=(`var') replace `var'_raw=. if missing==1 } su *_raw [iw=weight] ****************************************************************************** *********** Compute Censored headcount and censored headocunt **************** ****************************************************************************** ***** Please define in the first line your poverty cutoff, the example shows k=33.3 is 33.3% local k=1/3 foreach var in `varlist_pov' { *gen `var'_CH_`k'=(`var'==1 & h_`k'==1) *replace `var'_CH_`k'=. if missing==1 gen `var'_CH_33=(`var'==1 & h_33==1) replace `var'_CH_33=. if missing==1 } sum electricity_depriv_CH_33-educ_depriv_CH_33 [iw=weight] sum h_33 a_33 [iw=weight] *h = HC *a = intensity capture drop cedu chealth cls scalar drop _all gen cedu = (child_noattendhh_CH_33 * w_child_noattendhh) + (educ_depriv_CH_33 * w_educ_depriv) sum cedu [iw=weight] scalar mpi_edu=r(mean) gen chealth = (undernutritionhh_CH_33 * w_undernutritionhh) sum chealth [iw=weight] scalar mpi_health=r(mean) gen cls = (electricity_depriv_CH_33 * w_electricity_depriv) + (sanitation_depriv_CH_33 * w_sanitation_depriv) + (water_depriv_CH_33 * w_water_depriv) + (floor_depriv_CH_33 * w_floor_depriv) + (cookingfuel_depriv_CH_33 * w_cookingfuel_depriv) + (asset_depriv_CH_33 * w_asset_depriv) sum cls [iw=weight] scalar mpi_ls=r(mean) sum a_33p [iw=weight] scalar intensity = r(mean) sum h_33p [iw=weight] scalar headcount = r(mean) scalar mpi=headcount*intensity scalar headcount100=headcount*100 scalar intensity100=intensity*100 scalar edu_contrib = (mpi_edu/mpi)*100 scalar health_contrib = (mpi_health/mpi)*100 scalar ls_contrib = (mpi_ls/mpi)*100 capture drop uno gen uno=1 if h_33p<. sum uno [aw=weight] if h_33p<. scalar pop=r(sum_w) sum uno [aw=weight] if h_33p<. & ci>0 & ci<(1/3) scalar pop_vuln0=r(sum_w) sum uno [aw=weight] if h_33p<. & ci>=0.2 & ci<(1/3) scalar pop_vuln20=r(sum_w) sum uno [aw=weight] if h_33p<. & ci>=0.5 scalar pop_severe=r(sum_w) scalar vulnerable0=(pop_vuln0/pop)*100 scalar vulnerable20=(pop_vuln20/pop)*100 scalar severity=(pop_severe/pop)*100 * Sample size * HHs capture drop hh egen hh=group(hh1 hh2) sort age bys hh: gen n=_n gen nhh=1 if n==1 * Individuals capture drop uno gen uno=1 sum uno scalar ind_sample_tot=r(N) sum uno if h_33p<. scalar ind_sample_used=r(N) sum uno [w=weight] if h_33p<. scalar ind_sample_used_w=r(sum) sum nhh scalar hh_sample_tot=r(N) sum nhh if h_33p<. scalar hh_sample_used=r(N) sum nhh [w=weight] if h_33p<. scalar hh_sample_used_w=r(sum) * Inequality sum a_33p [aw=weight] scalar cv_ineq_poor = r(sd)/r(mean) sum ci [aw=weight] if h_33p<. scalar cv_ineq_hc = r(sd)/r(mean) sum ci [aw=weight] if h_33p<. & ci>0 scalar cv_ineq_positive = r(sd)/r(mean) * CONTRIBUTION OF EACH DIMENSION FOR THE VULNERABLE POEPLE foreach var in `varlist_pov' { gen `var'_CH_33vu=0 if h_33p<. & ci>=0.2 & ci<(1/3) replace `var'_CH_33vu=1 if `var'==1 & h_33p<. & ci>=0.2 & ci<(1/3) replace `var'_CH_33vu=. if missing==1 } gen ceduvu = (child_noattendhh_CH_33vu * w_child_noattendhh) + (educ_depriv_CH_33vu * w_educ_depriv) sum ceduvu [iw=weight] if h_33p<. & ci>=0.2 & ci<(1/3) scalar mpi_eduvu=r(mean) gen chealthvu = (undernutritionhh_CH_33vu * w_undernutritionhh) sum chealthvu [iw=weight] if h_33p<. & ci>=0.2 & ci<(1/3) scalar mpi_healthvu=r(mean) gen clsvu = (asset_depriv_CH_33vu * w_asset_depriv) + (electricity_depriv_CH_33vu * w_electricity_depriv) + (sanitation_depriv_CH_33vu * w_sanitation_depriv) + (water_depriv_CH_33vu * w_water_depriv) + (floor_depriv_CH_33vu * w_floor_depriv) + (cookingfuel_depriv_CH_33vu * w_cookingfuel_depriv) sum clsvu [iw=weight] if h_33p<. & ci>=0.2 & ci<(1/3) scalar mpi_lsvu=r(mean) sum ci [iw=weight] if h_33p<. & ci>=0.2 & ci<(1/3) scalar headcountvu = r(mean) *scalar mpivu=headcountvu*intensityvu scalar headcountvu100=headcountvu*100 *scalar intensityvu100=intensityvu*100 scalar edu_contribvu = (mpi_eduvu/headcountvu100)*10000 scalar health_contribvu = (mpi_healthvu/headcountvu100)*10000 scalar ls_contribvu = (mpi_lsvu/headcountvu100)*10000 * CONTRIBUTION OF EACH DIMENSION FOR THE VULNERABLE + POOR POEPLE (ci >= 0.2) capture drop *vupo foreach var in `varlist_pov' { gen `var'_CH_33vupo=0 if h_33p<. & ci>=0.2 & ci<. replace `var'_CH_33vupo=1 if `var'==1 & h_33p<. & ci>=0.2 & ci<. replace `var'_CH_33vupo=. if missing==1 } gen ceduvupo = (child_noattendhh_CH_33vupo * w_child_noattendhh) + (educ_depriv_CH_33vupo * w_educ_depriv) sum ceduvupo [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar mpi_eduvupo=r(mean) gen chealthvupo = (undernutritionhh_CH_33vupo * w_undernutritionhh) sum chealthvupo [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar mpi_healthvupo=r(mean) gen clsvupo = (asset_depriv_CH_33vupo * w_asset_depriv) + (electricity_depriv_CH_33vupo * w_electricity_depriv) + (sanitation_depriv_CH_33vupo * w_sanitation_depriv) + (water_depriv_CH_33vupo * w_water_depriv) + (floor_depriv_CH_33vupo * w_floor_depriv) + (cookingfuel_depriv_CH_33vupo * w_cookingfuel_depriv) sum clsvupo [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar mpi_lsvupo=r(mean) sum ci [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar headcountvupo = r(mean) scalar headcountvupo100=headcountvupo*100 scalar edu_contribvupo = (mpi_eduvupo/headcountvupo100)*10000 scalar health_contribvupo = (mpi_healthvupo/headcountvupo100)*10000 scalar ls_contribvupo = (mpi_lsvupo/headcountvupo100)*10000 scalar list mpi headcount100 intensity100 vulnerable0 vulnerable20 severity edu_contrib health_contrib ls_contrib edu_contribvu health_contribvu ls_contribvu edu_contribvupo health_contribvupo ls_contribvupo cv_ineq_poor cv_ineq_positive cv_ineq_hc hh_sample_tot hh_sample_used hh_sample_used_w ind_sample_tot ind_sample_used ind_sample_used_w gen sample6y=1 if h_33p<. sort hh1 hh2 ln ** THERE IS NO NEED TO COMPUTE AND MERGE THE ORIGINAL MPI INDICATORS. I DID IT TO ONLY TO COMPARE. WITHOUT MERGING, THE VARIABLE SAMPLE_ALL WILL TAKE VALUE 1 FOR EVERY OBSERVATION, PROVIDED THAT THERE IS NO SELECTION OF HHs FOR ANTHROPOMETRICS** gen ineligible=0 replace ineligible=1 if (whh==0 & hhmember0_5==0) gen sample_all=1 /* ALWAYS CHECK THAT THERE IS NOT A SELECTION RULE FOR HHs TO BE TAKEN ANTHROPOMETRICS */ sort hh1 hh2 ln save "Surinam_MPI2_2010_final.dta", replace capture log close ******************** *** RE-WEIGHTING *** ******************** clear use "Surinam_MPI2_2010_final.dta", clear gen age_group=1 if age>=0 & age<=5 replace age_group=2 if age>=6 & age<=14 replace age_group=3 if age>=15 & age<=49 replace age_group=4 if age>=50 & age<. set more off scalar drop _all forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { sum sample_all [w=weight] if age_group==`a' & sex==`s' & urban==`u' scalar sample_`a'_`s'_`u' = r(sum_w) } } } *************************************************************************** **** MISSING IN THE 3 VARIABLES (we don't observe sex, age and urban) ***** *************************************************************************** sum sample_all [w=weight] if (sex==. & urb==. & age_g==.) | (sex<. & urb<. & age_g<.) scalar sample_mnm = r(sum_w) sum sample_all [w=weight] if (sex<. & urb<. & age_g<.) scalar sample_nm = r(sum_w) scalar ratio_all = sample_mnm / sample_nm forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { scalar sample_nm_`a'_`s'_`u' = ratio_all * sample_`a'_`s'_`u' } } } ************************************************************************************** **** MPI SAMPLE MISSING IN THE 3 VARIABLES (we don't observe sex, age and urban) ***** ************************************************************************************** * NEW MPI SAMPLE forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { sum sample_all [w=weight] if age_group==`a' & sex==`s' & urban==`u' & sample6y==1 scalar sample_`a'_`s'_`u'_6y = r(sum_w) } } } sum sample_all [w=weight] if sample6y==1 & ((sex==. & urb==. & age_g==.) | (sex<. & urb<. & age_g<.)) scalar sample_mnm_6y = r(sum_w) sum sample_all [w=weight] if (sex<. & urb<. & age_g<.) & sample6y==1 scalar sample_nm_6y = r(sum_w) scalar ratio_all_6y = sample_mnm_6y / sample_nm_6y forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { scalar sample_nm_`a'_`s'_`u'_6y = ratio_all_6y * sample_`a'_`s'_`u'_6y } } } ************************************************************************************** **** MISSING IN TWO VARIABLES AT A TIME (we only observe one: sex, age or urban) ***** ************************************************************************************** * ONLY OBSERVE SEX forvalues s = 0(1)1 { sum sample_all [w=weight] if sex==`s' & (sex<. & urb==. & age_g==.) scalar sample_m_`s's_onlysex = r(sum_w) sum sample6y [w=weight] if sex==`s' & (sex<. & urb==. & age_g==.) scalar sample_m_`s's_onlysex_6y = r(sum_w) } forvalues s = 0(1)1 { scalar samplenew_`s's = sample_nm_4_`s'_1 + sample_nm_4_`s'_0 + sample_nm_3_`s'_1 + sample_nm_3_`s'_0 + sample_nm_2_`s'_1 + sample_nm_2_`s'_0 + sample_nm_1_`s'_1 + sample_nm_1_`s'_0 scalar samplenew_`s's_onlysex = samplenew_`s's + sample_m_`s's_onlysex scalar samplenew_`s's_6y = sample_nm_4_`s'_1_6y + sample_nm_4_`s'_0_6y + sample_nm_3_`s'_1_6y + sample_nm_3_`s'_0_6y + sample_nm_2_`s'_1_6y + sample_nm_2_`s'_0_6y + sample_nm_1_`s'_1_6y + sample_nm_1_`s'_0_6y scalar samplenew_`s's_onlysex_6y = samplenew_`s's_6y + sample_m_`s's_onlysex_6y } forvalues s = 0(1)1 { scalar ratio_`s's_onlysex = samplenew_`s's_onlysex / samplenew_`s's scalar ratio_`s's_onlysex_6y = samplenew_`s's_onlysex_6y / samplenew_`s's_6y } forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { scalar sample_onlysex_`a'a_`s's_`u'u_all = sample_nm_`a'_`s'_`u' * ratio_`s's_onlysex scalar sample_onlysex_`a'a_`s's_`u'u_6y = sample_nm_`a'_`s'_`u'_6y * ratio_`s's_onlysex_6y } } } * ONLY OBSERVE AGE forvalues a = 1(1)4 { sum sample_all [w=weight] if age_g==`a' & (sex==. & urb==. & age_g<.) scalar sample_m_`a'a_onlyage = r(sum_w) sum sample6y [w=weight] if age_g==`a' & (sex==. & urb==. & age_g<.) scalar sample_m_`a'a_onlyage_6y = r(sum_w) } forvalues a = 1(1)4 { scalar samplenew_`a'a = sample_onlysex_`a'a_1s_1u_all + sample_onlysex_`a'a_1s_0u_all + sample_onlysex_`a'a_0s_1u_all + sample_onlysex_`a'a_0s_0u_all scalar samplenew_`a'a_onlyage = samplenew_`a'a + sample_m_`a'a_onlyage scalar samplenew_`a'a_6y = sample_onlysex_`a'a_1s_1u_6y + sample_onlysex_`a'a_1s_0u_6y + sample_onlysex_`a'a_0s_1u_6y + sample_onlysex_`a'a_0s_0u_6y scalar samplenew_`a'a_onlyage_6y = samplenew_`a'a_6y + sample_m_`a'a_onlyage_6y } forvalues a = 1(1)4 { scalar ratio_`a'a_onlyage = samplenew_`a'a_onlyage / samplenew_`a'a scalar ratio_`a'a_onlyage_6y = samplenew_`a'a_onlyage_6y / samplenew_`a'a_6y } forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { scalar sample_onlyage_`a'a_`s's_`u'u_all = sample_onlysex_`a'a_`s's_`u'u_all * ratio_`a'a_onlyage scalar sample_onlyage_`a'a_`s's_`u'u_6y = sample_onlysex_`a'a_`s's_`u'u_6y * ratio_`a'a_onlyage_6y } } } * ONLY OBSERVE URBAN forvalues u = 0(1)1 { sum sample_all [w=weight] if urban==`u' & (sex==. & urb<. & age_g==.) scalar sample_m_`u'u_onlyurb = r(sum_w) sum sample6y [w=weight] if urban==`u' & (sex==. & urb<. & age_g==.) scalar sample_m_`u'u_onlyurb_6y = r(sum_w) } forvalues u = 0(1)1 { scalar samplenew_`u'u = sample_onlyage_4a_1s_`u'u_all + sample_onlyage_4a_0s_`u'u_all + sample_onlyage_3a_1s_`u'u_all + sample_onlyage_3a_0s_`u'u_all + sample_onlyage_2a_1s_`u'u_all + sample_onlyage_2a_0s_`u'u_all + sample_onlyage_1a_1s_`u'u_all + sample_onlyage_1a_0s_`u'u_all scalar samplenew_`u'u_onlyurb = samplenew_`u'u + sample_m_`u'u_onlyurb scalar samplenew_`u'u_6y = sample_onlyage_4a_1s_`u'u_6y + sample_onlyage_4a_0s_`u'u_6y + sample_onlyage_3a_1s_`u'u_6y + sample_onlyage_3a_0s_`u'u_6y + sample_onlyage_2a_1s_`u'u_6y + sample_onlyage_2a_0s_`u'u_6y + sample_onlyage_1a_1s_`u'u_6y + sample_onlyage_1a_0s_`u'u_6y scalar samplenew_`u'u_onlyurb_6y = samplenew_`u'u_6y + sample_m_`u'u_onlyurb_6y } forvalues u = 0(1)1 { scalar ratio_`u'u_onlyurb = samplenew_`u'u_onlyurb / samplenew_`u'u scalar ratio_`u'u_onlyurb_6y = samplenew_`u'u_onlyurb_6y / samplenew_`u'u_6y } forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { scalar sample_onlyurb_`a'a_`s's_`u'u_all = sample_onlyage_`a'a_`s's_`u'u_all * ratio_`u'u_onlyurb scalar sample_onlyurb_`a'a_`s's_`u'u_6y = sample_onlyage_`a'a_`s's_`u'u_6y * ratio_`u'u_onlyurb_6y } } } *********************************************************************** **** MISSING IN ONE VARIABLE AT A TIME (either sex, age or urban) ***** *********************************************************************** * missing sex forvalues a=1(1)4 { forvalues u=0(1)1 { sum sample_all [w=weight] if age_group==`a' & urban==`u' & (sex==. & age_g<. & urban<.) scalar sample_m_`a'a_`u'u = r(sum_w) sum sample6y [w=weight] if age_group==`a' & urban==`u' & (sex==. & age_g<. & urban<.) scalar sample_m_`a'a_`u'u_6y = r(sum_w) } } * SEX MISSING: COLLAPSE THE 16 GROUPS INTO 8 GROUPS (AGE-URBAN) forvalues a=1(1)4 { forvalues u=0(1)1 { scalar samplenew_`a'a_`u'u = sample_onlyurb_`a'a_1s_`u'u_all + sample_onlyurb_`a'a_0s_`u'u_all scalar samplenew_`a'a_`u'u_sexm = samplenew_`a'a_`u'u + sample_m_`a'a_`u'u scalar samplenew_`a'a_`u'u_6y = sample_onlyurb_`a'a_1s_`u'u_6y + sample_onlyurb_`a'a_0s_`u'u_6y scalar samplenew_`a'a_`u'u_sexm_6y = samplenew_`a'a_`u'u_6y + sample_m_`a'a_`u'u_6y } } forvalues a=1(1)4 { forvalues u = 0(1)1 { scalar ratio_`a'a_`u'u = samplenew_`a'a_`u'u_sexm / samplenew_`a'a_`u'u scalar ratio_`a'a_`u'u_6y = samplenew_`a'a_`u'u_sexm_6y / samplenew_`a'a_`u'u_6y } } forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { scalar sample_sexmis_`a'a_`s's_`u'u_all = sample_onlyurb_`a'a_`s's_`u'u_all * ratio_`a'a_`u'u scalar sample_sexmis_`a'a_`s's_`u'u_6y = sample_onlyurb_`a'a_`s's_`u'u_6y * ratio_`a'a_`u'u_6y } } } * missing age forvalues s=0(1)1 { forvalues u=0(1)1 { sum sample_all [w=weight] if sex==`s' & urban==`u' & (sex<. & age_g==. & urban<.) scalar sample_m_`s's_`u'u = r(sum_w) sum sample6y [w=weight] if sex==`s' & urban==`u' & (sex<. & age_g==. & urban<.) scalar sample_m_`s's_`u'u_6y = r(sum_w) } } * AGE MISSING: COLLAPSE THE 16 GROUPS INTO 4 GROUPS (SEX-URBAN) forvalues s=0(1)1 { forvalues u=0(1)1 { scalar samplenew_`s's_`u'u = sample_sexmis_4a_`s's_`u'u_all + sample_sexmis_3a_`s's_`u'u_all + sample_sexmis_2a_`s's_`u'u_all + sample_sexmis_1a_`s's_`u'u_all scalar samplenew_`s's_`u'u_agem = samplenew_`s's_`u'u + sample_m_`s's_`u'u scalar samplenew_`s's_`u'u_6y = sample_sexmis_4a_`s's_`u'u_6y + sample_sexmis_3a_`s's_`u'u_6y + sample_sexmis_2a_`s's_`u'u_6y + sample_sexmis_1a_`s's_`u'u_6y scalar samplenew_`s's_`u'u_agem_6y = samplenew_`s's_`u'u_6y + sample_m_`s's_`u'u_6y } } forvalues s=0(1)1 { forvalues u = 0(1)1 { scalar ratio_`s's_`u'u = samplenew_`s's_`u'u_agem / samplenew_`s's_`u'u scalar ratio_`s's_`u'u_6y = samplenew_`s's_`u'u_agem_6y / samplenew_`s's_`u'u_6y } } forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { scalar sample_agemis_`a'a_`s's_`u'u_all = sample_sexmis_`a'a_`s's_`u'u_all * ratio_`s's_`u'u scalar sample_agemis_`a'a_`s's_`u'u_6y = sample_sexmis_`a'a_`s's_`u'u_6y * ratio_`s's_`u'u_6y } } } * missing urban forvalues a=1(1)4 { forvalues s=0(1)1 { sum sample_all [w=weight] if age_g==`a' & sex==`s' & (sex<. & age_g<. & urban==.) scalar sample_m_`a'a_`s's = r(sum_w) sum sample6y [w=weight] if age_g==`a' & sex==`s' & (sex<. & age_g<. & urban==.) scalar sample_m_`a'a_`s's_6y = r(sum_w) } } * URBAN MISSING: COLLAPSE THE 16 GROUPS INTO 8 GROUPS (AGE-SEX) forvalues a=1(1)4 { forvalues s=0(1)1 { scalar samplenew_`a'a_`s's = sample_agemis_`a'a_`s's_1u_all + sample_agemis_`a'a_`s's_0u_all scalar samplenew_`a'a_`s's_urbm = samplenew_`a'a_`s's + sample_m_`a'a_`s's scalar samplenew_`a'a_`s's_6y = sample_agemis_`a'a_`s's_1u_6y + sample_agemis_`a'a_`s's_0u_6y scalar samplenew_`a'a_`s's_urbm_6y = samplenew_`a'a_`s's_6y + sample_m_`a'a_`s's_6y } } forvalues a=1(1)4 { forvalues s = 0(1)1 { scalar ratio_`a'a_`s's = samplenew_`a'a_`s's_urbm / samplenew_`a'a_`s's scalar ratio_`a'a_`s's_6y = samplenew_`a'a_`s's_urbm_6y / samplenew_`a'a_`s's_6y } } forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { scalar sample_urbmis_`a'a_`s's_`u'u_all = sample_agemis_`a'a_`s's_`u'u_all * ratio_`a'a_`s's scalar sample_urbmis_`a'a_`s's_`u'u_6y = sample_agemis_`a'a_`s's_`u'u_6y * ratio_`a'a_`s's_6y } } } ********************************************************************** *** CORRECTING THE ORIGINAL WEIGHTS FOR EVERYONE IN THE MPI SAMPLE *** ********************************************************************** * COLLAPSE THE CORRECTED CELLS INTO DIFFERENT GROUPS ACCORDING TO THEIR MISSINGS TO CORRECT THE WEIGHTS OF THE OBSERVATIONS IN THE MPI SAMPLE WITH MISSINGS IN AGE, SEX AND OR URBAN * SEX, AGE AND URBAN MISSING scalar total_all = sample_urbmis_4a_1s_1u_all + sample_urbmis_4a_1s_0u_all + sample_urbmis_4a_0s_1u_all + sample_urbmis_4a_0s_0u_all + sample_urbmis_3a_1s_1u_all + sample_urbmis_3a_1s_0u_all + sample_urbmis_3a_0s_1u_all + sample_urbmis_3a_0s_0u_all + sample_urbmis_2a_1s_1u_all + sample_urbmis_2a_1s_0u_all + sample_urbmis_2a_0s_1u_all + sample_urbmis_2a_0s_0u_all + sample_urbmis_1a_1s_1u_all + sample_urbmis_1a_1s_0u_all + sample_urbmis_1a_0s_1u_all + sample_urbmis_1a_0s_0u_all scalar total_6y = sample_urbmis_4a_1s_1u_6y + sample_urbmis_4a_1s_0u_6y + sample_urbmis_4a_0s_1u_6y + sample_urbmis_4a_0s_0u_6y + sample_urbmis_3a_1s_1u_6y + sample_urbmis_3a_1s_0u_6y + sample_urbmis_3a_0s_1u_6y + sample_urbmis_3a_0s_0u_6y + sample_urbmis_2a_1s_1u_6y + sample_urbmis_2a_1s_0u_6y + sample_urbmis_2a_0s_1u_6y + sample_urbmis_2a_0s_0u_6y + sample_urbmis_1a_1s_1u_6y + sample_urbmis_1a_1s_0u_6y + sample_urbmis_1a_0s_1u_6y + sample_urbmis_1a_0s_0u_6y scalar ratio_total = total_all / total_6y * ONLY OBSERVE SEX forvalues s = 0(1)1 { scalar total_sex`s'_all = sample_urbmis_4a_`s's_1u_all + sample_urbmis_4a_`s's_0u_all + sample_urbmis_3a_`s's_1u_all + sample_urbmis_3a_`s's_0u_all + sample_urbmis_2a_`s's_1u_all + sample_urbmis_2a_`s's_0u_all + sample_urbmis_1a_`s's_1u_all + sample_urbmis_1a_`s's_0u_all scalar total_sex`s'_6y = sample_urbmis_4a_`s's_1u_6y + sample_urbmis_4a_`s's_0u_6y + sample_urbmis_3a_`s's_1u_6y + sample_urbmis_3a_`s's_0u_6y + sample_urbmis_2a_`s's_1u_6y + sample_urbmis_2a_`s's_0u_6y + sample_urbmis_1a_`s's_1u_6y + sample_urbmis_1a_`s's_0u_6y scalar ratio_total_sex`s' = total_sex`s'_all / total_sex`s'_6y } * ONLY OBSERVE AGE forvalues a = 1(1)4 { scalar total_age`a'_all = sample_urbmis_`a'a_1s_1u_all + sample_urbmis_`a'a_1s_0u_all + sample_urbmis_`a'a_0s_1u_all + sample_urbmis_`a'a_0s_0u_all scalar total_age`a'_6y = sample_urbmis_`a'a_1s_1u_6y + sample_urbmis_`a'a_1s_0u_6y + sample_urbmis_`a'a_0s_1u_6y + sample_urbmis_`a'a_0s_0u_6y scalar ratio_total_age`a' = total_age`a'_all / total_age`a'_6y } * ONLY OBSERVE URBAN forvalues u = 0(1)1 { scalar total_urb`u'_all = sample_urbmis_4a_1s_`u'u_all + sample_urbmis_4a_0s_`u'u_all + sample_urbmis_3a_1s_`u'u_all + sample_urbmis_3a_0s_`u'u_all + sample_urbmis_2a_1s_`u'u_all + sample_urbmis_2a_0s_`u'u_all + sample_urbmis_1a_1s_`u'u_all + sample_urbmis_1a_0s_`u'u_all scalar total_urb`u'_6y = sample_urbmis_4a_1s_`u'u_6y + sample_urbmis_4a_0s_`u'u_6y + sample_urbmis_3a_1s_`u'u_6y + sample_urbmis_3a_0s_`u'u_6y + sample_urbmis_2a_1s_`u'u_6y + sample_urbmis_2a_0s_`u'u_6y + sample_urbmis_1a_1s_`u'u_6y + sample_urbmis_1a_0s_`u'u_6y scalar ratio_total_urb`u' = total_urb`u'_all / total_urb`u'_6y } * SEX MISSING ONLY forvalues a = 1(1)4 { forvalues u = 0(1)1 { scalar total_sexmis_`a'a_`u'u_all = sample_urbmis_`a'a_1s_`u'u_all + sample_urbmis_`a'a_0s_`u'u_all scalar total_sexmis_`a'a_`u'u_6y = sample_urbmis_`a'a_1s_`u'u_6y + sample_urbmis_`a'a_0s_`u'u_6y scalar ratio_total_sexmis_`a'a_`u'u = total_sexmis_`a'a_`u'u_all / total_sexmis_`a'a_`u'u_6y } } * AGE MISSING ONLY forvalues s = 0(1)1 { forvalues u = 0(1)1 { scalar total_agemis_`s's_`u'u_all = sample_urbmis_4a_`s's_`u'u_all + sample_urbmis_3a_`s's_`u'u_all + sample_urbmis_2a_`s's_`u'u_all + sample_urbmis_1a_`s's_`u'u_all scalar total_agemis_`s's_`u'u_6y = sample_urbmis_4a_`s's_`u'u_6y + sample_urbmis_3a_`s's_`u'u_6y + sample_urbmis_2a_`s's_`u'u_6y + sample_urbmis_1a_`s's_`u'u_6y scalar ratio_total_agemis_`s's_`u'u = total_agemis_`s's_`u'u_all / total_agemis_`s's_`u'u_6y } } * URBAN MISSING ONLY forvalues a = 1(1)4 { forvalues s = 0(1)1 { scalar total_urbmis_`a'a_`s's_all = sample_urbmis_`a'a_`s's_1u_all + sample_urbmis_`a'a_`s's_0u_all scalar total_urbmis_`a'a_`s's_6y = sample_urbmis_`a'a_`s's_1u_6y + sample_urbmis_`a'a_`s's_0u_6y scalar ratio_total_urbmis_`a'a_`s's = total_urbmis_`a'a_`s's_all / total_urbmis_`a'a_`s's_6y } } * DEFINE THE RATIOS FOR NON-MISSING VALUES IN SEX, AGE AND URBAN forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { scalar sample_all_`a'_`s'_`u'_w = sample_urbmis_`a'a_`s's_`u'u_all / sample_urbmis_`a'a_`s's_`u'u_6y } } } capture drop weight_w gen weight_w = weight if sample6y==1 *& age_group<. & sex<. & urban<. forvalues a=1(1)4 { forvalues s=0(1)1 { forvalues u=0(1)1 { replace weight_w = weight * sample_all_`a'_`s'_`u'_w if age_group==`a' & sex==`s' & urban==`u' & sample6y==1 } } } replace weight_w = weight * ratio_total if sample6y==1 & age_group==. & sex==. & urban==. forvalues s=0(1)1 { replace weight_w = weight * ratio_total_sex`s' if sample6y==1 & age_group==. & sex==`s' & urban==. } forvalues a=1(1)4 { replace weight_w = weight * ratio_total_age`a' if sample6y==1 & age_group==`a' & sex==. & urban==. } forvalues u=0(1)1 { replace weight_w = weight * ratio_total_urb`u' if sample6y==1 & age_group==. & sex==. & urban==`u' } forvalues a = 1(1)4 { forvalues u = 0(1)1 { replace weight_w = weight * ratio_total_sexmis_`a'a_`u'u if sample6y==1 & age_group==`a' & sex==. & urban==`u' } } forvalues s = 0(1)1 { forvalues u = 0(1)1 { replace weight_w = weight * ratio_total_agemis_`s's_`u'u if sample6y==1 & age_group==. & sex==`s' & urban==`u' } } forvalues a = 1(1)4 { forvalues s = 0(1)1 { replace weight_w = weight * ratio_total_urbmis_`a'a_`s's if sample6y==1 & age_group==`a' & sex==`s' & urban==. } } sort hh1 hh2 hhid save "Surinam_MPI2_2010_final_w.dta", replace * OPEN DATA WITH NEW WEIGHT FOR HH USED IN NEW MPI (CORRECTS FOR THE EXCLUSION OF HHs WITHOUT ELIGIBLE POP) ** ADAPTED BY CECILIA ON JULY 8 2013 ** ** Surinam 2010 ** clear set more off set maxvar 10000 set mem 500m cap log close *** Replace here your path to the dataset*** cd "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Surinam 2010_MICS\" *** Replace here the name of your dataset*** capture log close log using "M0_dofile_Surinam2010_MPI2_w.log", text replace use "Surinam_MPI2_2010_final_w.dta", clear capture drop ls-uno ********************************************************************************* ******* Define the deprivation matrix **************************************** ********************************************************************************* *** The dataset can be interpreted as the matrix of achivemnts *** We will now crate the deprivation matrix based on the indicator definition; and deprivation cut-off defined by you *** during the last working session on the normative Issues in Multidimensional Poverty Measure *** In order to do this, we will generate a new variable for each indicator contained in our measure *** This will identify with 0 individuals or households who are not deprived in the specific indicator *** and identify with 1 individual deprived in the specific indicator. *** Note that you will need to replace with dot "." if the information is missing or inconsistent. *** We will assess later the frequency of missing values. ** DEPRIVED IN DRINKING WATER ** (the individual -HH- is considered deprived in drinking water is: unprotected well, spring, river/lake/pond or other) /*lookfor water codebook b2q12, tab(20) gen d_dwater=(b2q12==5 | b2q12==6 | b2q12==7 | b2q12==8) replace d_dwater=. if b2q12==. tab b2q12 d_dwater [aw=weight], miss label variable d_dwater "Deprived in drinking water"ic*/ ** Please follow the same logic for all indicators. ** Note that for advance indicator you may have to use more complex algorithms ***************************************************************************** ******** Create a local variable with all your indicators ********* ***************************************************************************** local varlist_pov electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv educ_depriv child_noattendhh undernutritionhh ***************************************************************************** **** Define the weights ***************************** ***************************************************************************** ** Create a loop for the variables with the same weight ********************* ***************************************************************************** egen ls=rowmiss(electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv) gen hh_missing=0 replace hh_missing=1 if educ_depriv==. | nutrihh==2 | attehh==2 | (ls>0 & ls<.) foreach var in electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv { gen w_`var'=1/18 if ls==0 } gen w_undernutritionhh = 1/3 if nutrihh==1 | nutrihh==3 | nutrihh==4 *gen w_mortality5hh = 1/6 if morthh==1 & nutrihh==1 *replace w_mortality5hh = 1/3 if morthh==1 & nutrihh==3 *replace w_mortality5hh = 0 if morthh==3 & nutrihh==1 *gen w_undernutritionhh = 1/6 if morthh==1 & nutrihh==1 *replace w_undernutritionhh = 1/3 if morthh==3 & nutrihh==1 *replace w_undernutritionhh = 0 if morthh==1 & nutrihh==3 gen w_child_noattendhh = 1/6 if attehh==1 | attehh==3 gen w_educ_depriv = 1/6 if educ_depriv<. ******************************************************************* ********* Define the weigthed deprivation g0* matrix **** ******************************************************************* foreach var in `varlist_pov' { gen wg0_`var' = `var'*w_`var' } ****************************************************************************** *********** Compute the frequency of missing values for indicator ************ ****************************************************************************** foreach var in `varlist_pov' { gen `var'_miss=1 if `var'==. replace `var'_miss=0 if `var'!=. } sum *_miss ******************************************************************************** ************* Define the (weighted) deprivation count vector "ci" ************ ******************************************************************************** egen ci=rsum(wg0_*) label variable ci "Deprivation Count" egen n_missing=rowmiss(wg0_*) label variable n_missing "Number of missing variables by individual" gen missing=(n_missing>0) label variable missing "Individual with missing variables" *** Check sample drop due to missing values tab missing ******************************************************************************* ***** Create de identification vector (poor/non poor) ************************* ***** and compute individual average of deprivation *************************** ******************************************************************************* forvalues x=1(1)10 { gen h_`x'0p=(ci>=`x'/10) replace h_`x'0p=. if missing==1 gen a_`x'0p=(ci) if h_`x'0p==1 replace a_`x'0p=. if missing==1 label var h_`x'0p "Condition of Multidimensional Poverty k=`x'" label var a_`x'0p "Individual Average deprivation k=`x'" } sum h_10p-a_100p [aw=weight_w] gen h_33p=(ci>=3.33/10) replace h_33p=. if missing==1 gen a_33p=(ci) if h_33p==1 replace a_33p=. if missing==1 label var h_33p "Condition of Multidimensional Poverty k=33.3" label var a_33p "Individual Average deprivation k=33.3" sum h_33p a_33p [aw=weight_w] ******************************************************************************** ******* Compute raw headcounts ****************************************** ******************************************************************************** foreach var in `varlist_pov' { gen `var'_raw=(`var') replace `var'_raw=. if missing==1 } su *_raw [iw=weight_w] ****************************************************************************** *********** Compute Censored headcount and censored headocunt **************** ****************************************************************************** ***** Please define in the first line your poverty cutoff, the example shows k=33.3 is 33.3% local k=1/3 foreach var in `varlist_pov' { *gen `var'_CH_`k'=(`var'==1 & h_`k'==1) *replace `var'_CH_`k'=. if missing==1 gen `var'_CH_33=(`var'==1 & h_33==1) replace `var'_CH_33=. if missing==1 } sum electricity_depriv_CH_33-educ_depriv_CH_33 [iw=weight_w] sum h_33 a_33 [iw=weight_w] *h = HC *a = intensity capture drop cedu chealth cls scalar drop _all gen cedu = (child_noattendhh_CH_33 * w_child_noattendhh) + (educ_depriv_CH_33 * w_educ_depriv) sum cedu [iw=weight_w] scalar mpi_edu=r(mean) gen chealth = (undernutritionhh_CH_33 * w_undernutritionhh) sum chealth [iw=weight_w] scalar mpi_health=r(mean) gen cls = (electricity_depriv_CH_33 * w_electricity_depriv) + (sanitation_depriv_CH_33 * w_sanitation_depriv) + (water_depriv_CH_33 * w_water_depriv) + (floor_depriv_CH_33 * w_floor_depriv) + (cookingfuel_depriv_CH_33 * w_cookingfuel_depriv) + (asset_depriv_CH_33 * w_asset_depriv) sum cls [iw=weight_w] scalar mpi_ls=r(mean) sum a_33p [iw=weight_w] scalar intensity = r(mean) sum h_33p [iw=weight_w] scalar headcount = r(mean) scalar mpi=headcount*intensity scalar headcount100=headcount*100 scalar intensity100=intensity*100 scalar edu_contrib = (mpi_edu/mpi)*100 scalar health_contrib = (mpi_health/mpi)*100 scalar ls_contrib = (mpi_ls/mpi)*100 capture drop uno gen uno=1 if h_33p<. sum uno [aw=weight_w] if h_33p<. scalar pop=r(sum_w) sum uno [aw=weight_w] if h_33p<. & ci>0 & ci<(1/3) scalar pop_vuln0=r(sum_w) sum uno [aw=weight_w] if h_33p<. & ci>=0.2 & ci<(1/3) scalar pop_vuln20=r(sum_w) sum uno [aw=weight_w] if h_33p<. & ci>=0.5 scalar pop_severe=r(sum_w) scalar vulnerable0=(pop_vuln0/pop)*100 scalar vulnerable20=(pop_vuln20/pop)*100 scalar severity=(pop_severe/pop)*100 * Sample size * HHs capture drop hh egen hh=group(hh1 hh2) sort age bys hh: gen n=_n gen nhh=1 if n==1 * Individuals capture drop uno gen uno=1 sum uno scalar ind_sample_tot=r(N) sum uno if h_33p<. scalar ind_sample_used=r(N) sum uno [w=weight_w] if h_33p<. scalar ind_sample_used_w=r(sum) sum nhh scalar hh_sample_tot=r(N) sum nhh if h_33p<. scalar hh_sample_used=r(N) sort hh1 hh2 ln sum nhh [w=weight_w] if h_33p<. scalar hh_sample_used_w=r(sum) * Inequality sum a_33p [aw=weight_w] scalar cv_ineq_poor = r(sd)/r(mean) sum ci [aw=weight_w] if h_33p<. scalar cv_ineq_hc = r(sd)/r(mean) sum ci [aw=weight_w] if h_33p<. & ci>0 scalar cv_ineq_positive = r(sd)/r(mean) * CONTRIBUTION OF EACH DIMENSION FOR THE VULNERABLE POEPLE capture drop *vu foreach var in `varlist_pov' { gen `var'_CH_33vu=0 if h_33p<. & ci>=0.2 & ci<(1/3) replace `var'_CH_33vu=1 if `var'==1 & h_33p<. & ci>=0.2 & ci<(1/3) replace `var'_CH_33vu=. if missing==1 } gen ceduvu = (child_noattendhh_CH_33vu * w_child_noattendhh) + (educ_depriv_CH_33vu * w_educ_depriv) sum ceduvu [iw=weight_w] if h_33p<. & ci>=0.2 & ci<(1/3) scalar mpi_eduvu=r(mean) gen chealthvu = (undernutritionhh_CH_33vu * w_undernutritionhh) sum chealthvu [iw=weight_w] if h_33p<. & ci>=0.2 & ci<(1/3) scalar mpi_healthvu=r(mean) gen clsvu = (asset_depriv_CH_33vu * w_asset_depriv) + (electricity_depriv_CH_33vu * w_electricity_depriv) + (sanitation_depriv_CH_33vu * w_sanitation_depriv) + (water_depriv_CH_33vu * w_water_depriv) + (floor_depriv_CH_33vu * w_floor_depriv) + (cookingfuel_depriv_CH_33vu * w_cookingfuel_depriv) sum clsvu [iw=weight_w] if h_33p<. & ci>=0.2 & ci<(1/3) scalar mpi_lsvu=r(mean) sum ci [iw=weight_w] if h_33p<. & ci>=0.2 & ci<(1/3) scalar headcountvu = r(mean) scalar headcountvu100=headcountvu*100 scalar edu_contribvu = (mpi_eduvu/headcountvu100)*10000 scalar health_contribvu = (mpi_healthvu/headcountvu100)*10000 scalar ls_contribvu = (mpi_lsvu/headcountvu100)*10000 * CONTRIBUTION OF EACH DIMENSION FOR THE VULNERABLE + POOR POEPLE (ci >= 0.2) capture drop *vupo foreach var in `varlist_pov' { gen `var'_CH_33vupo=0 if h_33p<. & ci>=0.2 & ci<. replace `var'_CH_33vupo=1 if `var'==1 & h_33p<. & ci>=0.2 & ci<. replace `var'_CH_33vupo=. if missing==1 } gen ceduvupo = (child_noattendhh_CH_33vupo * w_child_noattendhh) + (educ_depriv_CH_33vupo * w_educ_depriv) sum ceduvupo [iw=weight_w] if h_33p<. & ci>=0.2 & ci<. scalar mpi_eduvupo=r(mean) gen chealthvupo = (undernutritionhh_CH_33vupo * w_undernutritionhh) sum chealthvupo [iw=weight_w] if h_33p<. & ci>=0.2 & ci<. scalar mpi_healthvupo=r(mean) gen clsvupo = (asset_depriv_CH_33vupo * w_asset_depriv) + (electricity_depriv_CH_33vupo * w_electricity_depriv) + (sanitation_depriv_CH_33vupo * w_sanitation_depriv) + (water_depriv_CH_33vupo * w_water_depriv) + (floor_depriv_CH_33vupo * w_floor_depriv) + (cookingfuel_depriv_CH_33vupo * w_cookingfuel_depriv) sum clsvupo [iw=weight_w] if h_33p<. & ci>=0.2 & ci<. scalar mpi_lsvupo=r(mean) sum ci [iw=weight_w] if h_33p<. & ci>=0.2 & ci<. scalar headcountvupo = r(mean) scalar headcountvupo100=headcountvupo*100 scalar edu_contribvupo = (mpi_eduvupo/headcountvupo100)*10000 scalar health_contribvupo = (mpi_healthvupo/headcountvupo100)*10000 scalar ls_contribvupo = (mpi_lsvupo/headcountvupo100)*10000 scalar list mpi headcount100 intensity100 vulnerable0 vulnerable20 severity edu_contrib health_contrib ls_contrib edu_contribvu health_contribvu ls_contribvu edu_contribvupo health_contribvupo ls_contribvupo cv_ineq_poor cv_ineq_positive cv_ineq_hc hh_sample_tot hh_sample_used hh_sample_used_w ind_sample_tot ind_sample_used ind_sample_used_w sum sample_all [w=weight] scalar sall = r(sum) sum sample6y [w=weight_w] scalar smpi = r(sum) scalar list sall smpi ************************************ ** ALWAYS CHECK THAT sall = smpi ** ************************************