******************************************************************************** /* Citation: Oxford Poverty and Human Development Initiative (OPHI), University of Oxford. 2020 Global Multidimensional Poverty Index - Cuba ENO 2017 [STATA do-file]. Available from OPHI website: http://ophi.org.uk/ For further queries, contact: ophi@qeh.ox.ac.uk */ ******************************************************************************** clear all set more off set maxvar 10000 set mem 500m *** Working Folder Path *** global path_in "../rdta/Cuba ENO 2017" global path_out "cdta" global path_ado "ado" ******************************************************************************** *** Cuba ENO 2017 *** ******************************************************************************** /*Note on microdata: The Encuesta Nacional De Ocupacion (ENO) microdata is not available on the public platform. The microdata was provided by the National Statistics and Information Office (ONEI) through a joint agreement between OPHI and ONEI solely for computing and publishing the global MPI aggregates. */ ******************************************************************************** *** Step 1: Data preparation ******************************************************************************** ******************************************************************************** *** Step 1.1 Generate Household & Individual Ids *** ******************************************************************************** use "$path_in/BD IPM 2017.dta", clear count gen double hh_id = NEW_ID*100 + provincia format hh_id %20.0g label var hh_id "Household ID" sort hh_id, stable by hh_id: gen double id = _n gen double ind_id = NEW_ID*10000 + provincia*100 + id format ind_id %20.0g label var ind_id "Individual ID" drop id duplicates report ind_id //154,737 individuals. No duplicates. sort ind_id ******************************************************************************** *** Step 1.2 RENAMING DEMOGRAPHIC VARIABLES *** ******************************************************************************** //Sample weight clonevar weight = FACTOR1 label var weight "Sample weight" //Area: urban or rural codebook Zona, tab (5) gen area = . replace area=1 if Zona=="Urbano" replace area=0 if Zona=="Rural" label define lab_area 1 "urban" 0 "rural" label values area lab_area label var area "Area: urban-rural" tab area, miss //Sex of household member codebook sexo clonevar sex = sexo recode sex (3=2) label define lab_sex 1"male" 2"female", replace label values sex lab_sex label var sex "Sex of household member" tab sex //Age of household member codebook edad, tab (999) clonevar age = edad label var age "Age of household member" //Age group (for global MPI estimation) recode age (0/4 = 1 "0-4")(5/9 = 2 "5-9")(10/14 = 3 "10-14") /// (15/17 = 4 "15-17")(18/59 = 5 "18-59")(60/max=6 "60+"), gen(agec7) lab var agec7 "age groups (7 groups)" recode age (0/9 = 1 "0-9") (10/17 = 2 "10-17")(18/59 = 3 "18-59") /// (60/max=4 "60+") , gen(agec4) lab var agec4 "age groups (4 groups)" recode age (0/17 = 1 "0-17") (18/max = 2 "18+"), gen(agec2) lab var agec2 "age groups (2 groups)" //Total number of de jure hh members in the household gen member = 1 bysort hh_id: egen hhsize = sum(member) label var hhsize "Household size" tab hhsize, miss drop member //Subnational region /* The sample for the Cuba ENO 2017 was designed to provide estimates at the province level*/ codebook provincia, tab (99) recode provincia (21 = 1 "Pinar del Río")(22 = 2 "Artemisa")(23 = 3 "La Habana") /// (24 = 4 "Mayabeque")(25 = 5 "Matanzas")(26 = 6 "Villa Clara") /// (27 = 7 "Cienfuegos")(28 = 8 "Sancti Spíritus")(29 = 9 "Ciego de Ávila") /// (30 = 10 "Camagüey")(31 = 11 "Las Tunas")(32 = 12 "Holguín") /// (33 = 13 "Granma")(34 = 14 "Santiago de Cuba")(35 = 15 "Guantánamo") /// (40 = 16 "Isla de la Juventud"), gen(region) codebook region, tab (99) lab var region "Region for subnational decomposition" tab provincia region, miss ******************************************************************************** *** Step 2 Data preparation *** *** Standardization of the 10 Global MPI indicators *** Identification of non-deprived & deprived individuals ******************************************************************************** ******************************************************************************** *** Step 2.1 Years of schooling *** ******************************************************************************** codebook p6, tab (999) /* p6: Highest grade or year of study passed {0} No grade passed {101-106} Elementary Grades (1st to 6th) {207-210} Elementary Secondary Grades (7th-9th) {301-303} Skilled Worker Degrees ** {410-413} Pre-university grades ** {501-505} Middle Technician Grades ** {601-607} University Degrees */ *** Standard MPI *** /*The entire household is considered deprived if no eligible household member has completed SIX years of schooling. */ ******************************************************************* gen d_eduyears = 0 replace d_eduyears = 1 if p6<106 & edad>=12 replace d_eduyears = . if edad<10 replace d_eduyears = . if p6<106 & edad==10 replace d_eduyears = . if p6<106 & edad==11 tab d_eduyears, miss bys hh_id: egen d_educ = min(d_eduyears) tab d_educ, miss *** Destitution MPI *** /*The entire household is considered deprived if no eligible household member has completed at least one year of schooling. */ ******************************************************************* generate d_eduyears_u = 0 replace d_eduyears_u = 1 if p6<=101 & edad>=12 replace d_eduyears_u = . if edad<10 replace d_eduyears_u = . if p6<=101 & edad==10 replace d_eduyears_u = . if p6<=101 & edad==11 tab d_eduyears_u, miss bys hh_id: egen dst_educ = min(d_eduyears_u) tab dst_educ, miss ******************************************************************************** *** Step 2.2 School Attendance *** ******************************************************************************** /* edad1-edad5: Age of household member of school age (6-18 years) p1_a1- p1_a5: School-age member's attendance at school (6-18) 1 Yes 3 No */ *** Standard MPI *** /*The entire household is considered deprived if any school-aged child (6-14 years) is not attending school up to class 8. */ ******************************************************************* gen child_schoolage = (edad>=6 & edad<=14) if edad!=. tab child_schoolage, miss /*In Cuba, the official school entrance age to primary school is 6 years. So, age range is 6-14 (=6+8). 15,315 individuals between 6-14 years */ bys hh_id: egen hh_child_schoolage = sum (child_schoolage) tab hh_child_schoolage, miss gen d_attend = 1 if p1_a1==3 & (edad1>=6 & edad1<=14) replace d_attend = 1 if p1_a2==3 & (edad2>=6 & edad2<=14) replace d_attend = 1 if p1_a3==3 & (edad3>=6 & edad3<=14) replace d_attend = 1 if p1_a4==3 & (edad4>=6 & edad4<=14) replace d_attend = 1 if p1_a5==3 & (edad5>=6 & edad5<=14) replace d_attend = 0 if p1_a1==1 & (edad1>=6 & edad1<=14) & d_attend ==. replace d_attend = 0 if p1_a2==1 & (edad2>=6 & edad2<=14) & d_attend ==. replace d_attend = 0 if p1_a3==1 & (edad3>=6 & edad3<=14) & d_attend ==. replace d_attend = 0 if p1_a4==1 & (edad4>=6 & edad4<=14) & d_attend ==. replace d_attend = 0 if p1_a5==1 & (edad5>=6 & edad5<=14) & d_attend ==. tab d_attend, miss tab d_attend if edad>=6 & edad<=14, miss /*A control variable is created on whether there is no information on school attendance for at least 2/3 of the school age children */ count if child_schoolage==1 & d_attend==. //How many eligible school aged children are not attending school: 109 children gen temp = 1 if child_schoolage==1 & d_attend!=. /*Generate a variable that captures the number of eligible school aged children who have school attendance information */ bysort hh_id: egen no_missing_atten = sum(temp) /*Total school age children with no missing information on school attendance */ gen temp2 = 1 if child_schoolage==1 bysort hh_id: egen hhs = sum(temp2) //Total number of household members who are of school age replace no_missing_atten = no_missing_atten/hhs replace no_missing_atten = (no_missing_atten>=2/3) /*Identify whether there is missing information on school attendance for more than 2/3 of the school age children */ tab no_missing_atten, miss //The value for 0 (missing) is 0.58% label var no_missing_atten "No missing school attendance for at least 2/3 of the school aged children" drop temp temp2 hhs bys hh_id: egen d_satt = max(d_attend) replace d_satt = 0 if hh_child_schoolage==0 //Replace all household that do not have schoolage children as non-deprived. replace d_satt = . if d_satt==0 & no_missing_atten==0 /*If the household has been intially identified as non-deprived, but has missing school attendance for at least 2/3 of the school aged children, then we replace this household with a value of '.' because there is insufficient information to conclusively conclude that the household is not deprived */ tab d_satt, miss *** Destitution MPI *** /*The entire household is considered deprived if any school-aged child is not attending school up to class 6. */ ******************************************************************* gen child_schoolage_u = (edad>=6 & edad<=12) if edad!=. tab child_schoolage_u, miss //11,609 individuals between 6-12 years bys hh_id: egen hh_child_schoolage_u = sum (child_schoolage_u) tab hh_child_schoolage_u, miss gen d_attend_u = 1 if p1_a1==3 & (edad1>=6 & edad1<=12) replace d_attend_u = 1 if p1_a2==3 & (edad2>=6 & edad2<=12) replace d_attend_u = 1 if p1_a3==3 & (edad3>=6 & edad3<=12) replace d_attend_u = 1 if p1_a4==3 & (edad4>=6 & edad4<=12) replace d_attend_u = 1 if p1_a5==3 & (edad5>=6 & edad5<=12) replace d_attend_u = 0 if p1_a1==1 & (edad1>=6 & edad1<=12) & d_attend_u ==. replace d_attend_u = 0 if p1_a2==1 & (edad2>=6 & edad2<=12) & d_attend_u ==. replace d_attend_u = 0 if p1_a3==1 & (edad3>=6 & edad3<=12) & d_attend_u ==. replace d_attend_u = 0 if p1_a4==1 & (edad4>=6 & edad4<=12) & d_attend_u ==. replace d_attend_u = 0 if p1_a5==1 & (edad5>=6 & edad5<=12) & d_attend_u ==. tab d_attend_u, miss /*A control variable is created on whether there is no information on school attendance for at least 2/3 of the school age children */ count if child_schoolage==1 & d_attend_u==. //How many eligible school aged children are not attending school: 109 children gen temp = 1 if child_schoolage==1 & d_attend_u!=. /*Generate a variable that captures the number of eligible school aged children who have school attendance information */ bysort hh_id: egen no_missing_atten_u = sum(temp) /*Total school age children with no missing information on school attendance */ gen temp2 = 1 if child_schoolage==1 bysort hh_id: egen hhs = sum(temp2) //Total number of household members who are of school age replace no_missing_atten_u = no_missing_atten_u/hhs replace no_missing_atten_u = (no_missing_atten_u>=2/3) /*Identify whether there is missing information on school attendance for more than 2/3 of the school age children */ tab no_missing_atten_u, miss //The value for 0 (missing) is 0.47% label var no_missing_atten_u "No missing school attendance for at least 2/3 of the school aged children (dst)" drop temp temp2 hhs bys hh_id: egen dst_satt = max(d_attend_u) replace dst_satt = 0 if hh_child_schoolage_u==0 replace dst_satt = . if dst_satt==0 & no_missing_atten==0 tab dst_satt, miss ******************************************************************************** *** Step 2.3 Nutrition *** ******************************************************************************** //Data has no anthropometric data. gen d_nutr = . gen dst_nutr =. ******************************************************************************** *** Step 2.4 Child Mortality Under 18 *** ******************************************************************************** /* p3a Have any member of the household died in the last 5 years? 1-Yes; 3- No; 9- Don't know / No answer p3_edad1 - p3_edad5 Deceased's age (in years) */ *** Standard MPI *** /* Household is deprived if at least one member aged 0 to 18 has died in the household in the last 5 years. */ ************************************************************************ gen child18_died = 0 replace child18_died = . if p3a==9 //304 missing replace child18_died = 1 if (p3a==1 & p3_edad1<18) replace child18_died = 1 if (p3a==1 & p3_edad2<18) & child18_died!=1 replace child18_died = 1 if (p3a==1 & p3_edad3<18) & child18_died!=1 replace child18_died = 1 if (p3a==1 & p3_edad4<18) & child18_died!=1 replace child18_died = 1 if (p3a==1 & p3_edad5<18) & child18_died!=1 tab child18_died, miss bys hh_id: egen d_cm = max(child18_died) tab d_cm, miss *** Destitution MPI *** *** (same as standard MPI) *** ************************************************************************ gen dst_cm = d_cm ******************************************************************************** *** Step 2.5 Electricity *** ******************************************************************************** /* p1v: Housing Type 1 House 2 Apartment 3 Room in a nursery or neighborhood house 4 Bohío 5 Improvised 6 Other 0 Non-main household p10v: Power source for household lighting 1 Electrical connection 2 Industrial plant, own plant, mini hydroelectric 3 Other energy sources 8 Does not have 0 Non-main household */ codebook p10v, tab (99) *** Standard MPI *** /*Members of the household are considered deprived if the household has no electricity */ **************************************** gen d_elct = 0 replace d_elct = 1 if p10v==8 replace d_elct=. if p10v==. | p1v==6 tab d_elct, miss *** Destitution MPI *** *** (same as standard MPI) *** **************************************** gen dst_elct = d_elct ******************************************************************************** *** Step 2.6 Sanitation *** ******************************************************************************** /* p8va: Use of toilet: 1 Exclusive to the home 3 Common to several dwellings 8 Does not have 0 Non-main household p8vb: Type of sanitary service that has: 1 water toilet 2 sanitary latrine 3 blind pit or cesspool 0 non-main household */ codebook p8va p8vb tab p8va p8vb, miss *** Standard MPI *** /*Members of the household are considered deprived if the household's sanitation facility is not improved (according to the SDG guideline) or it is improved but shared with other households*/ ******************************************************************** gen d_sani = 0 replace d_sani = 1 if p8va==3 | p8va==8 replace d_sani = 1 if d_sani==0 & p8vb==3 //Cesspool is considered deprived. See: https://es.wikipedia.org/wiki/Pozo_ciego replace d_sani = . if p1v==6 tab d_sani, miss *** Destitution MPI *** /*Members of the household are considered deprived if household practises open defecation or uses other unidentifiable sanitation practises */ ******************************************************************** gen dst_sani = 0 replace dst_sani = 1 if p8va==8 replace dst_sani = . if p1v==6 tab dst_sani, miss ******************************************************************************** *** Step 2.7 Drinking water *** ******************************************************************************** /* p5vb: Water source 1 Aquaduct ND 2 Public taps ND 3 Truck D 4 Well ND - no information if well is protected or not. Follow IPM. 5 Cistern D - no information on condition of the cistern. Follow IPM. 6 Others D 0 Non-primary household D Note: the IPM adheres to the definition of SDG indicators that includes pipe, spring and well, as improved, although it does not say anything about the cistern. */ codebook p5vb *** Standard MPI *** /* Members of the household are considered deprived if the household does not have access to improved drinking water (according to the SDG guideline) or safe drinking water is at least a 30-minute walk from home, roundtrip. However Cuba ENO lack data on time to water. So the indicator is constructed using only data on source of water. */ ******************************************************************** gen d_wtr = 0 replace d_wtr = 1 if p5vb==3 | p5vb==5 | p5vb==6 replace d_wtr = . if p1v==6 tab d_wtr, miss *** Destitution MPI *** /* Members of the household is identified as destitute if household does not have access to safe drinking water, or safe water is more than 45 minute walk from home, round trip. Since Cuba ENO lack data on time to water, the indicator for Standard MPI and Destitution will be the same. */ ******************************************************************** clonevar dst_wtr = d_wtr ******************************************************************************** *** Step 2.8 Housing *** ******************************************************************************** /* p4_pis : Type of floor 1 Slab, granite, mosaic, etc. 2 Cement 3 Wood 4 Earth 5 Other */ codebook p4_pis, tab (999) gen d_floor = 0 replace d_floor = 1 if p4_pis==4 | p4_pis==5 //Household is deprived if the floor is earth or other tab d_floor, miss /*p4_par : Type of walls 1 Concrete, masonry 2 Wood 3 Yagua or palm board 4 Adobe or embarre 5 Other */ codebook p4_par, tab (999) gen d_wall=0 replace d_wall=1 if p4_par==3 | p4_par==4 | p4_par==5 //Household is deprived if the walls are made of natural, rudimentary or other materials tab d_wall, miss /* p4_tec: Type of roof 1 Plate or beam and concrete slab 2 tile 3 Metal fiber cement sheet, etc. 4 Wood or tarred paper 5 Guano 6 Other */ codebook p4_tec, tab (999) gen d_roof=0 replace d_roof=1 if p4_tec==4 | p4_tec==5 | p4_tec==6 //Household is deprived if the roof is made of natural, rudimentary or other materials tab d_roof, miss *** Standard MPI *** /* Members of the household is deprived in housing if the roof, floor OR walls are constructed from low quality materials.*/ ************************************************************** gen d_hsg = (d_floor==1 | d_wall==1 | d_roof==1) replace d_hsg = . if d_floor==. & d_wall==. & d_roof==. tab d_hsg, miss *** Destitution MPI *** /* Members of the household is deprived in housing if two out of three components (roof and walls; OR floor and walls; OR roof and floor) the are constructed from low quality materials. */ ************************************************************** gen dst_hsg = (d_floor==1 & d_wall==1 & d_roof==0) replace dst_hsg = 1 if (d_floor==1 & d_wall==0 & d_roof==1) replace dst_hsg = 1 if (d_floor==0 & d_wall==1 & d_roof==1) replace dst_hsg = 1 if (d_floor==1 & d_wall==1 & d_roof==1) replace dst_hsg = . if d_floor==. & d_wall==. & d_roof==. tab dst_hsg, miss ******************************************************************************** *** Step 2.9 Cooking fuel *** ******************************************************************************** /* p4v: Type of energy or fuel that you use the most for cooking 1 Electricity 2 Manufactured gas (per pipeline) 3 Liquid gas 4 Kerosene) 5 Petroleum 6 Alcohol 7 Firewood, charcoal or other 8 None 0 Non-main household */ codebook p4v, tab (999) *** Standard MPI *** /* Members of the household are considered deprived if the household uses solid fuels and solid biomass fuels for cooking. */ ***************************************************************** gen d_ckfl = 0 replace d_ckfl = 1 if p4v==7 replace d_ckfl = . if p1v==6 tab d_ckfl, miss *** Destitution MPI *** *** (same as standard MPI) *** **************************************** gen dst_ckfl = d_ckfl ******************************************************************************** *** Step 2.10 Assets *** ******************************************************************************** *** Television codebook p11vc gen television = p11vc replace television = 1 if p11vc>=1 tab p11vc television *** Radio codebook p11va gen radio = p11va replace radio = 1 if p11va>=1 tab p11va radio *** Handphone/telephone codebook p11vp p11vq gen telephone = p11vp replace telephone=1 if telephone==0 & p11vq>=1 tab p11vq p11vp if telephone==1,miss tab telephone,miss *** Refrigerator codebook p11vf gen refrigerator = p11vf replace refrigerator = 1 if p11vf>=1 tab p11vf refrigerator *** Car/van/lorry/truck codebook p11vr gen car = p11vr replace car = 1 if p11vr>=1 tab p11vr car *** Bicycle codebook p11vt gen bicycle = p11vt replace bicycle = 1 if p11vt>=1 tab p11vt bicycle *** Motorbike/motorized bike gen motorbike = . *** Computer/laptop/tablet codebook p11vo gen computer = p11vo replace computer = 1 if p11vo>=1 tab p11vo computer *** Animal cart gen animal_cart = . //Label indicators lab var television "Household has television" lab var radio "Household has radio" lab var telephone "Household has telephone (landline/mobilephone)" lab var refrigerator "Household has refrigerator" lab var car "Household has car" lab var bicycle "Household has bicycle" lab var motorbike "Household has motorbike" lab var computer "Household has computer" lab var animal_cart "Household has animal cart" *** Standard MPI *** /* Members of the household are considered deprived in assets if the household does not own more than one of: radio, TV, telephone, bike, motorbike, refrigerator, computer or animal cart and does not own a car or truck.*/ ***************************************************************************** egen n_small_assets2 = rowtotal(television radio telephone refrigerator bicycle motorbike computer animal_cart), missing gen d_asst = (car==0 & n_small_assets2 <= 1) replace d_asst = . if car==. & n_small_assets2==. tab d_asst, miss *** Destitution MPI *** /* Members of the household are considered deprived in assets if the household does not own any assets.*/ ***************************************************************************** gen dst_asst = (car==0 & n_small_assets2==0) replace dst_asst = . if car==. & n_small_assets2==. tab dst_asst, miss ******************************************************************************** *** Step 2.11 Rename and keep variables for MPI calculation ******************************************************************************** //Retain data on sampling design: gen psu = UPMs gen strata = ESTRATO //Retain year, month & date of interview: gen year_interview = ano gen month_interview = . gen date_interview = . //Generate presence of subsample gen subsample = . *** Generate coutry and survey details for estimation *** char _dta[cty] "Cuba" char _dta[ccty] "CUB" char _dta[year] "2017" char _dta[survey] "ENO" char _dta[ccnum] "192" char _dta[type] "micro" char _dta[class] "new_country" *** Total number of missing values for each variable *** mdesc psu strata area age /// d_cm d_nutr d_satt d_educ d_elct d_wtr d_sani d_hsg d_ckfl d_asst *** Keep main variables require for MPI calculation *** keep hh_id ind_id psu strata subsample weight area region agec4 agec2 /// d_cm d_nutr d_satt d_educ d_elct d_wtr d_sani d_hsg d_ckfl d_asst order hh_id ind_id psu strata subsample weight area region agec4 agec2 /// d_cm d_nutr d_satt d_educ d_elct d_wtr d_sani d_hsg d_ckfl d_asst *** Sort, compress and save data for estimation *** sort ind_id compress la da "Micro data for `_dta[ccty]' (`_dta[ccnum]') from `c(current_date)' (`c(current_time)')." save "$path_out/cub_eno17.dta", replace