** Argentina 2005 ** ** 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. */ * 1 * ********* TREAT HHs WITH NO ELIGIBLE POPULATION AS NOT DEPRIVED BUT CHANGING THE DEFINITION OF THE INDICATORS ********** ***************************************************************************************************************************************************************************** * However, unfortunately, ENNyS is the only survey we use that is not nationally representative. First, it was conducted only in urban areas; second, the sample design and survey weights do not allow nationally representative estimates in urban areas. However, we kept these estimates as a lower bound estimate of acute multidimensional poverty in the urban areas of Argentina. * ****************************************************************************************************************************************************************************** clear clear matrix set more off set maxvar 10000 cd "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Argentina ENNyS\ENNyS\" foreach var in np nr mr en { use "`var'.dta", clear **we now create the household id*** **This is extracted from the individual id rdid** ***rdid has the following structure: it is a 9 to 10 digits number where the two first ones identify the province** **the thrid and fourth identify the 'punto muestra', 5 to 8 the houshold, and 9 nd 10 the individual*** **So we divide by 10 for rdid of 9 digits, so that the last digit becomes the first decimal** format rdid %20.0g gen double rdid2=rdid/10 if rdid<999999999 format rdid2 %20.0g **We divide by 100 for rdid of 10 digits, so that the last TWO digits becomes the decimals** replace rdid2=rdid/100 if rdid>999999999 codebook rdid2 **and now we keep the integer part of rdid2. In this way we have created the household id** gen double hh_id=int(rdid2) format hh_id %20.0g label var hh_id "Household ID" codebook hh_id **gen wihtin household identifier** sort hh_id by hh_id: gen whid=_n by hh_id: egen n_interviewed=max(whid) tab n_interviewed,m gen double ind_id=rdid format ind_id %20.0g capture drop iaotperi iaotregu iaotsati sort hh_id ind_id save "`var'_mcc.dta", replace } use "mr_mcc.dta", clear merge hh_id ind_id using "en_mcc.dta" tab _merge ren _merge merge_women /* women in mr.dta and en.dta do not overlap: merge_women | Freq. Percent Cum. ------------+----------------------------------- 1 | 6,605 80.38 80.38 women in mr.dta 2 | 1,612 19.62 100.00 women in en.dta ------------+----------------------------------- Total | 8,217 100.00 */ sort hh_id append using "np_mcc.dta" replace merge_w=3 if merge_w==. label define merge_w 1 "regional women sample" 2 "national pregnant women sample" 3 "provincial children sample" label value merge_w merge_w sort hh_id by hh_id: gen whid2=_n by hh_id: egen n_interviewed2=max(whid2) tab n_interviewed2,m gen weight = facinges if merge_women<3 replace weight = factorap if merge_women==3 ** fixing sample weights for 7 observations (children) with missing weight ** gen wmis=1 if weight==. sort hh_id merge_w weight replace weight = weight[_n-1] if weight==. & weight[_n-1]<. & hh_id==hh_id[_n-1] bys hh_id: egen hh_size=max(nuevoi) *replace hh_size = n_interviewed2 if hh_size==. replace hh_size = 5 if hh_size==. /* 5 is the average HH size and we assume this value for 15 observations with missing sample size */ gen uno=1 if whid2==1 sum uno [w=hh_size] /* sample size 169,923 individuals (Alkire 2010 ARG sample size is 196,320 but I think they are double counting the number of HH members when more than 1 person per HH was interviewed (either 2+ women, 2+ children or 1+ woman and 1+ child) */ drop uno sort hh_id ind_id save "ARG_ENNyS2005.dta", replace ren hh_size hhmembers_hh gen urban = 1 * ELECTRICITY * gen electricity = 1 if electric==1 replace electricity = 0 if electric==0 * DRINKING WATER * gen water = 1 if aguaorig==1 | aguaorig==2 | aguaorig==3 replace water = 0 if aguaorig==4 | aguaorig==5 | aguaorig==6 /*red pública o agua corriente | 33,715 92.72 92.72 1 y perforación con bomba a motor | 1,457 4.01 96.72 2 y perforación con bomba manual | 350 0.96 97.68 3 y de superficie (río o lago) | 17 0.05 97.73 4 n agua embotelllada | 433 1.19 98.92 5 n otros | 367 1.01 99.93 6 n . | 25 0.07 100.00 */ * there is info whether the source of water is inside the dwelling, outside but in the yard or outside the yard * maybe we can use 'outside the yard as a proxy for more than 30 minutes (no info on time in minutes to get to water source) /* ta aguaabas,m por cañeria dentro de la vivienda | 29,737 81.78 81.78 fuera de la vivienda dentro del terreno | 5,464 15.03 96.80 fuera del terreno | 1,125 3.09 99.90 . | 38 0.10 100.00 */ * SANITATION * gen sanitation = 0 if tipoinod==3 | tipoinod==4 | ((tipoinod==1 | tipoinod==2) & desagino==4) replace sanitation = 1 if (tipoinod==1 | tipoinod==2) & (desagino==1 | desagino==2 | desagino==3) *replace sanitation = 0 if ==1 /*shared*/ /* ta desagino tipoinod,m c1 it 3.7 cómo es el | c1 it 3.6 el baño tiene desague del inodoro | inodoro c inodoro s letrina s no tiene . | Total ----------------------+-------------------------------------------------------+---------- red pública cloacas | 19,781 872 67 34 5 | 20,759 a cámara séptica y po | 5,980 1,135 11 6 2 | 7,134 solamente a pozo cieg | 2,416 1,822 81 7 0 | 4,326 a hoyo / excavación e | 583 497 37 4 0 | 1,121 . | 22 6 2,239 737 20 | 3,024 ----------------------+-------------------------------------------------------+---------- Total | 28,782 4,332 2,435 788 27 | 36,364 */ * COOKING FUEL * gen cookingfuel = 0 if tipcocin==1 | tipcocin==6 replace cookingfuel = 1 if tipcocin==2 | tipcocin==3 | tipcocin==4 | tipcocin==5 /* leña | 2,089 5.74 5.74 1 n combustibles líquidos | 21 0.06 5.80 2 y gas envasado | 16,752 46.07 51.87 3 y gas natural | 17,025 46.82 98.69 4 y electricidad | 177 0.49 99.18 5 y otro | 268 0.74 99.91 6 n . | 32 0.09 100.00 */ * FLOOR * gen floor = 1 if matepiso==1 | matepiso==2 | matepiso==4 replace floor = 0 if matepiso==3 replace floor = 0 if (matepiso==4 & (otmatpis=="PISO DE LONA (CARPA) Y PISO DEL VEHICULO" | otmatpis =="tierra" | otmatpis=="" | otmatpis=="3" | otmatpis=="4")) * 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) */ * Information * gen phone = 0 if telefono==0 replace phone = 1 if telefono==1 gen radio = . gen tv = . * Mobility * gen bicycle = . gen motorcycle = . gen motorboat = . gen car_truck = . gen animal_cart = . * Livelihood * gen refrigerator = 0 if heladera==0 replace refrigerator = 1 if heladera==1 egen information_miss = rowmiss(phone) gen mobility_miss = . egen livelihood_miss = rowmiss(refrigerator) gen information_depriv = 0 if phone==1 replace information_depriv = 1 if phone==0 gen mobility_depriv = . gen livelihood_depriv = 0 if refrigerator== 1 replace livelihood_depriv = 1 if refrigerator==0 gen asset_depriv_2 = 0 if information_depriv==0 | livelihood_depriv==0 replace asset_depriv_2 = 1 if information_depriv==1 & livelihood_depriv==1 foreach var in sanitation water floor cookingfuel electricity { gen `var'_depriv_2=1 if `var'==0 replace `var'_depriv_2=0 if `var'==1 bys hh_id: egen `var'_depriv=max(`var'_depriv_2) } bys hh_id: egen asset_depriv=max(asset_depriv_2) 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) *ren segme hv001 *ren hogar hv002 *keep if hv015==1 /* completed HH interview */ sort hh_id *keep weight hhmembers_hh urban electricity electricity_depriv water sanitation cookingfuel floor sanitation_depriv water_depriv floor_depriv cookingfuel_depriv depriv ls_sample livings_miss hh_id phone radio tv bicycle motorcycle car_truck refrigerator information_miss mobility_miss livelihood_miss information_depriv mobility_depriv livelihood_depriv asset_depriv *save "HH_MPI2_MCC.dta", replace * WOMEN'S QUESTIONNAIRE (10-49 y) (pregnant and women sample) * gen children_died=1 if tuvnvmur==1 | (embtd6m>=1 & embtd6m<=3) * children who later died, children who were born dead (still birth) replace children_died=0 if (tuvnvmur==0 & (embtd6m==0 | embtd6m==99)) | tuvomens==0 | tuvosexo==0 | estuemba==0 * children did not die, woman did not have first period, woman never had sex, woman never pregnant gen children_died5=children_died replace children_died5=0 if edadanio>36 & edadanio<. & merge_w<3 egen children_diedhh=sum(children_died), by(hh_id) missing egen children_died5hh=sum(children_died5), by(hh_id) missing qui ta children_died children_diedhh if merge_w<3,m /*children_d | children_diedhh ied | 0 1 2 . | Total -----------+--------------------------------------------+---------- 0 | 7,674 13 0 0 | 7,687 1 | 0 420 2 0 | 422 . | 2 0 0 106 | 108 -----------+--------------------------------------------+---------- Total | 7,676 433 2 106 | 8,217 */ qui ta children_died5 children_died5hh if merge_w<3,m /* children_d | children_died5hh ied5 | 0 1 . | Total -----------+---------------------------------+---------- 0 | 7,907 4 0 | 7,911 1 | 0 220 0 | 220 . | 2 0 84 | 86 -----------+---------------------------------+---------- Total | 7,909 224 84 | 8,217 */ * 2 obs with children_died missing and children_diedhh 0: it is ok, these are 2 HHs with 2 women each where 1 woman has missing and the other has 0 gen uno=1 if merge_w<3 egen nwomen15_49=sum(uno), by(hh_id) drop uno /*sort hh_id ind_id bys hh_id: gen uno=1 if _n==1 keep if uno==1 drop uno ren v001 hv001 ren v002 hv002 ren v003 hv003 keep hh_id children_diedhh nwomen15_49 sort hh_id merge hh_id using "child_death_MPI2_MCC.dta" drop _merge foreach var in child_died5 child_diedhh child_died5hh { replace `var'=0 if `var'==. & children_diedhh==0 } * never pregnant women and currently pregnant with first child do not appear in birth history section * sort hh_id save "entrevista_individual_mujeres_en_edad_fertil_MCC.dta", replace*/ * WOMEN'S UNDERNUTRITION (BMI<18.5) * gen w=1 if merge_w<3 /* women 10-49y */ egen whh=sum(w), by(hh_id) gen height_w = talla/100 if talla<900 & merge_w<3 gen weight_w = peso if peso<900 & merge_w<3 gen bmi = (weight_w/(height_w^2)) replace bmi=. if bmi==0 gen malnourishedw = 1 if bmi<18.5 replace malnourishedw=0 if bmi>=18.5 & bmi<. egen malnourishedwhh=sum(malnourishedw), by(hh_id) missing gen missing_bmi=1 if (talla>900 | peso>900 | bmi==.) & merge_w<3 egen missing_bmihh=sum(missing_bmi) if merge_w<3, by(hh_id) missing gen nomissing_bmi=1 if bmi<. egen nomissing_bmihh=sum(nomissing_bmi) if merge_w<3, by(hh_id) missing gen womanbmi=1 if merge_w<3 egen womanbmihh=sum(womanbmi) if merge_w<3, by(hh_id) missing gen missing_bmi_finalhh=1 if missing_bmihh>=1 & missing_bmihh<. & nomissing_bmihh==. & merge_w<3 gen uno_bmi=1 if bmi<. egen nw_bmi=sum(uno_bmi) if merge_w<3, by (hh_id) ren malnourishedwhh nmalnourishedwhh gen malnourishedwhh=1 if nmalnourishedwhh>=1 & nmalnourishedwhh<. replace malnourishedwhh=0 if nmalnourishedwhh==0 sort hh_id ind_id save "ARG_ENNyS2005.dta", replace ** CHILDREN ANTHROPOMETRICS ** /* use "ARG_ENNyS2005.dta", clear keep edadmese talla peso sexo weight hh_id ind_id merge_w keep if merge==3 /* keep only children, remove women */ gen sexh=1 if sexo=="M" replace sexh=2 if sexo=="F" * Variable “Sex” (1=male; 2=female) tab sexh, miss gen gender = sexh desc gender tab gender * Variable “Age”can be expresses it in months or days tab edadmese, miss replace edadmese=. if edadmese==99 codebook edadmese gen age_months = edadmese desc age_months summ age_months gen str6 ageunit = "months" label var ageunit "Months" *Variable “Sampling weight” ren weight sw desc sw summ sw * Variable “body weight” – it must be in kilograms ta peso, miss codebook peso gen weight = peso if peso<90 desc weight summ weight * Variable “height” – it must be in centimetres ta talla, miss codebook talla gen height = talla if talla<900 desc height summ height gen measure = "l" if edadmese<24 replace measure = "h" if edadmese>=24 & edadmese<. replace measure = " " if edadmese==. desc measure tab measure,m *Variable “Oedema” gen oedema=. desc oedema keep hh_id ind_id gender age_months ageunit weight height oedema measure sw talla save "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata\ARG_survey.dta", replace * THIS RUNS THE ANTHRO ADO FILE FROM WHO * /* Example: survey_standard.do using survey.dta */ clear set more 1 /* Indicate to the Stata compiler where the igrowup_standard.ado file is stored*/ adopath + "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\" /* Load the data file */ use "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata\ARG_survey.dta", clear /* generate the first three parameters reflib, datalib & datalab */ gen str60 reflib="C:\igrowup_stata" lab var reflib "Directory of reference tables" gen str60 datalib="C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata" lab var datalib "Directory for datafiles" gen str30 datalab="ARG_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 keep hh_id ind_id agemons height _zwei _zlen _zbmi _zwfl _fwfl _flen _fwei _fbmi talla sort hh_id ind_id save "ARG2005_ANTHRO.dta", replace clear set more off cd "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Argentina ENNyS\ENNyS\" use "ARG_ENNyS2005.dta", clear keep edadmese talla peso sexo weight hh_id ind_id merge_w keep if merge_w==3 /* keep only children, remove women */ * Variable “Sex” tab sexo, miss gen sex=1 if sexo=="M" replace sex=2 if sexo=="F" replace edadmese=. if edadmese==99 gen agemons = edadmese sum agemons ren weight sw desc sw summ sw gen weight = peso if peso<90 sum weight gen height = talla if talla<900 sum height gen oedema=" " sort hh_id ind_id save "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO 2007 stata\WHO 2007 workdata\ARG_survey_5_19.dta", replace /* Example: survey_who2007.do using survey_who2007.dta */ clear set more 1 /* Higher memory might be necessary for larger datasets */ set maxvar 10000 /* Indicate to the Stata compiler where the who2007.ado file is stored*/ adopath + "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO 2007 stata\" /* Load the data file */ use "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO 2007 stata\WHO 2007 workdata\ARG_survey_5_19.dta", clear /* generate the first three parameters reflib, datalib & datalab */ gen str60 reflib="C:\WHO 2007 Stata" lab var reflib "Directory of reference tables" gen str60 datalib="C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO 2007 stata\WHO 2007 workdata" lab var datalib "Directory for datafiles" gen str30 datalab="ARG_survey_5_19" lab var datalab "Working file" /* check the variable for "sex" 1 = male, 2=female */ desc sex tab sex /* check the variable for "age" */ desc agemons summ agemons /* define your ageunit */ gen str6 ageunit="months" /* or gen ageunit="days", gen ageunit="years" */ lab var ageunit "=days or =months or =years" /* 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 "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 */ who2007 reflib datalib datalab sex agemons ageunit weight height oedema sw *ren agemons age_months keep hh_id ind_id agemons _zhfa _fhfa talla keep if agemons>=61 ren _zhfa _zlen ren _fhfa _flen sort hh_id ind_id save "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Argentina ENNyS\ENNyS\ARG_anthro_5_19.dta", replace */ use "ARG2005_ANTHRO.dta", clear keep if agemons<61 append using "ARG_anthro_5_19.dta" * 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 (hh_id) missing gen missing_zha=1 if _flen==1 | _flen==. | (talla>900 & talla<=.) egen missing_zhahh=sum(missing_zha), by(hh_id) missing gen nomissing_zha=1 if _flen==0 egen nomissing_zhahh=sum(nomissing_zha), by(hh_id) 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 (hh_id) gen uno0_5=1 /*if age<=5*/ bys hh_id: 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<. sort hh_id ind_id bys hh_id: gen uno=1 if _n==1 keep if uno==1 drop uno keep malnourished5hh hhmember0_5 uno0_5 nw_zha uno_zha nmalnourished5hh hh_id missing_zha missing_zhahh missing_zha_finalhh sort hh_id save "ARG_ANTHRO2.dta", replace use "ARG_ENNyS2005.dta", clear sort hh_id merge hh_id using "ARG_ANTHRO2.dta" tab _merge ren _merge merge_anthro gen age = edadanio replace age = edadmese/12 if edadmese<99 & merge_w==3 gen sex = 0 if merge_w<3 replace sex = 0 if merge_w==3 & sexo=="F" replace sex = 1 if merge_w==3 & sexo=="M" gen uno=1 egen hhmembers=sum(uno), by(hh_id) label var hhmembers "Number of HH members interviewed" compare hhmembers n_interviewed2 drop uno compress sort hh_id save "Argentina_MPI2_2005.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: 3y /* reviewed July 1st 2013 */ ** 1- DEPRIVED IN EDUCATION ** ** Women schooling ** gen hv106 = idnive1 if merge_w<3 & idnive1<9 replace hv106 = idnivele if merge_w<3 & idnivele<9 & hv106==. gen hv107 = ultimogr if merge_w<3 & ultimogr<99 replace hv107 = gradoani-1 if merge_w<3 & gradoani<99 & hv107==. /* currently attending */ replace hv107 = 7 if merge_w<3 & idnive1==2 & completo==1 & hv107==. replace hv107 = 9 if merge_w<3 & idnive1==3 & completo==1 & hv107==. replace hv107 = 5 if merge_w<3 & idnive1==4 & completo==1 & hv107==. replace hv107 = 4 if merge_w<3 & idnive1==5 & completo==1 & hv107==. replace hv107 = 3 if merge_w<3 & (idnive1==6 | idnive1==7) & completo==1 & hv107==. replace hv107 = 5 if merge_w<3 & idnive1==8 & completo==1 & hv107==. gen yschooling = 0 if hv106==1 | (hv106==2 & hv107==0) | (hv106==3 & hv107==0) replace yschooling = 0 if merge_w<3 & asistees==0 & asistioa==0 replace yschooling =1 if (hv106==2 | hv106==3) & hv107==1 replace yschooling =2 if (hv106==2 | hv106==3) & hv107==2 replace yschooling =3 if (hv106==2 | hv106==3) & hv107==3 replace yschooling =4 if (hv106==2 | hv106==3) & hv107==4 replace yschooling =5 if (hv106==2 | hv106==3) & hv107==5 replace yschooling =6 if (hv106==2 | hv106==3) & hv107==6 replace yschooling =7 if (hv106==2 | hv106==3) & hv107==7 replace yschooling =8 if (hv106==2 | hv106==3) & hv107==8 replace yschooling =9 if (hv106==2 | hv106==3) & hv107==9 replace yschooling =7 if hv106==4 & hv107==0 replace yschooling =8 if hv106==4 & hv107==1 replace yschooling =9 if hv106==4 & hv107==2 replace yschooling =10 if hv106==4 & hv107==3 replace yschooling =11 if hv106==4 & hv107==4 replace yschooling =12 if hv106==4 & hv107==5 replace yschooling = 9 if hv106==5 & hv107==0 replace yschooling = 10 if hv106==5 & hv107==1 replace yschooling = 11 if hv106==5 & hv107==2 replace yschooling = 12 if hv106==5 & (hv107==3 | hv107==4 | hv107==7 | hv107==8) replace yschooling = 12 if (hv106==6 | hv106==7 | hv106==8) & hv107==0 replace yschooling = 13 if (hv106==6 | hv106==7 | hv106==8) & hv107==1 replace yschooling = 14 if (hv106==6 | hv106==7 | hv106==8) & hv107==2 replace yschooling = 15 if (hv106==6 | hv106==7 | hv106==8) & hv107==3 replace yschooling = 16 if hv106==8 & hv107==4 replace yschooling = 17 if hv106==8 & hv107==5 replace yschooling=. if age<5 ** HH head schooling ** gen hv106_j = idnive_1 if idnive_1<9 replace hv106_j = idnive_2 if idnive_2<9 & hv106_j==. gen hv107_j = ultimo_1 if ultimo_1<45 replace hv107_j = gradoa_1-1 if gradoa_1<45 & hv107_j==. /* currently attending */ replace hv107_j = 7 if idnive_2==2 & comple_1==1 & hv107_j==. replace hv107_j = 9 if idnive_2==3 & comple_1==1 & hv107_j==. replace hv107_j = 5 if idnive_2==4 & comple_1==1 & hv107_j==. replace hv107_j = 4 if idnive_2==5 & comple_1==1 & hv107_j==. replace hv107_j = 3 if (idnive_2==6 | idnive_2==7) & comple_1==1 & hv107_j==. replace hv107_j = 5 if idnive_2==8 & comple_1==1 & hv107_j==. replace hv107_j = 0 if hv107_j == -1 gen yschooling_j = 0 if hv106_j==0 | hv106_j==1 | (hv106_j==2 & hv107_j==0) | (hv106_j==3 & hv107_j==0) replace yschooling_j = 0 if asisti_1==0 & asiste_1==0 replace yschooling_j =1 if (hv106_j==2 | hv106_j==3) & hv107_j==1 replace yschooling_j =2 if (hv106_j==2 | hv106_j==3) & hv107_j==2 replace yschooling_j =3 if (hv106_j==2 | hv106_j==3) & hv107_j==3 replace yschooling_j =4 if (hv106_j==2 | hv106_j==3) & hv107_j==4 replace yschooling_j =5 if (hv106_j==2 | hv106_j==3) & hv107_j==5 replace yschooling_j =6 if (hv106_j==2 | hv106_j==3) & hv107_j==6 replace yschooling_j =7 if (hv106_j==2 | hv106_j==3) & hv107_j==7 replace yschooling_j =8 if (hv106_j==2 | hv106_j==3) & hv107_j==8 replace yschooling_j =9 if (hv106_j==2 | hv106_j==3) & hv107_j==9 replace yschooling_j =7 if hv106_j==4 & hv107_j==0 replace yschooling_j =8 if hv106_j==4 & hv107_j==1 replace yschooling_j =9 if hv106_j==4 & hv107_j==2 replace yschooling_j =10 if hv106_j==4 & hv107_j==3 replace yschooling_j =11 if hv106_j==4 & hv107_j==4 replace yschooling_j =12 if hv106_j==4 & (hv107_j==5 | hv107_j==6 | hv107_j==7 | hv107_j==9) replace yschooling_j = 9 if hv106_j==5 & hv107_j==0 replace yschooling_j = 10 if hv106_j==5 & hv107_j==1 replace yschooling_j = 11 if hv106_j==5 & hv107_j==2 replace yschooling_j = 12 if hv106_j==5 & (hv107_j==3 | hv107_j==4 | hv107_j==7 | hv107_j==8 | hv107_j==9) replace yschooling_j = 12 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==0 replace yschooling_j = 13 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==1 replace yschooling_j = 14 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==2 replace yschooling_j = 15 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==3 replace yschooling_j = 16 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==4 replace yschooling_j = 17 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==5 replace yschooling_j = 18 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==6 replace yschooling_j = 19 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==7 replace yschooling_j = 20 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & (hv107_j==8 | hv107_j==9) gen age_j=edad_1 if edad_1<99 replace yschooling_j=. if age_j<5 gen uno14=1 if age>=12 & age<. /* Number of HH members 12y or older */ bys hh_id: egen hhmember14 = sum(uno14) ** 1- DEPRIVED IN EDUCATION ** gen yschoolingi=0 if yschooling<6 & age>=12 & age<. replace yschoolingi=1 if yschooling>=6 & yschooling<. replace yschoolingi=1 if merge_w<3 & yschooling==. & (idnive1==6 | idnive1==7) gen yschoolingi_j=0 if yschooling_j<6 /* all HH heads are older than 12y */ replace yschoolingi_j=1 if yschooling_j>=6 & yschooling_j<. replace yschoolingi_j=1 if yschooling_j==. & (idnive_1==8 | idnive_2==4 | idnive_2==5 | idnive_2==6 | idnive_2==8) gen schooling_missing = 1 if yschoolingi==. & age>=12 & age<. egen schooling_missinghh=sum(schooling_missing), by(hh_id) gen schooling_missing_j = 1 if yschoolingi_j==. egen schooling_missinghh_j=sum(schooling_missing_j), by(hh_id) egen yeduchh=sum(yschoolingi), by(hh_id) /* assumes that a member has <6 y schooling when there is missing info on that member's schooling */ replace yeduchh=. if schooling_missinghh==hhmember14 egen yeduchh_j=sum(yschoolingi_j), by(hh_id) missing * DEPRIVED IN EDUCATION INDICATOR * gen educ_depriv=1 if yeduchh==0 & yeduchh_j==0 replace educ_depriv=0 if (yeduchh>=1 & yeduchh<.) | (yeduchh_j>=1 & yeduchh_j<.) *replace educ_depriv=yeduchh if educ_depriv==. & yeduchh<. & yeduchh_j==. & hhmember14==1 replace educ_depriv=1 if yeduchh_j==0 & educ_depriv==. & yeduchh_j<. & yeduchh==. & hhmember14==0 replace educ_depriv=0 if (yeduchh_j>=1 & yeduchh_j<.) & educ_depriv==. & yeduchh_j<. & yeduchh==. & hhmember14==0 ** 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 asistees==9 & age>=7 & age<15 gen child_7_14=1 if age>=7 & age<15 egen attendance_missinghh=sum(attendance_missing), by(hh_id) egen child_7_14hh=sum(child_7_14), by(hh_id) gen child_6_14=1 if age>=6 & age<15 egen child_6_14hh=sum(child_6_14), by(hh_id) 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(hh_id) gen child_noattend=1 if asistees==0 & age>=7 & age<15 replace child_noattend=0 if asistees==1 & age>=7 & age<15 * DEPRIVED IN SCHOOL ATTENDANCE 7-14Y * egen child_noattendhh=sum(child_noattend), by(hh_id) replace child_noattendhh=1 if child_noattendhh>1 & child_noattendhh<. *replace child_noattendhh=. if attendance_missing_finalhh>=1 & attendance_missing_finalhh<. *replace child_noattendhh=. if child_noattendhh==0 & attendance_missing_finalhh>=1 & attendance_missing_finalhh>(1/3*child_7_14hh) 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 DHS 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. DHS contains nutritional information on women between 15 and 49 years (Body Mass Index, BMI hereafter) and on the under-5-year-old children of the household (weight and height). This allows constructing a composite indicator which considers a household to be deprived (and therefore all its members) if there is either a woman or a child undernourished in the household. */ sort hh_id save "Argentina_MPI2_2005.dta", replace ** 1- NUTRITION ** replace hhmember0_5=0 if hhmember0_5==. gen undernutritionhh=0 if malnourishedwhh==0 & malnourished5hh==0 replace undernutritionhh=0 if malnourishedwhh==0 & malnourished5hh==. & hhmember0_5==0 replace undernutritionhh=0 if malnourished5hh==0 & malnourishedwhh==. & whh==0 replace undernutritionhh=1 if (malnourishedwhh>0 & malnourishedwhh<.) | (malnourished5hh>0 & malnourished5hh<.) ** 2- DEPRIVED IN MORTALITY ** replace children_diedhh=0 if children_diedhh==. & whh==0 replace children_died5hh=0 if children_died5hh==. & whh==0 gen mortality5hh=0 if children_died5hh==0 replace mortality5hh=1 if (children_died5hh>=1 & children_died5hh<.) *gen region = hv024 compress sort hh_id save "Argentina_MPI2_2005.dta", replace * NON-ELIGIBLE POPULATION * gen uno7_14=1 if age>=7 & age<15 bys hh_id: egen hhmember7_14 = sum(uno7_14) gen uno15_49=1 if merge_w<3/*age>=15 & age<=49 & sex==0*/ bys hh_id: egen hhmember15_49 = sum(uno15_49) *capture drop uno0_5 hhmember0_5 *gen uno0_5=1 if age<=5 *bys hh_id: egen hhmember0_5 = sum(uno0_5_2) 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 nutrihh=1 if undernutritionhh<. & (malnourished5hh<. | malnourishedwhh<.) replace nutrihh=3 if undernutritionhh==. & malnourished5hh==. & malnourishedwhh==. & uno15_49hh==0 & uno0_5hh==0 replace nutrihh=4 if undernutritionhh==. & malnourished5hh==. & malnourishedwhh==. & (uno15_49hh==1 | uno0_5hh==1) replace nutrihh=2 if undernutritionhh==. & nutrihh==. *replace nutrihh=1 if undernutritionhh==0 & (malnourishedwhh==0 & malnourished5hh==. & (whh>0 | hhmember0_5>0) & nc5>0 & nc5<. & nc5==hhmember0_5) *replace nutrihh=1 if undernutritionhh==0 & (malnourishedwhh==0 & malnourished5hh==. & (whh>0 | hhmember0_5>0) & nc5>0 & nc5<. & hhmember0_5>nc5 & (nw_zha/(hhmember0_5-nc5)>=(1/2))) *replace nutrihh=3 if nutrihh==4 & hhmember0_5>0 & nc5==hhmember0_5 & whh==0 replace nutrihh=2 if nutrihh==4 & missing_bmihh>0 & missing_bmihh<. replace nutrihh=2 if nutrihh==4 & missing_zhahh>0 & missing_zhahh<. 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 & no women 15-49y)" 4 "HH with eligible population for nutrition but measures not taken" 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=3 if mortality5hh==0 & uno15_49hh==0 replace morthh=2 if mortality5hh==. 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 ** STANDARIZE SAMPLE WEIGHTS ** gen sample_wc = 1 if merge_anthro==1 replace sample_wc = 2 if whh==0 & merge_anthro==3 replace sample_wc = 3 if whh>0 & whh<. & merge_anthro==3 label define sample_wc 1 "Women without children" 2 "Children without women" 3 "Women and children" label values sample_wc sample_wc forvalues i = 1(1)3 { egen weight_ms`i' = sum(weight) if sample_wc==`i', by(hh_id) gen weight_mean`i' = weight_ms`i'/n_interviewed2 if sample_wc==`i' sum weight_mean`i' if sample_wc==`i' gen weight_m`i'=weight_mean`i'/r(mean) if sample_wc==`i' } ren weight weight_orig gen weight=weight_m1 if sample_wc==1 replace weight=weight_m2 if sample_wc==2 replace weight=weight_m3 if sample_wc==3 compress sort hh_id ind_id save "Argentina_MPI2_2005.dta", replace keep hh_id electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv educ_depriv child_noattendhh undernutritionhh mortality5hh hhmembers_hh weight nutrihh morthh attehh sexon_1 collapse (mean) electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv educ_depriv child_noattendhh undernutritionhh mortality5hh hhmembers_hh weight nutrihh morthh attehh sexon_1, by(hh_id) sort hh_id save "Argentina_MPI2_2005_HH.dta", replace expand hhmembers_hh, gen(mc) sort hh_id save "Argentina_MPI2_2005_IND.dta", replace ** DO FILE FROM OPHI TO COMPUTE MPI ** *************************************************************************** **** Multidimensional Poverty Measure ************************************* **** OPHI-HDCA Summer School 2011 ***************************************** **** 24 August to 3 September 2011 - Delft, the Netherlands *************** *************************************************************************** ** ADAPTED BY CECILIA ON MAY 2013 ** ** Argentina 2005 ** clear set more off set maxvar 10000 set mem 500m cap log close *** Replace here your path to the dataset*** cd "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Argentina ENNyS\ENNyS\" *** Replace here the name of your dataset*** capture log close log using "M0_dofile_Argentina2005_MPI2.log", text replace use "Argentina_MPI2_2005_IND.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) ** 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 | morthh==3) & nutrihh==1 *replace w_mortality5hh = 0 if morthh==3 & nutrihh==1 gen w_undernutritionhh = 1/6 if (morthh==1 | morthh==3) & nutrihh==1 *replace w_undernutritionhh = 1/3 if morthh==3 & nutrihh==1 gen w_child_noattendhh = 1/6 if (attehh==1 | attehh==3) & educ_depriv<. *replace w_child_noattendhh = 0 if attehh==3 & educ_depriv<. gen w_educ_depriv = 1/6 if educ_depriv<. & (attehh==1 | attehh==3) *replace w_educ_depriv = 1/3 if educ_depriv<. & attehh==3 ******************************************************************* ********* 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 *sort age bys hh_id: 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 * CONTRIBUTION OF EACH DIMENSION FOR THE VULNERABLE + POOR POEPLE (ci >= 0.2) capture drop *vupo foreach var in `varlist_pov' { gen `var'_CH_33vupo=0 if h_33p<. & ci>=0.2 & ci<. replace `var'_CH_33vupo=1 if `var'==1 & h_33p<. & ci>=0.2 & ci<. replace `var'_CH_33vupo=. if missing==1 } gen ceduvupo = (child_noattendhh_CH_33vupo * w_child_noattendhh) + (educ_depriv_CH_33vupo * w_educ_depriv) sum ceduvupo [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar mpi_eduvupo=r(mean) gen chealthvupo = (mortality5hh_CH_33vupo * w_mortality5hh) + (undernutritionhh_CH_33vupo * w_undernutritionhh) sum chealthvupo [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar mpi_healthvupo=r(mean) gen clsvupo = (asset_depriv_CH_33vupo * w_asset_depriv) + (electricity_depriv_CH_33vupo * w_electricity_depriv) + (sanitation_depriv_CH_33vupo * w_sanitation_depriv) + (water_depriv_CH_33vupo * w_water_depriv) + (floor_depriv_CH_33vupo * w_floor_depriv) + (cookingfuel_depriv_CH_33vupo * w_cookingfuel_depriv) sum clsvupo [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar mpi_lsvupo=r(mean) sum ci [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar headcountvupo = r(mean) scalar headcountvupo100=headcountvupo*100 scalar edu_contribvupo = (mpi_eduvupo/headcountvupo100)*10000 scalar health_contribvupo = (mpi_healthvupo/headcountvupo100)*10000 scalar ls_contribvupo = (mpi_lsvupo/headcountvupo100)*10000 scalar list mpi headcount100 intensity100 vulnerable0 vulnerable20 severity edu_contrib health_contrib ls_contrib edu_contribvu health_contribvu ls_contribvu edu_contribvupo health_contribvupo ls_contribvupo cv_ineq_poor cv_ineq_positive cv_ineq_hc hh_sample_tot hh_sample_used hh_sample_used_w ind_sample_tot ind_sample_used ind_sample_used_w gen sample6y=1 if h_33p<. sort hh_id gen sample_all=1 sort hh_id save "Argentina_MPIorig_2005_final.dta", replace capture log close * 2 * ********* TREAT HHs WITH NO ELIGIBLE POPULATION AS NOT DEPRIVED AND KEEPING ORIGINAL DEFINITION OF INDICATORS ********** ***************************************************************************************************************************************************************************** * However, unfortunately, ENNyS is the only survey we use that is not nationally representative. First, it was conducted only in urban areas; second, the sample design and survey weights do not allow nationally representative estimates in urban areas. However, we kept these estimates as a lower bound estimate of acute multidimensional poverty in the urban areas of Argentina. * ****************************************************************************************************************************************************************************** clear clear matrix set more off set maxvar 10000 cd "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Argentina ENNyS\ENNyS\" foreach var in np nr mr en { use "`var'.dta", clear **we now create the household id*** **This is extracted from the individual id rdid** ***rdid has the following structure: it is a 9 to 10 digits number where the two first ones identify the province** **the thrid and fourth identify the 'punto muestra', 5 to 8 the houshold, and 9 nd 10 the individual*** **So we divide by 10 for rdid of 9 digits, so that the last digit becomes the first decimal** format rdid %20.0g gen double rdid2=rdid/10 if rdid<999999999 format rdid2 %20.0g **We divide by 100 for rdid of 10 digits, so that the last TWO digits becomes the decimals** replace rdid2=rdid/100 if rdid>999999999 codebook rdid2 **and now we keep the integer part of rdid2. In this way we have created the household id** gen double hh_id=int(rdid2) format hh_id %20.0g label var hh_id "Household ID" codebook hh_id **gen wihtin household identifier** sort hh_id by hh_id: gen whid=_n by hh_id: egen n_interviewed=max(whid) tab n_interviewed,m gen double ind_id=rdid format ind_id %20.0g capture drop iaotperi iaotregu iaotsati sort hh_id ind_id save "`var'_mcc.dta", replace } use "mr_mcc.dta", clear merge hh_id ind_id using "en_mcc.dta" tab _merge ren _merge merge_women /* women in mr.dta and en.dta do not overlap: merge_women | Freq. Percent Cum. ------------+----------------------------------- 1 | 6,605 80.38 80.38 women in mr.dta 2 | 1,612 19.62 100.00 women in en.dta ------------+----------------------------------- Total | 8,217 100.00 */ sort hh_id append using "np_mcc.dta" replace merge_w=3 if merge_w==. label define merge_w 1 "regional women sample" 2 "national pregnant women sample" 3 "provincial children sample" label value merge_w merge_w sort hh_id by hh_id: gen whid2=_n by hh_id: egen n_interviewed2=max(whid2) tab n_interviewed2,m gen weight = facinges if merge_women<3 replace weight = factorap if merge_women==3 ** fixing sample weights for 7 observations (children) with missing weight ** gen wmis=1 if weight==. sort hh_id merge_w weight replace weight = weight[_n-1] if weight==. & weight[_n-1]<. & hh_id==hh_id[_n-1] bys hh_id: egen hh_size=max(nuevoi) *replace hh_size = n_interviewed2 if hh_size==. replace hh_size = 5 if hh_size==. /* 5 is the average HH size and we assume this value for 15 observations with missing sample size */ gen uno=1 if whid2==1 sum uno [w=hh_size] /* sample size 169,923 individuals (Alkire 2010 ARG sample size is 196,320 but I think they are double counting the number of HH members when more than 1 person per HH was interviewed (either 2+ women, 2+ children or 1+ woman and 1+ child) */ drop uno sort hh_id ind_id save "ARG_ENNyS2005.dta", replace ren hh_size hhmembers_hh gen urban = 1 * ELECTRICITY * gen electricity = 1 if electric==1 replace electricity = 0 if electric==0 * DRINKING WATER * gen water = 1 if aguaorig==1 | aguaorig==2 | aguaorig==3 replace water = 0 if aguaorig==4 | aguaorig==5 | aguaorig==6 /*red pública o agua corriente | 33,715 92.72 92.72 1 y perforación con bomba a motor | 1,457 4.01 96.72 2 y perforación con bomba manual | 350 0.96 97.68 3 y de superficie (río o lago) | 17 0.05 97.73 4 n agua embotelllada | 433 1.19 98.92 5 n otros | 367 1.01 99.93 6 n . | 25 0.07 100.00 */ * there is info whether the source of water is inside the dwelling, outside but in the yard or outside the yard * maybe we can use 'outside the yard as a proxy for more than 30 minutes (no info on time in minutes to get to water source) /* ta aguaabas,m por cañeria dentro de la vivienda | 29,737 81.78 81.78 fuera de la vivienda dentro del terreno | 5,464 15.03 96.80 fuera del terreno | 1,125 3.09 99.90 . | 38 0.10 100.00 */ * SANITATION * gen sanitation = 0 if tipoinod==3 | tipoinod==4 | ((tipoinod==1 | tipoinod==2) & desagino==4) replace sanitation = 1 if (tipoinod==1 | tipoinod==2) & (desagino==1 | desagino==2 | desagino==3) *replace sanitation = 0 if ==1 /*shared*/ /* ta desagino tipoinod,m c1 it 3.7 cómo es el | c1 it 3.6 el baño tiene desague del inodoro | inodoro c inodoro s letrina s no tiene . | Total ----------------------+-------------------------------------------------------+---------- red pública cloacas | 19,781 872 67 34 5 | 20,759 a cámara séptica y po | 5,980 1,135 11 6 2 | 7,134 solamente a pozo cieg | 2,416 1,822 81 7 0 | 4,326 a hoyo / excavación e | 583 497 37 4 0 | 1,121 . | 22 6 2,239 737 20 | 3,024 ----------------------+-------------------------------------------------------+---------- Total | 28,782 4,332 2,435 788 27 | 36,364 */ * COOKING FUEL * gen cookingfuel = 0 if tipcocin==1 | tipcocin==6 replace cookingfuel = 1 if tipcocin==2 | tipcocin==3 | tipcocin==4 | tipcocin==5 /* leña | 2,089 5.74 5.74 1 n combustibles líquidos | 21 0.06 5.80 2 y gas envasado | 16,752 46.07 51.87 3 y gas natural | 17,025 46.82 98.69 4 y electricidad | 177 0.49 99.18 5 y otro | 268 0.74 99.91 6 n . | 32 0.09 100.00 */ * FLOOR * gen floor = 1 if matepiso==1 | matepiso==2 | matepiso==4 replace floor = 0 if matepiso==3 replace floor = 0 if (matepiso==4 & (otmatpis=="PISO DE LONA (CARPA) Y PISO DEL VEHICULO" | otmatpis =="tierra" | otmatpis=="" | otmatpis=="3" | otmatpis=="4")) * 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) */ * Information * gen phone = 0 if telefono==0 replace phone = 1 if telefono==1 gen radio = . gen tv = . * Mobility * gen bicycle = . gen motorcycle = . gen motorboat = . gen car_truck = . gen animal_cart = . * Livelihood * gen refrigerator = 0 if heladera==0 replace refrigerator = 1 if heladera==1 egen information_miss = rowmiss(phone) gen mobility_miss = . egen livelihood_miss = rowmiss(refrigerator) gen information_depriv = 0 if phone==1 replace information_depriv = 1 if phone==0 gen mobility_depriv = . gen livelihood_depriv = 0 if refrigerator== 1 replace livelihood_depriv = 1 if refrigerator==0 gen asset_depriv_2 = 0 if information_depriv==0 | livelihood_depriv==0 replace asset_depriv_2 = 1 if information_depriv==1 & livelihood_depriv==1 foreach var in sanitation water floor cookingfuel electricity { gen `var'_depriv_2=1 if `var'==0 replace `var'_depriv_2=0 if `var'==1 bys hh_id: egen `var'_depriv=max(`var'_depriv_2) } bys hh_id: egen asset_depriv=max(asset_depriv_2) 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) *ren segme hv001 *ren hogar hv002 *keep if hv015==1 /* completed HH interview */ sort hh_id *keep weight hhmembers_hh urban electricity electricity_depriv water sanitation cookingfuel floor sanitation_depriv water_depriv floor_depriv cookingfuel_depriv depriv ls_sample livings_miss hh_id phone radio tv bicycle motorcycle car_truck refrigerator information_miss mobility_miss livelihood_miss information_depriv mobility_depriv livelihood_depriv asset_depriv *save "HH_MPI2_MCC.dta", replace * WOMEN'S QUESTIONNAIRE (10-49 y) (pregnant and women sample) * gen children_died=1 if tuvnvmur==1 | (embtd6m>=1 & embtd6m<=3) * children who later died, children who were born dead (still birth) replace children_died=0 if (tuvnvmur==0 & (embtd6m==0 | embtd6m==99)) | tuvomens==0 | tuvosexo==0 | estuemba==0 * children did not die, woman did not have first period, woman never had sex, woman never pregnant gen children_died5=children_died replace children_died5=0 if edadanio>36 & edadanio<. & merge_w<3 egen children_diedhh=sum(children_died), by(hh_id) missing egen children_died5hh=sum(children_died5), by(hh_id) missing qui ta children_died children_diedhh if merge_w<3,m /*children_d | children_diedhh ied | 0 1 2 . | Total -----------+--------------------------------------------+---------- 0 | 7,674 13 0 0 | 7,687 1 | 0 420 2 0 | 422 . | 2 0 0 106 | 108 -----------+--------------------------------------------+---------- Total | 7,676 433 2 106 | 8,217 */ qui ta children_died5 children_died5hh if merge_w<3,m /* children_d | children_died5hh ied5 | 0 1 . | Total -----------+---------------------------------+---------- 0 | 7,907 4 0 | 7,911 1 | 0 220 0 | 220 . | 2 0 84 | 86 -----------+---------------------------------+---------- Total | 7,909 224 84 | 8,217 */ * 2 obs with children_died missing and children_diedhh 0: it is ok, these are 2 HHs with 2 women each where 1 woman has missing and the other has 0 gen uno=1 if merge_w<3 egen nwomen15_49=sum(uno), by(hh_id) drop uno /*sort hh_id ind_id bys hh_id: gen uno=1 if _n==1 keep if uno==1 drop uno ren v001 hv001 ren v002 hv002 ren v003 hv003 keep hh_id children_diedhh nwomen15_49 sort hh_id merge hh_id using "child_death_MPI2_MCC.dta" drop _merge foreach var in child_died5 child_diedhh child_died5hh { replace `var'=0 if `var'==. & children_diedhh==0 } * never pregnant women and currently pregnant with first child do not appear in birth history section * sort hh_id save "entrevista_individual_mujeres_en_edad_fertil_MCC.dta", replace*/ * WOMEN'S UNDERNUTRITION (BMI<18.5) * gen w=1 if merge_w<3 /* women 10-49y */ egen whh=sum(w), by(hh_id) gen height_w = talla/100 if talla<900 & merge_w<3 gen weight_w = peso if peso<900 & merge_w<3 gen bmi = (weight_w/(height_w^2)) replace bmi=. if bmi==0 gen malnourishedw = 1 if bmi<18.5 replace malnourishedw=0 if bmi>=18.5 & bmi<. egen malnourishedwhh=sum(malnourishedw), by(hh_id) missing gen missing_bmi=1 if (talla>900 | peso>900 | bmi==.) & merge_w<3 egen missing_bmihh=sum(missing_bmi) if merge_w<3, by(hh_id) missing gen nomissing_bmi=1 if bmi<. egen nomissing_bmihh=sum(nomissing_bmi) if merge_w<3, by(hh_id) missing gen womanbmi=1 if merge_w<3 egen womanbmihh=sum(womanbmi) if merge_w<3, by(hh_id) missing gen missing_bmi_finalhh=1 if missing_bmihh>=1 & missing_bmihh<. & nomissing_bmihh==. & merge_w<3 gen uno_bmi=1 if bmi<. egen nw_bmi=sum(uno_bmi) if merge_w<3, by (hh_id) ren malnourishedwhh nmalnourishedwhh gen malnourishedwhh=1 if nmalnourishedwhh>=1 & nmalnourishedwhh<. replace malnourishedwhh=0 if nmalnourishedwhh==0 sort hh_id ind_id save "ARG_ENNyS2005.dta", replace ** CHILDREN ANTHROPOMETRICS ** /* use "ARG_ENNyS2005.dta", clear keep edadmese talla peso sexo weight hh_id ind_id merge_w keep if merge==3 /* keep only children, remove women */ gen sexh=1 if sexo=="M" replace sexh=2 if sexo=="F" * Variable “Sex” (1=male; 2=female) tab sexh, miss gen gender = sexh desc gender tab gender * Variable “Age”can be expresses it in months or days tab edadmese, miss replace edadmese=. if edadmese==99 codebook edadmese gen age_months = edadmese desc age_months summ age_months gen str6 ageunit = "months" label var ageunit "Months" *Variable “Sampling weight” ren weight sw desc sw summ sw * Variable “body weight” – it must be in kilograms ta peso, miss codebook peso gen weight = peso if peso<90 desc weight summ weight * Variable “height” – it must be in centimetres ta talla, miss codebook talla gen height = talla if talla<900 desc height summ height gen measure = "l" if edadmese<24 replace measure = "h" if edadmese>=24 & edadmese<. replace measure = " " if edadmese==. desc measure tab measure,m *Variable “Oedema” gen oedema=. desc oedema keep hh_id ind_id gender age_months ageunit weight height oedema measure sw talla peso save "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata\ARG_survey.dta", replace * THIS RUNS THE ANTHRO ADO FILE FROM WHO * /* Example: survey_standard.do using survey.dta */ clear set more 1 /* Indicate to the Stata compiler where the igrowup_standard.ado file is stored*/ adopath + "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\" /* Load the data file */ use "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata\ARG_survey.dta", clear /* generate the first three parameters reflib, datalib & datalab */ gen str60 reflib="C:\igrowup_stata" lab var reflib "Directory of reference tables" gen str60 datalib="C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO igrowup STATA\WHO igrowup workdata" lab var datalib "Directory for datafiles" gen str30 datalab="ARG_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 keep hh_id ind_id agemons height _zwei _zlen _zbmi _zwfl _fwfl _flen _fwei _fbmi talla peso sort hh_id ind_id save "ARG2005_ANTHRO.dta", replace clear set more off cd "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Argentina ENNyS\ENNyS\" use "ARG_ENNyS2005.dta", clear keep edadmese talla peso sexo weight hh_id ind_id merge_w keep if merge_w==3 /* keep only children, remove women */ * Variable “Sex” tab sexo, miss gen sex=1 if sexo=="M" replace sex=2 if sexo=="F" replace edadmese=. if edadmese==99 gen agemons = edadmese sum agemons ren weight sw desc sw summ sw gen weight = peso if peso<90 sum weight gen height = talla if talla<900 sum height gen oedema=" " sort hh_id ind_id save "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO 2007 stata\WHO 2007 workdata\ARG_survey_5_19.dta", replace /* Example: survey_who2007.do using survey_who2007.dta */ clear set more 1 /* Higher memory might be necessary for larger datasets */ set maxvar 10000 /* Indicate to the Stata compiler where the who2007.ado file is stored*/ adopath + "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO 2007 stata\" /* Load the data file */ use "C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO 2007 stata\WHO 2007 workdata\ARG_survey_5_19.dta", clear /* generate the first three parameters reflib, datalib & datalab */ gen str60 reflib="C:\WHO 2007 Stata" lab var reflib "Directory of reference tables" gen str60 datalib="C:\Users\cecilia.calderon\HDRO_MCC\MPI\WHO 2007 stata\WHO 2007 workdata" lab var datalib "Directory for datafiles" gen str30 datalab="ARG_survey_5_19" lab var datalab "Working file" /* check the variable for "sex" 1 = male, 2=female */ desc sex tab sex /* check the variable for "age" */ desc agemons summ agemons /* define your ageunit */ gen str6 ageunit="months" /* or gen ageunit="days", gen ageunit="years" */ lab var ageunit "=days or =months or =years" /* 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 "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 */ who2007 reflib datalib datalab sex agemons ageunit weight height oedema sw *ren agemons age_months keep hh_id ind_id agemons _zhfa _fhfa talla keep if agemons>=61 ren _zhfa _zlen ren _fhfa _flen sort hh_id ind_id save "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Argentina ENNyS\ENNyS\ARG_anthro_5_19.dta", replace */ use "ARG2005_ANTHRO.dta", clear keep if agemons<61 append using "ARG_anthro_5_19.dta" * UNDERNUTRITION USING Z SCORES CALCULATED WITH WHO CODE * * Weight-for-age * gen zwa = _zwei if _fwei==0 gen malnourished5 = 1 if zwa<=-2 replace malnourished5=0 if zwa>-2 & zwa<. egen malnourished5hh=sum(malnourished5), by (hh_id) missing gen missing_zwa=1 if _fwei==1 | _fwei==. | (peso>90 & peso<=.) egen missing_zwahh=sum(missing_zwa), by(hh_id) missing gen nomissing_zwa=1 if _fwei==0 egen nomissing_zwahh=sum(nomissing_zwa), by(hh_id) missing gen missing_zwa_finalhh=1 if missing_zwahh>=1 & missing_zwahh<. & nomissing_zwahh==. replace missing_zwa_finalhh=0 if missing_zwa_finalhh==. & agemons<61 gen uno_zwa=1 if zwa<. egen nw_zwa=sum(uno_zwa), by (hh_id) gen uno0_5=1 if agemons<61 bys hh_id: egen hhmember0_5 = sum(uno0_5) ren malnourished5hh nmalnourished5hh gen malnourished5hh=1 if nmalnourished5hh>=1 & nmalnourished5hh<. replace malnourished5hh=0 if nmalnourished5hh==0 replace missing_zwa_finalhh=1 if malnourished5hh==0 & hhmember0_5>(2*nw_zwa) & nw_zwa<. replace missing_zwahh=1 if malnourished5hh==0 & hhmember0_5>(2*nw_zwa) & nw_zwa<. replace malnourished5hh=. if malnourished5hh==0 & hhmember0_5>(2*nw_zwa) & nw_zwa<. sort hh_id ind_id bys hh_id: gen uno=1 if _n==1 keep if uno==1 drop uno keep malnourished5hh hhmember0_5 uno0_5 nw_zwa uno_zwa nmalnourished5hh hh_id missing_zwa missing_zwahh missing_zwa_finalhh sort hh_id save "ARG_ANTHRO2_W.dta", replace use "ARG_ENNyS2005.dta", clear sort hh_id merge hh_id using "ARG_ANTHRO2_W.dta" tab _merge ren _merge merge_anthro gen age = edadanio replace age = edadmese/12 if edadmese<99 & merge_w==3 gen sex = 0 if merge_w<3 replace sex = 0 if merge_w==3 & sexo=="F" replace sex = 1 if merge_w==3 & sexo=="M" gen uno=1 egen hhmembers=sum(uno), by(hh_id) label var hhmembers "Number of HH members interviewed" compare hhmembers n_interviewed2 drop uno compress sort hh_id save "Argentina_MPI_2005.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: 3y /* reviewed July 1st 2013 */ ** 1- DEPRIVED IN EDUCATION ** ** Women schooling ** gen hv106 = idnive1 if merge_w<3 & idnive1<9 replace hv106 = idnivele if merge_w<3 & idnivele<9 & hv106==. gen hv107 = ultimogr if merge_w<3 & ultimogr<99 replace hv107 = gradoani-1 if merge_w<3 & gradoani<99 & hv107==. /* currently attending */ replace hv107 = 7 if merge_w<3 & idnive1==2 & completo==1 & hv107==. replace hv107 = 9 if merge_w<3 & idnive1==3 & completo==1 & hv107==. replace hv107 = 5 if merge_w<3 & idnive1==4 & completo==1 & hv107==. replace hv107 = 4 if merge_w<3 & idnive1==5 & completo==1 & hv107==. replace hv107 = 3 if merge_w<3 & (idnive1==6 | idnive1==7) & completo==1 & hv107==. replace hv107 = 5 if merge_w<3 & idnive1==8 & completo==1 & hv107==. gen yschooling = 0 if hv106==1 | (hv106==2 & hv107==0) | (hv106==3 & hv107==0) replace yschooling = 0 if merge_w<3 & asistees==0 & asistioa==0 replace yschooling =1 if (hv106==2 | hv106==3) & hv107==1 replace yschooling =2 if (hv106==2 | hv106==3) & hv107==2 replace yschooling =3 if (hv106==2 | hv106==3) & hv107==3 replace yschooling =4 if (hv106==2 | hv106==3) & hv107==4 replace yschooling =5 if (hv106==2 | hv106==3) & hv107==5 replace yschooling =6 if (hv106==2 | hv106==3) & hv107==6 replace yschooling =7 if (hv106==2 | hv106==3) & hv107==7 replace yschooling =8 if (hv106==2 | hv106==3) & hv107==8 replace yschooling =9 if (hv106==2 | hv106==3) & hv107==9 replace yschooling =7 if hv106==4 & hv107==0 replace yschooling =8 if hv106==4 & hv107==1 replace yschooling =9 if hv106==4 & hv107==2 replace yschooling =10 if hv106==4 & hv107==3 replace yschooling =11 if hv106==4 & hv107==4 replace yschooling =12 if hv106==4 & hv107==5 replace yschooling = 9 if hv106==5 & hv107==0 replace yschooling = 10 if hv106==5 & hv107==1 replace yschooling = 11 if hv106==5 & hv107==2 replace yschooling = 12 if hv106==5 & (hv107==3 | hv107==4 | hv107==7 | hv107==8) replace yschooling = 12 if (hv106==6 | hv106==7 | hv106==8) & hv107==0 replace yschooling = 13 if (hv106==6 | hv106==7 | hv106==8) & hv107==1 replace yschooling = 14 if (hv106==6 | hv106==7 | hv106==8) & hv107==2 replace yschooling = 15 if (hv106==6 | hv106==7 | hv106==8) & hv107==3 replace yschooling = 16 if hv106==8 & hv107==4 replace yschooling = 17 if hv106==8 & hv107==5 replace yschooling=. if age<5 ** HH head schooling ** gen hv106_j = idnive_1 if idnive_1<9 replace hv106_j = idnive_2 if idnive_2<9 & hv106_j==. gen hv107_j = ultimo_1 if ultimo_1<45 replace hv107_j = gradoa_1-1 if gradoa_1<45 & hv107_j==. /* currently attending */ replace hv107_j = 7 if idnive_2==2 & comple_1==1 & hv107_j==. replace hv107_j = 9 if idnive_2==3 & comple_1==1 & hv107_j==. replace hv107_j = 5 if idnive_2==4 & comple_1==1 & hv107_j==. replace hv107_j = 4 if idnive_2==5 & comple_1==1 & hv107_j==. replace hv107_j = 3 if (idnive_2==6 | idnive_2==7) & comple_1==1 & hv107_j==. replace hv107_j = 5 if idnive_2==8 & comple_1==1 & hv107_j==. replace hv107_j = 0 if hv107_j == -1 gen yschooling_j = 0 if hv106_j==0 | hv106_j==1 | (hv106_j==2 & hv107_j==0) | (hv106_j==3 & hv107_j==0) replace yschooling_j = 0 if asisti_1==0 & asiste_1==0 replace yschooling_j =1 if (hv106_j==2 | hv106_j==3) & hv107_j==1 replace yschooling_j =2 if (hv106_j==2 | hv106_j==3) & hv107_j==2 replace yschooling_j =3 if (hv106_j==2 | hv106_j==3) & hv107_j==3 replace yschooling_j =4 if (hv106_j==2 | hv106_j==3) & hv107_j==4 replace yschooling_j =5 if (hv106_j==2 | hv106_j==3) & hv107_j==5 replace yschooling_j =6 if (hv106_j==2 | hv106_j==3) & hv107_j==6 replace yschooling_j =7 if (hv106_j==2 | hv106_j==3) & hv107_j==7 replace yschooling_j =8 if (hv106_j==2 | hv106_j==3) & hv107_j==8 replace yschooling_j =9 if (hv106_j==2 | hv106_j==3) & hv107_j==9 replace yschooling_j =7 if hv106_j==4 & hv107_j==0 replace yschooling_j =8 if hv106_j==4 & hv107_j==1 replace yschooling_j =9 if hv106_j==4 & hv107_j==2 replace yschooling_j =10 if hv106_j==4 & hv107_j==3 replace yschooling_j =11 if hv106_j==4 & hv107_j==4 replace yschooling_j =12 if hv106_j==4 & (hv107_j==5 | hv107_j==6 | hv107_j==7 | hv107_j==9) replace yschooling_j = 9 if hv106_j==5 & hv107_j==0 replace yschooling_j = 10 if hv106_j==5 & hv107_j==1 replace yschooling_j = 11 if hv106_j==5 & hv107_j==2 replace yschooling_j = 12 if hv106_j==5 & (hv107_j==3 | hv107_j==4 | hv107_j==7 | hv107_j==8 | hv107_j==9) replace yschooling_j = 12 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==0 replace yschooling_j = 13 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==1 replace yschooling_j = 14 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==2 replace yschooling_j = 15 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==3 replace yschooling_j = 16 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==4 replace yschooling_j = 17 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==5 replace yschooling_j = 18 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==6 replace yschooling_j = 19 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & hv107_j==7 replace yschooling_j = 20 if (hv106_j==6 | hv106_j==7 | hv106_j==8) & (hv107_j==8 | hv107_j==9) gen age_j=edad_1 if edad_1<99 replace yschooling_j=. if age_j<5 gen uno14=1 if age>=11 & age<. /* Number of HH members 11y or older */ bys hh_id: egen hhmember14 = sum(uno14) ** 1- DEPRIVED IN EDUCATION ** gen yschoolingi=0 if yschooling<5 & age>=11 & age<. replace yschoolingi=1 if yschooling>=5 & yschooling<. replace yschoolingi=1 if merge_w<3 & yschooling==. & (idnive1==6 | idnive1==7) gen yschoolingi_j=0 if yschooling_j<5 /* all HH heads are older than 11y */ replace yschoolingi_j=1 if yschooling_j>=5 & yschooling_j<. replace yschoolingi_j=1 if yschooling_j==. & (idnive_1==8 | idnive_2==4 | idnive_2==5 | idnive_2==6 | idnive_2==8) gen schooling_missing = 1 if yschoolingi==. & age>=11 & age<. egen schooling_missinghh=sum(schooling_missing), by(hh_id) gen schooling_missing_j = 1 if yschoolingi_j==. egen schooling_missinghh_j=sum(schooling_missing_j), by(hh_id) egen yeduchh=sum(yschoolingi), by(hh_id) /* assumes that a member has <6 y schooling when there is missing info on that member's schooling */ replace yeduchh=. if schooling_missinghh==hhmember14 egen yeduchh_j=sum(yschoolingi_j), by(hh_id) missing * DEPRIVED IN EDUCATION INDICATOR * gen educ_depriv=1 if yeduchh==0 & yeduchh_j==0 replace educ_depriv=0 if (yeduchh>=1 & yeduchh<.) | (yeduchh_j>=1 & yeduchh_j<.) *replace educ_depriv=yeduchh if educ_depriv==. & yeduchh<. & yeduchh_j==. & hhmember14==1 replace educ_depriv=1 if yeduchh_j==0 & educ_depriv==. & yeduchh_j<. & yeduchh==. & hhmember14==0 replace educ_depriv=0 if (yeduchh_j>=1 & yeduchh_j<.) & educ_depriv==. & yeduchh_j<. & yeduchh==. & hhmember14==0 ** 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 asistees==9 & age>=7 & age<15 gen child_7_14=1 if age>=7 & age<15 egen attendance_missinghh=sum(attendance_missing), by(hh_id) egen child_7_14hh=sum(child_7_14), by(hh_id) gen child_6_14=1 if age>=6 & age<15 egen child_6_14hh=sum(child_6_14), by(hh_id) 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(hh_id) gen child_noattend=1 if asistees==0 & age>=7 & age<15 replace child_noattend=0 if asistees==1 & age>=7 & age<15 * DEPRIVED IN SCHOOL ATTENDANCE 7-14Y * egen child_noattendhh=sum(child_noattend), by(hh_id) replace child_noattendhh=1 if child_noattendhh>1 & child_noattendhh<. *replace child_noattendhh=. if attendance_missing_finalhh>=1 & attendance_missing_finalhh<. *replace child_noattendhh=. if child_noattendhh==0 & attendance_missing_finalhh>=1 & attendance_missing_finalhh>(1/3*child_7_14hh) 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 DHS 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. DHS contains nutritional information on women between 15 and 49 years (Body Mass Index, BMI hereafter) and on the under-5-year-old children of the household (weight and height). This allows constructing a composite indicator which considers a household to be deprived (and therefore all its members) if there is either a woman or a child undernourished in the household. */ sort hh_id save "Argentina_MPI_2005.dta", replace ** 1- NUTRITION ** replace hhmember0_5=0 if hhmember0_5==. gen undernutritionhh=0 if malnourishedwhh==0 & malnourished5hh==0 replace undernutritionhh=0 if malnourishedwhh==0 & malnourished5hh==. & hhmember0_5==0 replace undernutritionhh=0 if malnourished5hh==0 & malnourishedwhh==. & whh==0 replace undernutritionhh=1 if (malnourishedwhh>0 & malnourishedwhh<.) | (malnourished5hh>0 & malnourished5hh<.) ** 2- DEPRIVED IN MORTALITY ** replace children_diedhh=0 if children_diedhh==. & whh==0 replace children_died5hh=0 if children_died5hh==. & whh==0 gen mortality5hh=0 if children_diedhh==0 replace mortality5hh=1 if (children_diedhh>=1 & children_diedhh<.) *gen region = hv024 compress sort hh_id save "Argentina_MPI_2005.dta", replace * NON-ELIGIBLE POPULATION * gen uno7_14=1 if age>=7 & age<15 bys hh_id: egen hhmember7_14 = sum(uno7_14) gen uno15_49=1 if merge_w<3/*age>=15 & age<=49 & sex==0*/ bys hh_id: egen hhmember15_49 = sum(uno15_49) *capture drop uno0_5 hhmember0_5 *gen uno0_5=1 if age<=5 *bys hh_id: egen hhmember0_5 = sum(uno0_5_2) 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 nutrihh=1 if undernutritionhh<. & (malnourished5hh<. | malnourishedwhh<.) replace nutrihh=3 if undernutritionhh==. & malnourished5hh==. & malnourishedwhh==. & uno15_49hh==0 & uno0_5hh==0 replace nutrihh=4 if undernutritionhh==. & malnourished5hh==. & malnourishedwhh==. & (uno15_49hh==1 | uno0_5hh==1) replace nutrihh=2 if undernutritionhh==. & nutrihh==. *replace nutrihh=1 if undernutritionhh==0 & (malnourishedwhh==0 & malnourished5hh==. & (whh>0 | hhmember0_5>0) & nc5>0 & nc5<. & nc5==hhmember0_5) *replace nutrihh=1 if undernutritionhh==0 & (malnourishedwhh==0 & malnourished5hh==. & (whh>0 | hhmember0_5>0) & nc5>0 & nc5<. & hhmember0_5>nc5 & (nw_zha/(hhmember0_5-nc5)>=(1/2))) *replace nutrihh=3 if nutrihh==4 & hhmember0_5>0 & nc5==hhmember0_5 & whh==0 replace nutrihh=2 if nutrihh==4 & missing_bmihh>0 & missing_bmihh<. replace nutrihh=2 if nutrihh==4 & missing_zwahh>0 & missing_zwahh<. 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 & no women 15-49y)" 4 "HH with eligible population for nutrition but measures not taken" label values nutrihh nutrihh replace undernutritionhh=0 if undernutri==. & nutrihh==3 /* only children between 61 and 72 months, they were taken height but not weight, assumed not deprived because there is no eligible population */ 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=3 if mortality5hh==0 & uno15_49hh==0 replace morthh=2 if mortality5hh==. 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 ** STANDARIZE SAMPLE WEIGHTS ** gen sample_wc = 1 if merge_anthro==1 replace sample_wc = 2 if whh==0 & merge_anthro==3 replace sample_wc = 3 if whh>0 & whh<. & merge_anthro==3 label define sample_wc 1 "Women without children" 2 "Children without women" 3 "Women and children" label values sample_wc sample_wc forvalues i = 1(1)3 { egen weight_ms`i' = sum(weight) if sample_wc==`i', by(hh_id) gen weight_mean`i' = weight_ms`i'/n_interviewed2 if sample_wc==`i' sum weight_mean`i' if sample_wc==`i' gen weight_m`i'=weight_mean`i'/r(mean) if sample_wc==`i' } ren weight weight_orig gen weight=weight_m1 if sample_wc==1 replace weight=weight_m2 if sample_wc==2 replace weight=weight_m3 if sample_wc==3 compress sort hh_id ind_id save "Argentina_MPI_2005.dta", replace keep hh_id electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv educ_depriv child_noattendhh undernutritionhh mortality5hh hhmembers_hh weight nutrihh morthh attehh sexon_1 collapse (mean) electricity_depriv sanitation_depriv water_depriv floor_depriv cookingfuel_depriv asset_depriv educ_depriv child_noattendhh undernutritionhh mortality5hh hhmembers_hh weight nutrihh morthh attehh sexon_1, by(hh_id) sort hh_id save "Argentina_MPI_2005_HH.dta", replace expand hhmembers_hh, gen(mc) sort hh_id save "Argentina_MPI_2005_IND.dta", replace ** DO FILE FROM OPHI TO COMPUTE MPI ** *************************************************************************** **** Multidimensional Poverty Measure ************************************* **** OPHI-HDCA Summer School 2011 ***************************************** **** 24 August to 3 September 2011 - Delft, the Netherlands *************** *************************************************************************** ** ADAPTED BY CECILIA ON MAY 2013 ** ** Argentina 2005 ** clear set more off set maxvar 10000 set mem 500m cap log close *** Replace here your path to the dataset*** cd "C:\Users\cecilia.calderon\HDRO_MCC\MPI\MPI_new calculations\Argentina ENNyS\ENNyS\" *** Replace here the name of your dataset*** capture log close log using "M0_dofile_Argentina2005_MPI2.log", text replace use "Argentina_MPI_2005_IND.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) ** 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 | morthh==3) & (nutrihh==1 | nutrihh==3) *replace w_mortality5hh = 0 if morthh==3 & nutrihh==1 gen w_undernutritionhh = 1/6 if (morthh==1 | morthh==3) & (nutrihh==1 | nutrihh==3) *replace w_undernutritionhh = 1/3 if morthh==3 & nutrihh==1 gen w_child_noattendhh = 1/6 if (attehh==1 | attehh==3) & educ_depriv<. *replace w_child_noattendhh = 0 if attehh==3 & educ_depriv<. gen w_educ_depriv = 1/6 if educ_depriv<. & (attehh==1 | attehh==3) *replace w_educ_depriv = 1/3 if educ_depriv<. & attehh==3 ******************************************************************* ********* 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 *sort age bys hh_id: 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 * CONTRIBUTION OF EACH DIMENSION FOR THE VULNERABLE + POOR POEPLE (ci >= 0.2) capture drop *vupo foreach var in `varlist_pov' { gen `var'_CH_33vupo=0 if h_33p<. & ci>=0.2 & ci<. replace `var'_CH_33vupo=1 if `var'==1 & h_33p<. & ci>=0.2 & ci<. replace `var'_CH_33vupo=. if missing==1 } gen ceduvupo = (child_noattendhh_CH_33vupo * w_child_noattendhh) + (educ_depriv_CH_33vupo * w_educ_depriv) sum ceduvupo [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar mpi_eduvupo=r(mean) gen chealthvupo = (mortality5hh_CH_33vupo * w_mortality5hh) + (undernutritionhh_CH_33vupo * w_undernutritionhh) sum chealthvupo [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar mpi_healthvupo=r(mean) gen clsvupo = (asset_depriv_CH_33vupo * w_asset_depriv) + (electricity_depriv_CH_33vupo * w_electricity_depriv) + (sanitation_depriv_CH_33vupo * w_sanitation_depriv) + (water_depriv_CH_33vupo * w_water_depriv) + (floor_depriv_CH_33vupo * w_floor_depriv) + (cookingfuel_depriv_CH_33vupo * w_cookingfuel_depriv) sum clsvupo [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar mpi_lsvupo=r(mean) sum ci [iw=weight] if h_33p<. & ci>=0.2 & ci<. scalar headcountvupo = r(mean) scalar headcountvupo100=headcountvupo*100 scalar edu_contribvupo = (mpi_eduvupo/headcountvupo100)*10000 scalar health_contribvupo = (mpi_healthvupo/headcountvupo100)*10000 scalar ls_contribvupo = (mpi_lsvupo/headcountvupo100)*10000 scalar list mpi headcount100 intensity100 vulnerable0 vulnerable20 severity edu_contrib health_contrib ls_contrib edu_contribvu health_contribvu ls_contribvu edu_contribvupo health_contribvupo ls_contribvupo cv_ineq_poor cv_ineq_positive cv_ineq_hc hh_sample_tot hh_sample_used hh_sample_used_w ind_sample_tot ind_sample_used ind_sample_used_w gen sample6y=1 if h_33p<. sort hh_id gen sample_all=1 sort hh_id save "Argentina_MPIorig_2005_final.dta", replace capture log close