** Jamaica 2012 ** ** 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\Jamaica 2012_JSLC\" /*use "hhsizes.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } sort parish const district dwelling hh save "hhsizes_MCC.dta", replace use "LFSapr2010.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } keep par const ed dwell hh ind resp fname lname relat sex age rfact urcode ren par parish ren ed district ren dwell dwelling sort parish const district dwelling hh merge parish const district dwelling hh using "hhsizes_MCC.dta" ta _merge *drop _merge save "LFSapr2012_MCC.dta", replace*/ use "rec026.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } ******************************** ** LIVING STANDARD INDICATORS ** ******************************** gen electricity = 1 if i29==1 replace electricity=0 if i29==2 | i29==3 | i29==4 gen sanitation = 0 if i4==3 | i5==3 | i5==4 | i5==5 replace sanitation = 1 if i5==1 | i5==2 replace sanitation = 0 if i6==2 /*shared*/ gen water = 1 if i22==1 | i22==2 | i22==3 | i22==6 | i22==7 replace water = 0 if i22==4 | i22==5 | i22==8 | i22==9 | i22==10 | i22==11 | i22==12 | i22==13 *replace water=0 if (ws4>=30 & ws4<=400) | ((ws4==998 | ws4==999) & (i22==13 | i22==14 | i22==21 | i22==31 | i22==41 | i22==51)) * there is not time to water source, there is distance in km/m but not in minutes ** distance in meters available in the survey but not time in minutes ** ** FLOOR N/A ** gen floor = . gen cookingfuel = 0 if i40==3 | i40==5 | i40==8 | i40==9 replace cookingfuel = 1 if i40==1 | i40==2 | i40==4 | i40==6 | i40==7 * 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) */ gen phone = 0 if i32_1==2 & i32_2==2 & i32_3==2 replace phone = 1 if i32_1==1 | i32_2==1 | i32_3==1 keep electricity sanitation water cookingfuel phone serial i2 i3 floor sort serial save "hh1.dta", replace use "rec027.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } foreach var in j604 j607 j608 j610 j615 j616 j617 { replace `var'=. if `var'==97 | `var'==99 replace `var'=0 if `var'==2 } gen radio = 0 if j607==0 replace radio = 1 if j607==1 gen tv = 0 if j610==0 replace tv = 1 if j610==1 * Mobility * gen bicycle = 0 if j615==0 replace bicycle = 1 if j615==1 gen motorcycle = 0 if j616==0 replace motorcycle = 1 if j616==1 gen motorboat = . gen car_truck = 0 if j617==0 replace car_truck = 1 if j617==1 gen animal_cart = . * Livelihood * gen refrigerator = 0 if j604==0 replace refrigerator = 1 if j604==1 gen land = . gen cattle = . gen horses = . gen goats = . gen sheeps = . gen chicken = . sort serial merge serial using "hh1.dta" tab _merge drop _merge egen information_miss = rowmiss(phone radio tv) egen mobility_miss = rowmiss(bicycle motorcycle car_truck) egen livelihood_miss = rowmiss(refrigerator) 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==2 | mobility_miss==3 replace mobility_depriv = 0 if bicycle==1 | motorcycle==1 | car_truck==1 replace mobility_depriv = 1 if bicycle==0 & motorcycle==0 & car_truck==0 gen livelihood_depriv = . if livelihood_miss==1 replace livelihood_depriv = 0 if refrigerator==1 replace livelihood_depriv = 1 if refrigerator==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 cookingfuel_depriv asset_depriv) replace depriv = . if electricity_depriv==. & sanitation_depriv==. & water_depriv==. & cookingfuel_depriv==. & asset_depriv==. gen ls_sample=1 if electricity_depriv<. & sanitation_depriv<. & water_depriv<. & cookingfuel_depriv<. & asset_depriv<. egen livings_miss = rowmiss(electricity_depriv sanitation_depriv water_depriv cookingfuel_depriv asset_depriv) keep electricity electricity_depriv water sanitation cookingfuel floor sanitation_depriv water_depriv floor_depriv cookingfuel_depriv depriv ls_sample livings_miss serial 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 serial save "hh_MPI2_MCC.dta", replace /* * BIRTHs' QUESTIONNAIRE TO CALCULATE WHEN THE DEATH OF A CHILD HAPPENED * *** 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 *** use "bh.dta", clear gen b7 = bh9n if bh9u==2 replace b7 = bh9n/30.416667 if bh9u==1 replace b7 = bh9n*12 if bh9u==3 ren bh4c ccdob replace ccdob=. if ccdob==9999 gen date_death = ccdob+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(serial ind) *egen child_died2=rsum(v206 v207) *compare child_died child_died2 * they are identical * egen child_died=sum(b5r), by(serial ind) egen child_died5=sum(b5r) if ydead_from_survey<=5, by(serial ind) * only deaths in the past 5 years * replace child_died5=0 if child_died5==. & child_died>=0 & child_died<. sort serial ind ydead_from_survey bys serial ind: gen uno=1 if _n==1 keep if uno==1 drop uno tab child_died child_died5,m *egen child_diedhh=sum(child_died), by(serial) *egen child_died2hh=sum(child_died2), by(serial) *egen child_died5hh=sum(child_died5), by(serial) *gen uno=1 *egen nwomen_birth_15_49=sum(uno), by(serial) *drop uno *bys serial: gen uno=1 if _n==1 *keep if uno==1 *drop uno keep child_died5 child_died serial ind sort serial ind save "child_death_MPI2_MCC.dta", replace * WOMEN'S QUESTIONNAIRE (15-49 y) * use "wm.dta", clear gen children_died=1 if cm8==1 replace children_died=0 if cm8==2 replace children_died=0 if cm1==. & ma1==3 & ma5==3 /* never married or in union */ 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<. | (ma1==3 & ma5==3)) tab children_died children_died2,m * they are identical * tab cdead children_died,m gen age_w=wb2 *egen children_diedhh=sum(children_died), by(serial) missing *gen uno=1 *egen nwomen15_49=sum(uno), by(serial) *drop uno *sort serial ind *bys serial: gen uno=1 if _n==1 *keep if uno==1 *drop uno keep serial children_died cdead cm1 cm8 ind age_w sort serial ind save "wm_MCC.dta", replace * Children data set use "ch.dta", clear replace haz2=. if hazflag==1 replace haz=. if hazflag==1 sort serial ind save "ch_MCC.dta", replace use "who_2010.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } keep household displayid weightingfactor age sex weight height isrecumbent whz haz waz baz bmi district province age1 agemth relat hhmember ren household serial ren displayid ind foreach var in age sex weight height isrecumbent whz haz waz baz bmi district province age1 agemth relat hhmember { ren `var' `var'_who } sort serial ind save "who_2012_MCC.dta", replace */ use "anthro12z.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } keep serial ind c1_dd c1_mm c1_yy c61 c62 c8 c9 sex age weight height isrecumbent whz haz waz baz bmi finwght wa_status wh_status ha_status ba_status foreach var in c1_dd c1_mm c1_yy c61 c62 c8 c9 sex age weight height isrecumbent whz haz waz baz bmi finwght wa_status wh_status ha_status ba_status { ren `var' `var'_anthro } sort serial ind save "anthro12z_MCC.dta", replace use "rec013.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } sort serial ind merge serial ind using "anthro12z_MCC.dta" tab _merge keep if _merge==3 drop _merge sort serial ind *merge serial ind using "who_2012_MCC.dta" *tab _merge *drop _merge save "anthro_MCC.dta", replace *** No need to run it every time because it is slow *** /*use "anthro_MCC.dta", clear * Variable “Sex” tab sex_anthro, miss gen gender = sex_anthro desc gender tab gender * Variable “Age”can be expresses it in months or days tab age_anthro, miss codebook age_anthro gen age_months = age_anthro desc age_months summ age_months gen str6 ageunit = "months" label var ageunit "Months" gen hc= c6_months if c6_years==0 replace hc=12+c6_months if c6_years==1 replace hc=24+c6_months if c6_years==2 replace hc=36+c6_months if c6_years==3 replace hc=48+c6_months if c6_years==4 compare hc age_anthro /* they are identical */ drop hc * Variable “body weight” – it must be in kilograms ta weight_anthro, miss codebook weight_anthro gen weight = weight_anthro desc weight replace weight=. if weight_anthro>90 & weight_anthro<. tab weight_anthro if weight_anthro==99.9 | weight_anthro==., miss summ weight * Variable “height” – it must be in centimetres ta height_anthro, miss codebook height_anthro gen height = height_anthro desc height replace height=. if height_anthro>=990 & height_anthro<. tab height_anthro if height_anthro==999.9 | height_anthro==., miss summ height codebook c12 gen measure = "l" if c12==1 replace measure = "h" if c12==2 replace measure = " " if c12==97 | c12==. | c12==99 desc measure tab measure *Variable “Oedema” gen oedema=" " desc oedema tab oedema *Variable “Sampling weight” gen sw = finwght_anthro desc sw summ sw keep serial ind gender age_months ageunit weight height oedema measure sw save "C:\Users\cecilia.calderon\Documents\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata\JAM12_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\JAM12_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="JAM12_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 serial ind save "C:\Users\cecilia.calderon\Documents\HDRO_MCC\MPI\MPI_new calculations\Jamaica 2012_JSLC\JAM12_anthro.dta", replace */ use "anthro_MCC.dta", clear sort serial ind merge serial ind using "JAM12_anthro.dta" tab _merge drop _merge gen zha = _zlen if _flen==0 gen malnourished5 = 1 if zha<=-2 replace malnourished5=0 if zha>-2 & zha<. gen zha2 = haz if _flen==0 gen malnourished52 = 1 if zha2<=-2 replace malnourished52=0 if zha2>-2 & zha2<. ta malnourished5 malnourished52,m * Although the z scores that come with the data are not always identical to the ones I calculate, the stunted classification only differs for 4 kids who are considered stunted using haz_anthro (calculated by PIOJ) but not stunted using _zlen (calculated by HDRO) * keep serial ind finwght_anthro gender agemons ageunit weight height measure oedema sw reflib datalib datalab headc muac triskin subskin _agedays _clenhei _cbmi _zwei _zlen _zbmi _zwfl _zhc _zac _zts _zss _fwfl _flen _fwei _fbmi _fhc _fac _fts _fss c8 sort serial ind save "C:\Users\cecilia.calderon\Documents\HDRO_MCC\MPI\MPI_new calculations\Jamaica 2012_JSLC\JAM12_anthro.dta", replace use "hhsizes.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } ren hh hh_number sort serial save "hhsizes_MCC.dta", replace use "rec001.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } *keep serial parish const sr district dwelling hh area edwght finwght foreach var of varlist _all { ren `var' `var'_001 } ren serial_001 serial ren ind_001 ind sort serial ind save "rec001_MCC.dta", replace use "rec003.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } keep serial ind ageyrs agemth sex relat hhmember whynotmem marital_stat marriage_yrs union_stat partner_hhm foreach var in ageyrs agemth sex relat hhmember whynotmem marital_stat marriage_yrs union_stat partner_hhm { ren `var' `var'_003 } sort serial ind save "rec003_MCC.dta", replace * INDIVIDUALS' QUESTIONNAIRE * use "educ.dta", clear foreach var of varlist _all { local x = lower("`var'") *destring `var', replace force rename `var' `x' } sort serial ind gen hh=serial egen hhid=group(serial) *sort serial ind *merge serial ind using "wm_MCC.dta" *tab _merge *ren _merge merge_women sort serial merge serial using "HH_MPI2_MCC.dta" tab _merge drop _merge *sort serial ind *merge serial ind using "child_death_MPI2_MCC.dta" *tab _merge *ren _merge merge_births sort serial ind merge serial ind using "JAM12_anthro.dta" tab _merge ren _merge merge_anthro sort serial merge serial using "hhsizes_MCC.dta" ta _merge drop _merge sort serial ind merge serial ind using "rec001_MCC.dta" ta _merge ren _merge merge_rec001 sort serial ind merge serial ind using "rec003_MCC.dta" ta _merge ren _merge merge_rec003 * merge_rec001==2: they are not members as indicated in variable hhmember_001 */ drop finwght_anthro capture ren weight weight_child capture drop sex ren sex_001 sex replace sex = 0 if sex==2 capture drop age ren ageyrs_001 age label define hhmember_001 1 "still a member" 2 "no longer a member" 3 "new member" label values hhmember_001 hhmember_001 drop if hhmember_001==2 /* no longer a member */ gen uno=1 egen hhmembers_hh=sum(uno), by(hh) compare hhmembers_hh hhsize2 label var hhmembers_hh "Number of HH members (includes those not related to the HH head)" drop uno drop if relat==97 | relat==99 /* remove those who are not related to the HH head (helper, others) */ gen uno=1 egen hhmembers=sum(uno), by(hh) compare hhmembers hhsize2 label var hhmembers "Number of HH members (excludes those not related to the HH head)" drop uno gen weight=finwght compress sort serial ind save "Jamaica_MPI2_2012.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: 3y * Entrance age high secondary: 15y * Duration high secondary: 4y gen yschooling = 0 if b4==0 | b4==1 | b21==21 * currently attending (substract one grade) replace yschooling =1 if b4==2 replace yschooling =2 if b4==3 replace yschooling =3 if b4==4 replace yschooling =4 if b4==5 replace yschooling =5 if b4==6 replace yschooling =6 if b4==7 replace yschooling =7 if b4==8 replace yschooling =8 if b4==9 replace yschooling =9 if b4==10 replace yschooling =10 if b4==11 replace yschooling =11 if b4==12 replace yschooling =12 if b4==13 * currently not attending replace yschooling =1 if b22==1 replace yschooling =2 if b22==2 replace yschooling =3 if b22==3 replace yschooling =4 if b22==4 replace yschooling =5 if b22==5 replace yschooling =6 if b22==6 replace yschooling =7 if b22==7 replace yschooling =8 if b22==8 replace yschooling =9 if b22==9 replace yschooling =10 if b22==10 replace yschooling =11 if b22==11 replace yschooling =12 if b22==12 replace yschooling =13 if b22==13 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=0 if (b21==1 | b21==2 | b21==4 | b21==6 | b21==17 | b21==18 | b21==19 | b21==20 | b1==1) & age>=12 & age<. & yschooling==. replace yschoolingi=1 if (b21==3 | b21==5 | b21==7 | b21==8 | b21==9 | b21==10 | b21==11 | b21==12 | b21==13 | b21==14 | b21==15 | b21==16 | b1==10 | b1==11 | b1==12) & yschooling==. gen schooling_missing = 1 if yschooling==. & b21>=90 & b21<. & b22>=90 & b22<. & age>=12 & age<. replace schooling_missing = 1 if yschoolingi==. & schooling_missing==. & age>=12 /* 27 observations that should be missing (checked) */ 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 b1==. & b4==. & age>=7 & age<=14 gen child_7_14=1 if age>=7 & age<=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 age>=6 & age<=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 (b1==1 | b1==2 | b1==20) & age>=7 & age<=14 replace child_noattend=0 if (b1>=3 & b1<=19) & age>=7 & age<=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 | (c8==2 | c8==97) | (age<5 & c8==.) | (c8==1 & age<5 & height==.) 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) 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 welig=1 if sex==0 & age>=15 & age<. egen welighh=sum(welig), by(serial) 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) /*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(children_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 mortality5hh=. gen region = parish gen urban=1 if area==1 | area==2 replace urban=0 if area==3 compress sort serial ind save "Jamaica_MPI2_2012.dta", replace * NON-ELIGIBLE POPULATION * gen uno7_14=1 if age>=7 & age<=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<. *** THE CASE OF Jamaica 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=. /*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 serial ind save "Jamaica_MPI2_2012.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 ** ** Jamaica 2012 ** 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\Jamaica 2012_JSLC\" *** Replace here the name of your dataset*** capture log close log using "M0_dofile_Jamaica2012_MPI2.log", text replace use "Jamaica_MPI2_2012.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 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 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 cookingfuel_depriv asset_depriv { gen w_`var'=1/15 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) + (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(serial) 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) + (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 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<. /* In original MPI we included for Jamaica 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 serial ind save "Jamaica_MPI2_2012_final.dta", replace capture log close ******************** *** RE-WEIGHTING *** ******************** clear use "Jamaica_MPI2_2012_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 serial hhid save "Jamaica_MPI2_2012_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 ** ** Jamaica 2012 ** 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\Jamaica 2012_JSLC\" *** Replace here the name of your dataset*** capture log close log using "M0_dofile_Jamaica2012_MPI2_w.log", text replace use "Jamaica_MPI2_2012_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 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 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 cookingfuel_depriv asset_depriv { gen w_`var'=1/15 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_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) + (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(serial) 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 serial ind 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) + (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) + (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 ** ************************************