** Kyrgyzstan 2014 ** ** 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. */ clear clear matrix set maxvar 7000 set more off cd "C:\Users\cecilia.calderon\Documents\HDRO_MCC\MPI\MPI_new calculations\Kyrgyzstan 2014_MICS\" use "hh.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } gen hhmembers_hh = hh11 gen urban=1 if hh6==1 replace urban=0 if hh6==2 ******************************** ** 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==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*/ /* Type of toilet facility | Freq. Percent Cum. ----------------------------------------+----------------------------------- Flush to piped sewer system | 1,297 18.04 18.04 11 y Flush to septic tank | 45 0.63 18.66 12 y Flush to pit (latrine) | 63 0.88 19.54 13 y Ventilated Improved Pit latrine (VIP) | 114 1.59 21.13 21 y Pit latrine with slab | 5,395 75.03 96.16 22 y Pit latrine without slab / Open pit | 2 0.03 96.19 23 n Bucket | 1 0.01 96.20 41 n No facility, Bush, Field | 1 0.01 96.22 95 n Missing | 16 0.22 96.44 99 . | 256 3.56 100.00 */ 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==14 | ws2==21 | ws2==31 | ws2==41 | ws2==51)) replace water = 0 if ws1==32 | ws1==42 | ws1==61 | ws1==71 | ws1==81 | ws1==96 | (ws1==91 & (ws2==32 | ws2==42 | ws2==61 | ws2==81 | ws2==96)) replace water=0 if (ws4>=30 & ws4<=401) | ((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 /* Main source of drinking water | Freq. Percent Cum. ----------------------------------------+----------------------------------- Piped into dwelling | 2,183 30.36 30.36 11 y Piped into compound, yard or plot | 1,892 26.31 56.68 12 y Piped to neighbour | 101 1.40 58.08 13 y Public tap / standpipe | 1,602 22.28 80.36 14 y Tube well, Borehole | 84 1.17 81.53 21 y Protected well | 177 2.46 83.99 31 y Unprotected well | 25 0.35 84.34 32 n Protected spring | 75 1.04 85.38 41 y Unprotected spring | 118 1.64 87.02 42 n Rainwater collection | 1 0.01 87.04 51 y Tanker-truck | 7 0.10 87.13 61 n Cart with small tank / drum | 7 0.10 87.23 71 n Surface water (river, stream, dam, lake | 650 9.04 96.27 81 n Bottled water | 3 0.04 96.31 91 Other | 9 0.13 96.44 96 n . | 256 3.56 100.00 ----------------------------------------+----------------------------------- Total | 7,190 100.00 */ 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 hc9g hc11 { 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 ** Motorboat 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 animal_cart car_truck 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 | animal_cart==1 | car_truck==1 | motorboat==1 replace mobility_depriv = 1 if bicycle==0 & motorcycle==0 & animal_cart==0 & car_truck==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 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 * use "bh.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } gen b7 = bh9n if bh9u==2 replace b7 = bh9n/30.416667 if bh9u==1 replace b7 = bh9n*12 if bh9u==3 replace bh4c=. if bh4c==9999 gen date_death = bh4c+b7 gen mdead_from_survey = wdoi-date_death *wdoi=date of interview gen ydead_from_survey = mdead_from_survey/12 gen y = ydead_from_survey if b7<=60 label var ydead_from_survey "# years from survey that a child died" label var y "# years from survey that a child<=5y died" gen b5r=0 if bh5==1 replace b5r=1 if bh5==2 egen child_died=sum(b5r), by(hh1 hh2 ln) egen child_died5=sum(b5r) if ydead_from_survey<=5, by(hh1 hh2 ln) * only deaths in the past 5 years * replace child_died5=0 if child_died5==. & child_died>=0 & child_died<. sort hh1 hh2 ln ydead_from_survey bys hh1 hh2 ln: gen uno=1 if _n==1 keep if uno==1 drop uno tab child_died child_died5,m keep child_died5 child_died hh1 hh2 ln sort hh1 hh2 ln save "child_death_MPI2_MCC.dta", replace * WOMEN'S QUESTIONNAIRE (15-49 y) * use "wm.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } gen children_died=1 if cm8==1 replace children_died=0 if cm8==2 replace children_died=0 if (cm8==. | cm8==9) & 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 * 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 foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } replace haz =. if hazflag==1 replace haz2=. if hazflag==1 sort hh1 hh2 ln save "ch_MCC.dta", replace *** Here I will recalculate weight-for-age z scores and compare the z scores with the ones provided by MICS *** *** No need to run it every time because it is slow *** /*use "ch.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } * 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 an3 an2 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 an4 an2 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 tab 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\Documents\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata\KYR14_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 maxvar 10000 /* Indicate to the Stata compiler where the igrowup_standard.ado file is stored*/ adopath + "C:\Users\cecilia.calderon\Documents\HDRO_MCC\MPI\WHO igrowup STATA\" /* Load the data file */ use "C:\Users\cecilia.calderon\Documents\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata\KYR14_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\Documents\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata" lab var datalib "Directory for datafiles" gen str30 datalab="KYR14_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 "C:\Users\cecilia.calderon\Documents\HDRO_MCC\MPI\MPI_new calculations\Kyrgyzstan 2014_MICS\KYR14_anthro.dta", replace */ * INDIVIDUALS' QUESTIONNAIRE * use "hl.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } 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 "child_death_MPI2_MCC.dta" tab _merge ren _merge merge_births replace child_died5=0 if children_died==0 & child_died5==. replace child_died=0 if children_died==0 & child_died==. 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 "KYR14_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 windex5>0 gen weight = hhweight if hhweight>0 drop if hl3==14 | hl3==96 /* 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 "Kyrgyzstan_MPI2_2014.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: 7y * Duration of primary: 4y * Entrance age of lower secondary: 11y * Durantion lower secondary: 5y * Entrance age high secondary: 16y * Duration high secondary: 2y gen yschooling = 0 if ed4a==0 | (ed4a==1 & ed4b==0) replace yschooling = 0 if ed3==2 replace yschooling =1 if ed4a==1 & ed4b==1 replace yschooling =2 if ed4a==1 & ed4b==2 replace yschooling =3 if ed4a==1 & ed4b==3 replace yschooling =4 if ed4a==1 & ed4b==4 replace yschooling =4 if ed4a==2 & ed4b==4 replace yschooling =5 if ed4a==2 & ed4b==5 replace yschooling =6 if ed4a==2 & ed4b==6 replace yschooling =7 if ed4a==2 & ed4b==7 replace yschooling =8 if ed4a==2 & ed4b==8 replace yschooling =9 if ed4a==2 & ed4b==9 replace yschooling =9 if ed4a==3 & ed4b==9 replace yschooling =10 if ed4a==3 & ed4b==10 replace yschooling =11 if ed4a==3 & ed4b==11 replace yschooling =11 if (ed4a==4 | ed4a==5 | ed4a==6) & ed4b==0 replace yschooling =12 if (ed4a==4 | ed4a==5 | ed4a==6) & ed4b==1 replace yschooling =13 if (ed4a==4 | ed4a==5 | ed4a==6) & ed4b==2 replace yschooling =14 if (ed4a==4 | ed4a==5 | ed4a==6) & ed4b==3 replace yschooling =15 if (ed4a==5 | ed4a==6) & ed4b==4 replace yschooling =16 if (ed4a==5 | ed4a==6) & ed4b==5 replace yschooling =17 if (ed4a==5 | ed4a==6) & (ed4b==6 | ed4b==7 | ed4b==8 | ed4b==9) replace yschooling=. if age<5 gen uno14=1 if age>=13 & age<. /* Number of HH members 13y or older */ bys hhid: egen hhmember14 = sum(uno14) ** 1- DEPRIVED IN EDUCATION ** gen yschoolingi=0 if yschooling<6 & age>=13 & age<. replace yschoolingi=1 if yschooling>=6 & yschooling<. replace yschoolingi=1 if yschooling==. & (ed4a==3 | ed4a==4 | ed4a==5 | ed4a==6) gen schooling_missing = 1 if (ed4a==8 | ed4a==9 | ed3==9) & age>=13 & 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 8-15Y (entrance age is 7 but we allow for 1 year of late enrollment and attendance question refers to current year) ** gen attendance_missing=1 if (ed5==9 | (ed5==. & (ed3==9 | ed3==.))) & schage>=8 & schage<=15 gen child_7_14=1 if schage>=8 & schage<=15 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>=7 & schage<=15 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>=8 & schage<=15 replace child_noattend=0 if ed5==1 & schage>=8 & schage<=15 * DEPRIVED IN SCHOOL ATTENDANCE 7-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 Kyrgyzstan 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 missing_zhahh=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 undernutritionhh=0 if malnourished5hh==0 replace undernutritionhh=1 if malnourished5hh>0 & malnourished5hh<. replace undernutritionhh=0 if undernutritionhh==. & whh>0 & hhmember0_5==0 ** 2- DEPRIVED IN MORTALITY ** capture drop uno gen uno=1 if child_died5==. & age>=15 & age<=49 & sex==0 egen missing_child_died5hh=sum(uno), by(hhid) capture drop uno gen uno=1 if child_died5<. & age>=15 & age<=49 & sex==0 egen nomissing_child_died5hh=sum(uno), by(hhid) egen child_died5hh=sum(child_died5), by(hhid) missing egen children_diedhh=sum(child_died), by(hhid) missing replace children_diedhh=0 if children_diedhh==. & whh==0 replace child_died5hh=0 if children_diedhh==0 & child_died5hh==. 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 region = hh7 compress sort hh1 hh2 ln save "Kyrgyzstan_MPI2_2014.dta", replace * NON-ELIGIBLE POPULATION * gen uno7_14=1 if schage>=8 & schage<=15 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<. *** THE CASE OF Kyrgyzstan 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 & whh>0 & whh<. replace nutrihh=4 if undernutritionhh==. & malnourished5hh==. & hhmember0_5==0 & whh==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=1 if mortality5hh<. & uno15_49hh==1 replace morthh=2 if mortality5hh==. & uno15_49hh==1 replace morthh=3 if mortality5hh==0 & uno15_49hh==0 replace mortality5hh=0 if mortality5hh==. & merge_women==1 replace mortality5hh=. if mortality5hh==0 & whh>(2*nomissing_child_died5hh) & nomissing_child_died5hh<. replace morthh=2 if morthh==1 & mortality5hh==. & whh>(2*nomissing_child_died5hh) & nomissing_child_died5hh<. label define morthh 1 "HH with mortality information" 2 "HH with missing information on mortality" 3 "HH with no eligible population for mortality (no women 15-49y)" 4 "HH with eligible population for mortality but do not appear in fertility section" label values morthh morthh compress sort hh1 hh2 ln save "Kyrgyzstan_MPI2_2014.dta", replace ** DO FILE FROM OPHI TO COMPUTE MPI ** *************************************************************************** **** Multidimensional Poverty Measure ************************************* **** OPHI-HDCA Summer School 2012 ***************************************** **** 24 August to 3 September 2012 - Delft, the Netherlands *************** *************************************************************************** ** ADAPTED BY CECILIA ON MAY 2013 ** ** Kyrgyzstan 2014 ** 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\Documents\HDRO_MCC\MPI\MPI_new calculations\Kyrgyzstan 2014_MICS\" *** Replace here the name of your dataset*** capture log close log using "M0_dofile_Kyrgyzstan2014_MPI2.log", text replace use "Kyrgyzstan_MPI2_2014.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 mortality5hh ***************************************************************************** **** 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 | morthh==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_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] 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 = (mortality5hh_CH_33 * w_mortality5hh) + (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 = (mortality5hh_CH_33vu * w_mortality5hh) + (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 headcountvu100=headcountvu*100 scalar edu_contribvu = (mpi_eduvu/headcountvu100)*10000 scalar health_contribvu = (mpi_healthvu/headcountvu100)*10000 scalar ls_contribvu = (mpi_lsvu/headcountvu100)*10000 scalar list mpi headcount100 intensity100 vulnerable0 vulnerable20 severity edu_contrib health_contrib ls_contrib edu_contribvu health_contribvu ls_contribvu 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** /* In original MPI we included for Kyrgyzstan those members that are not related to the HH head but removed those who did not sleep in the HH the night before. For the new specification we do the opposite, this is why we get values for _merge=1 and _merge=2 */ 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 "Kyrgyzstan_MPI2_2014_final.dta", replace capture log close ******************** *** RE-WEIGHTING *** ******************** clear use "Kyrgyzstan_MPI2_2014_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 "Kyrgyzstan_MPI2_2014_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 ** ** Kyrgyzstan 2014 ** 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\Documents\HDRO_MCC\MPI\MPI_new calculations\Kyrgyzstan 2014_MICS\" *** Replace here the name of your dataset*** capture log close log using "M0_dofile_Kyrgyzstan2014_MPI2_w.log", text replace use "Kyrgyzstan_MPI2_2014_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 mortality5hh ***************************************************************************** **** 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 | morthh==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_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 = (mortality5hh_CH_33 * w_mortality5hh) + (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 = (mortality5hh_CH_33vu * w_mortality5hh) + (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 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_w] if h_33p<. & ci>=0.2 & ci<. scalar mpi_eduvupo=r(mean) gen chealthvupo = (mortality5hh_CH_33vupo * w_mortality5hh) + (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 ** ************************************