diff --git a/GLD/MUS/MUS_1999_CMPHS/MUS_1999_CMPHS_V01_M_V01_A_GLD/Programs/MUS_1999_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_1999_CMPHS/MUS_1999_CMPHS_V01_M_V01_A_GLD/Programs/MUS_1999_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..a9676485e --- /dev/null +++ b/GLD/MUS/MUS_1999_CMPHS/MUS_1999_CMPHS_V01_M_V01_A_GLD/Programs/MUS_1999_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1641 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_1999_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-20 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 1999 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 04/1999 +<_Data collection to_> 12/1999 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 4,726 +<_Sample size (IND)_> 18,316 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- + +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations 1999 +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities rev 1 + +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "1999" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMHS1999.dta", clear + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode="MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + + +*<_year_> + gen int year=1999 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year= 1999 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=c02month + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(c01serialno, "%05.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen mem_num = string(q201memserialno, "%02.0f") + gen pid = hhid + mem_num + isid pid + label var pid "Individual ID" +* + + +*<_weight_> +* Not available + gen double weight= 1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=c04stratum + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=c04stratum + recode urban (1 2 =1) (3=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if c03district == 1 + replace subnatid1 = "2 - Pamplemousses" if c03district == 2 + replace subnatid1 = "3 - Riviere-du-Rempart" if c03district == 3 + replace subnatid1 = "4 - Flacq" if c03district == 4 + replace subnatid1 = "5 - Grand Port" if c03district == 5 + replace subnatid1 = "6 - Savanne" if c03district == 6 + replace subnatid1 = "7 - Plaine-Wilhems" if c03district == 7 + replace subnatid1 = "8 - Moka" if c03district == 8 + replace subnatid1 = "9 - Black River" if c03district == 9 + replace subnatid1 = "10 - Rodrigues" if c03district == 10 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen byte subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen byte hsize=c09hhsize + label var hsize "Household size" +* + + +*<_age_> + gen age=q204age + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen byte male=q205sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=q203reltohead + replace relationharm=4 if q203reltohead==6 + replace relationharm=5 if q203reltohead==4 |q203reltohead==5 |q203reltohead==7 | q203reltohead==8 + replace relationharm=6 if q203reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=q206mstatus + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=(q303schoolatta==1) + replace school=1 if q307schoolattv==1 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy= . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7=q304edulevel + replace educat7 = 1 if q304edulevel == 1 + replace educat7 = 2 if inrange(q304edulevel, 101, 105) + replace educat7 = 3 if q304edulevel == 106 + replace educat7 = 4 if inrange(q304edulevel, 201, 203) + replace educat7 = 5 if inrange(q304edulevel, 204, 206) + replace educat7 = 7 if inrange(q304edulevel, 301, 399) + + gen qual1d = int(q308qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = q304edulevel + replace educat_orig = q308qualcourse if !missing(q308qualcourse) + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> +* Survey does not ask the reason for absence and whether there is still job attachment +* Assume temporary absence since that is often the case +* Also, temporary absent were not asked unemployment questions, so survey logic assumes htey are employed + gen byte lstatus=. + replace lstatus=1 if q401didwork==1 | q404aabsence==1 + replace lstatus=2 if q401didwork==2 & q412alookjob==1 & q420availwk==1 + replace lstatus=3 if missing(lstatus) & age>= minlaborage + replace lstatus=. if age + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 0 if lstatus == 3 + replace potential_lf = 1 if (q412alookjob==1 | q420availwk==1) & lstatus == 3 + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason= q421whynotavail if lstatus==3 + recode nlfreason (2=1) (1=2) (3=4) (4=3) + replace nlfreason=. if lstatus!=3|age<12 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=q413timelookwk if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=q413timelookwk if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat=q406fstatus + recode empstat (3=1) (4 5=2) (1=3) (2=4) (6=5) + replace empstat=. if lstatus!=1 | age + + +*<_ocusec_> + gen byte ocusec=q406asector + recode ocusec (1/3=1) (4=3) (5/9=2) (0=.) + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=q406dactivity + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = string(q406dactivity, "%02.0f") + "00" if !missing(q406dactivity) + * There seems to be a typo; 1 case each for code "04" and "81" which do not exist in ISIC + replace industrycat_isic = "" if inlist(q406dactivity, 4, 81) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig= string(q406eoccupation) if !missing(q406eoccupation) + replace occup_orig="" if lstatus!=1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + + * THese are codes that are not in ISCO 88. Suspected to be typos because only 1 case each. + replace occup_isco = "" if inlist(q406eoccupation, 45, 63, 85, 99) + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + gen byte occup=q406eoccupation if lstatus==1 + recode occup (11/13=1) (21/24=2) (31/34=3) (41/45=4) (51/54=5) (60/63=6) (71/75=7) (81/85=8) (91/95=9) (99=.) + label var occup "1 digit occupational classification, primary job 7 day recall" + la de lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen= q406j1income + replace wage_no_compen=. if lstatus==2 | lstatus==3 + replace wage_no_compen=. if wage_no_compen==99999 + replace wage_no_compen=0 if empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if !missing(wage_no_compen) + replace unitwage=. if lstatus==2 | lstatus==3 + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=q408ahoursmain + recode whours (0 99 = .) + replace whours=. if lstatus==2 | lstatus==3 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when availableqq and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> + gen byte empstat_2=. + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2=. + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2=. + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2001_CMPHS/MUS_2001_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2001_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2001_CMPHS/MUS_2001_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2001_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..e705dde31 --- /dev/null +++ b/GLD/MUS/MUS_2001_CMPHS/MUS_2001_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2001_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1644 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2001_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-20 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2001 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2001 +<_Data collection to_> 12/2001 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 6,300 +<_Sample size (IND)_> 24,539 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- + +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities + +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2001" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS 01.dta", clear + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode="MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + + +*<_year_> + gen int year=2001 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year= 2001 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=c02month + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(c01serialno, "%05.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen mem_num = string(r1memserialno, "%02.0f") + gen pid = hhid + mem_num + isid pid + label var pid "Individual ID" +* + + +*<_weight_> +* Not available + gen double weight= 1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=c04stratum + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=c04stratum + recode urban (1 2 =1) (3=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if c03district == 1 + replace subnatid1 = "2 - Pamplemousses" if c03district == 2 + replace subnatid1 = "3 - Riviere-du-Rempart" if c03district == 3 + replace subnatid1 = "4 - Flacq" if c03district == 4 + replace subnatid1 = "5 - Grand Port" if c03district == 5 + replace subnatid1 = "6 - Savanne" if c03district == 6 + replace subnatid1 = "7 - Plaine-Wilhems" if c03district == 7 + replace subnatid1 = "8 - Moka" if c03district == 8 + replace subnatid1 = "9 - Black River" if c03district == 9 + replace subnatid1 = "10 - Rodrigues" if c03district == 10 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen byte subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen byte hsize=c09hholdsize + label var hsize "Household size" +* + + +*<_age_> + gen age=q104age + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen byte male=q105sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=q103reltohead + replace relationharm=4 if q103reltohead==6 + replace relationharm=5 if q103reltohead==4 |q103reltohead==5 |q103reltohead==7 | q103reltohead==8 + replace relationharm=6 if q103reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=q106mstatus + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=(q107schoolatta==1) + replace school=1 if q109schoolattv==1 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy= . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> +* edulevel variable only until secondary +* we can use the qualification variable to infer post-secondary +* this is based on ISCED-76, where first digit informs level of education + gen byte educat7=. + replace educat7=1 if q108edulevel==1 + replace educat7=2 if q108edulevel>=11 & q108edulevel<=15 + replace educat7=3 if q108edulevel==16 + replace educat7=4 if q108edulevel>=21 & q108edulevel<=23 + replace educat7=5 if q108edulevel>=24 & q108edulevel<=26 + +* In ISCED, first digit = 5 means diploma + gen qual1d = int(q110qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + drop qual1d + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = q108edulevel + replace educat_orig = q110qualcourse + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> +* Survey does not ask the reason for absence and whether there is still job attachment +* Assume temporary absence since that is often the case +* Also, temporary absent were not asked unemployment questions, so survey logic assumes htey are employed + gen byte lstatus=. + replace lstatus=1 if q201didwork==1 | q202absent==1 + replace lstatus=2 if q201didwork==2 & q203lookwork==1 & q211availwork==1 + replace lstatus=3 if missing(lstatus) & age>= minlaborage + replace lstatus=. if age + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 0 if lstatus == 3 + replace potential_lf = 1 if (q203lookwork==1 | q211availwork==1) & lstatus == 3 + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason= q212whynotavail if lstatus==3 + recode nlfreason (2=1) (1=2) (3=4) (4=3) + replace nlfreason=. if lstatus!=3|age<12 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=q207timelookwk if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=q207timelookwk if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat=q223empstatus + recode empstat (3=1) (4 5=2) (1=3) (2=4) (6=5) + replace empstat=. if lstatus!=1 | age + + +*<_ocusec_> + gen byte ocusec=q214sector + recode ocusec (1/3=1) (4=3) (5/9=2) (0=.) + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=q221activity + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = string(q221activity, "%02.0f") + "00" if !missing(q221activity) + * There seems to be a typo; 1 case each for code "04" and "81" which do not exist in ISIC + replace industrycat_isic = "" if inlist(q221activity, 4, 81) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig= string(q222occupation) if !missing(q222occupation) + replace occup_orig="" if lstatus!=1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + + * THese are codes that are not in ISCO 88. Suspected to be typos because only 1 case each. + replace occup_isco = "" if inlist(q222occupation, 45, 63, 85, 99) + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + gen byte occup=q222occupation if lstatus==1 + recode occup (11/13=1) (21/24=2) (31/34=3) (41/45=4) (51/54=5) (60/63=6) (71/75=7) (81/85=8) (91/95=9) (99=.) + label var occup "1 digit occupational classification, primary job 7 day recall" + la de lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen= q227income + replace wage_no_compen=. if lstatus==2 | lstatus==3 + replace wage_no_compen=. if wage_no_compen==99999 + replace wage_no_compen=0 if empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if !missing(wage_no_compen) + replace unitwage=. if lstatus==2 | lstatus==3 + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=q228workhours + recode whours (0 99 = .) + replace whours=. if lstatus==2 | lstatus==3 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when availableqq and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> + gen byte empstat_2=. + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2=. + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2=. + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2002_CMPHS/MUS_2002_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2002_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2002_CMPHS/MUS_2002_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2002_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..b23fef158 --- /dev/null +++ b/GLD/MUS/MUS_2002_CMPHS/MUS_2002_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2002_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1651 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2002_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-22 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2002 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2002 +<_Data collection to_> 12/2002 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 6,300 +<_Sample size (IND)_> 24,552 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2002" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS 02.dta", clear + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode="MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=2002 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year= 2002 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=c02month + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(c01serialno, "%05.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen mem_num = string(r1memserialno, "%02.0f") + gen pid = hhid + mem_num + isid pid + label var pid "Individual ID" +* + + +*<_weight_> +* Not available + gen double weight= 1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=c04stratum + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=c04stratum + recode urban (1 2 =1) (3=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if c03district == 1 + replace subnatid1 = "2 - Pamplemousses" if c03district == 2 + replace subnatid1 = "3 - Riviere-du-Rempart" if c03district == 3 + replace subnatid1 = "4 - Flacq" if c03district == 4 + replace subnatid1 = "5 - Grand Port" if c03district == 5 + replace subnatid1 = "6 - Savanne" if c03district == 6 + replace subnatid1 = "7 - Plaine-Wilhems" if c03district == 7 + replace subnatid1 = "8 - Moka" if c03district == 8 + replace subnatid1 = "9 - Black River" if c03district == 9 + replace subnatid1 = "10 - Rodrigues" if c03district == 10 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen byte subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + + +{ + +*<_hsize_> + bys hhid: gen hsize = _N + label var hsize "Household size" +* + + +*<_age_> + gen age = q104age + replace age = 98 if age > 98 & age != . + label var age "Individual age" +* + + +*<_male_> + gen byte male = . + replace male = 1 if q105gender == 1 + replace male = 0 if q105gender == 2 + label var male "Sex - Ind is male" + label define lblmale 1 "Male" 0 "Female", replace + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm = q103reltohead + replace relationharm = 4 if q103reltohead == 6 + replace relationharm = 5 if inlist(q103reltohead, 4, 5, 7, 8) + replace relationharm = 6 if q103reltohead == 9 + label var relationharm "Relationship to the head of household - Harmonized" + label define lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives", replace + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen byte relationcs = q103reltohead + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = q106marstatus + recode marital (1=1) (3 4=4) (2=5) (5=2) + label var marital "Marital status" + label define lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed", replace + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + + + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> +* There is a separate set of questions for K-12 and post-secondary +* q203 asks if currently attending k-12 +* meanwhile, q205 currently attending post-secondary + gen byte school=(q203schattps==1) + replace school = 1 if q205schattoe == 1 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy= . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7=. + * K-12 education + replace educat7=1 if q204educlevel==1 + replace educat7=2 if q204educlevel>=11 & q204educlevel<=15 + replace educat7=3 if q204educlevel==16 + replace educat7=4 if q204educlevel>=21 & q204educlevel<=23 + replace educat7=5 if q204educlevel>=24 & q204educlevel<=26 + + * In ISCED, first digit = 5 means diploma + gen qual1d = int(q206qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + drop qual1d + + replace educat7=. if age + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = q204educlevel + replace educat_orig = q206qualcourse if !missing(q206qualcourse) + + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* +*%%============================================================================================= +* 8.1: 7 day reference overall +*=============================================================================================%% + +{ + +*<_lstatus_> +* Survey does not ask the reason for absence and whether there is still job attachment +* Assume temporary absence since that is often the case +* Also, temporary absent were not asked unemployment questions, so survey logic assumes they are employed + gen byte lstatus = . + replace lstatus = 1 if q301workpastwk == 1 | q302absent == 1 + replace lstatus = 2 if q301workpastwk == 2 & q303lookforwork == 1 & q307availwork == 1 + replace lstatus = 3 if (lstatus != 1 & q307availwork == 2) | (lstatus != 1 & q303lookforwork == 2) + replace lstatus = . if age < minlaborage & !missing(age) + label var lstatus "Labor status" + label define lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF", replace + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 0 if lstatus == 3 + replace potential_lf = 1 if (q303lookforwork == 1 | q307availwork == 1) & lstatus == 3 + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + label define lblpotential_lf 0 "No" 1 "Yes", replace + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + label define lblunderemployment 0 "No" 1 "Yes", replace + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason = q308whynotavail if lstatus == 3 + recode nlfreason (2=1) (1=2) (3=4) (4=3) + replace nlfreason = . if lstatus != 3 | age < minlaborage | missing(age) + label var nlfreason "Reason not in the labor force" + label define lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other", replace + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l = q306timelookwrk if lstatus == 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = q306timelookwrk if lstatus == 2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* + +} + + +*%%============================================================================================= +* 8.2: 7 day reference main job +*=============================================================================================%% + +{ + +*<_empstat_> + gen byte empstat = q313empstatus + recode empstat (3=1) (4 5=2) (1=3) (2=4) (6=5) + replace empstat = . if lstatus != 1 | age < minlaborage | missing(age) + label var empstat "Employment status during past week primary job 7 day recall" + label define lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status", replace + label values empstat lblempstat +* + + +*<_ocusec_> +* Not available in this file + gen byte ocusec = . + label var ocusec "Sector of activity primary job 7 day recall" + label define lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish", replace + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig = q311activity + replace industry_orig = . if lstatus != 1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = string(q311activity, "%02.0f") + "00" if !missing(q311activity) + * Mis-coding bec this does not exist in ISIC. 3 cases! + replace industrycat_isic = "" if q311activity == 94 | q311activity == 4 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1) (2 3 4 5=2) (6 7 8 9=3) (10=4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other", replace + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(q312occupation) if !missing(q312occupation) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + * THese are codes that are not in ISCO 88. Suspected to be typos because only 1 case each. + replace occup_isco = "" if inlist(q312occupation, 43, 54, 75, 95, 99) + label var occup_isco "ISCO code of primary job 7 day recall" +* + + + +*<_occup_> + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + label define lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill", replace + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen = q321income + replace wage_no_compen = . if lstatus == 2 | lstatus == 3 + replace wage_no_compen = . if wage_no_compen == 99999 + replace wage_no_compen = 0 if empstat == 2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 if !missing(wage_no_compen) + replace unitwage = . if lstatus == 2 | lstatus == 3 + label var unitwage "Last wages' time unit primary job 7 day recall" + label define lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other", replace + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours = q315workhours + recode whours (0 99 = .) + + replace whours = . if lstatus == 2 | lstatus == 3 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract = . + label var contract "Employment has contract primary job 7 day recall" + label define lblcontract 0 "Without contract" 1 "With contract", replace + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins = . + label var healthins "Employment has health insurance primary job 7 day recall" + label define lblhealthins 0 "Without health insurance" 1 "With health insurance", replace + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec = . + label var socialsec "Employment has social security insurance primary job 7 day recall" + label define lblsocialsec 1 "With social security" 0 "Without social secturity", replace + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union = . + label var union "Union membership at primary job 7 day recall" + label define lblunion 0 "Not union member" 1 "Union member", replace + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l = . + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u = . + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> + gen byte empstat_2=. + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2=. + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2=. + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2003_CMPHS/MUS_2003_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2003_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2003_CMPHS/MUS_2003_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2003_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..5d4d15bfd --- /dev/null +++ b/GLD/MUS/MUS_2003_CMPHS/MUS_2003_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2003_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1625 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2003_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-23 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2003 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2003 +<_Data collection to_> 12/2003 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 6,480 +<_Sample size (IND)_> 24,393 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2003" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMHS2003.dta", clear + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2003 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2003 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month = c02month + label define lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December", replace + label values int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(c01serialno, "%08.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen mem_num = string(r1memserialno, "%02.0f") + gen pid = hhid + mem_num + + isid pid + + label var pid "Individual ID" +* + + +*<_weight_> +* Not available + gen double weight = 1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen double weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen double weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = c04stratum + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban = c04stratum + recode urban (1 2 = 1) (3 = 0) + label var urban "Location is urban" + label define lblurban 1 "Urban" 0 "Rural", replace + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if c03district == 11 + replace subnatid1 = "2 - Pamplemousses" if c03district == 12 + replace subnatid1 = "3 - Riviere-du-Rempart" if c03district == 13 + replace subnatid1 = "4 - Flacq" if c03district == 14 + replace subnatid1 = "5 - Grand Port" if c03district == 15 + replace subnatid1 = "6 - Savanne" if c03district == 16 + replace subnatid1 = "7 - Plaine-Wilhems" if c03district == 17 + replace subnatid1 = "8 - Moka" if c03district == 18 + replace subnatid1 = "9 - Black River" if c03district == 19 + replace subnatid1 = "10 - Rodrigues" if c03district == 1 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + + +*<_subnatid2_> + gen byte subnatid2 = . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + bys hhid: gen hsize = _N + label var hsize "Household size" +* + + +*<_age_> + gen age = q14age + replace age = 98 if age > 98 & age != . + label var age "Individual age" +* + + +*<_male_> + gen byte male = . + replace male = 1 if q15sex == 1 + replace male = 0 if q15sex == 2 + label var male "Sex - Ind is male" + label define lblmale 1 "Male" 0 "Female", replace + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm = q13reltohead + replace relationharm = 4 if q13reltohead == 6 + replace relationharm = 5 if inlist(q13reltohead, 4, 5, 7, 8) + replace relationharm = 6 if q13reltohead == 9 + label var relationharm "Relationship to the head of household - Harmonized" + label define lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives", replace + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen byte relationcs = q13reltohead + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = q16marstatus + recode marital (1=1) (3 4=4) (2=5) (5=2) + label var marital "Marital status" + label define lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed", replace + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age = 0 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen byte school = (q23schoolatt == 1) + label var school "Attending school" + label define lblschool 0 "No" 1 "Yes", replace + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + label define lblliteracy 0 "No" 1 "Yes", replace + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy = . + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7 = . + + * K-12 education + replace educat7=1 if q24educlevel==1 + replace educat7=2 if q24educlevel>=11 & q24educlevel<=15 + replace educat7=3 if q24educlevel==16 + replace educat7=4 if q24educlevel>=21 & q24educlevel<=23 + * We set Forms 4, 5 and 6 as higher than secondary + replace educat7=5 if q24educlevel>=24 & q24educlevel<=26 + + + * In ISCED, first digit = 5 means diploma + gen qual1d = int(q26qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + label define lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete", replace + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6 7=5) + label var educat5 "Level of education 2" + label define lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary", replace + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4=2) (5=3) (6 7=4) + label var educat4 "Level of education 3" + label define lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary", replace + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = q24educlevel + replace educat_orig = q26qualcourse if !missing(q26qualcourse) + + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + + foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { + replace `ed_var' = . if (age < ed_mod_age & !missing(age)) + } + else { + replace `ed_var' = "" if (age < ed_mod_age & !missing(age)) + } + } +* + +} + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* +*%%============================================================================================= +* 8.1: 7 day reference overall +*=============================================================================================%% + +{ + +*<_lstatus_> +* Survey does not ask the reason for absence and whether there is still job attachment +* Assume temporary absence since that is often the case +* Also, temporary absent were not asked unemployment questions, so survey logic assumes they are employed + gen byte lstatus = . + replace lstatus = 1 if q301work == 1 | q303awayfromwrk == 1 + replace lstatus = 2 if q301work == 2 & q304lookforwrk == 1 & q311availwrk == 1 + replace lstatus = 3 if (lstatus != 1 & q311availwrk == 2) | (lstatus != 1 & q304lookforwrk == 2) + replace lstatus = . if age < minlaborage & !missing(age) + label var lstatus "Labor status" + label define lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF", replace + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 0 if lstatus == 3 + replace potential_lf = 1 if (q304lookforwrk == 1 | q311availwrk == 1) & lstatus == 3 + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + label define lblpotential_lf 0 "No" 1 "Yes", replace + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + label define lblunderemployment 0 "No" 1 "Yes", replace + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason = q312whynotavail if lstatus == 3 + recode nlfreason (2=1) (1=2) (3=4) (4=3) + replace nlfreason = . if lstatus != 3 | age < minlaborage | missing(age) + label var nlfreason "Reason not in the labor force" + label define lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other", replace + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l = q307timelookwrk if lstatus == 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = q307timelookwrk if lstatus == 2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* + +} + + +*%%============================================================================================= +* 8.2: 7 day reference main job +*=============================================================================================%% + +{ + +*<_empstat_> + gen byte empstat = q322employstat + recode empstat (3=1) (4 5=2) (1=3) (2=4) (6=5) + replace empstat = . if lstatus != 1 | age < minlaborage | missing(age) + label var empstat "Employment status during past week primary job 7 day recall" + label define lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status", replace + label values empstat lblempstat +* + + +*<_ocusec_> +* Not available in this file + gen byte ocusec = . + label var ocusec "Sector of activity primary job 7 day recall" + label define lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish", replace + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig = q320aactivity + replace industry_orig = . if lstatus != 1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = string(q320aactivity, "%02.0f") + "00" if !missing(q320aactivity) + replace industrycat_isic = "" if inlist(q320aactivity, 4, 81, 38, 54, 82, 0) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1) (2 3 4 5=2) (6 7 8 9=3) (10=4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other", replace + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(q321occupation) if !missing(q321occupation) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + * THese are codes that are not in ISCO 88. Suspected to be typos because only 1 case each. + replace occup_isco = "" if inlist(q321occupation, 45, 53, 57, 63, 66, 99) + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + label define lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill", replace + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen = q3251ncome + replace wage_no_compen = . if lstatus == 2 | lstatus == 3 + replace wage_no_compen = . if wage_no_compen == 99999 + replace wage_no_compen = 0 if empstat == 2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 if !missing(wage_no_compen) + replace unitwage = . if lstatus == 2 | lstatus == 3 + label var unitwage "Last wages' time unit primary job 7 day recall" + label define lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other", replace + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours = q324hoursworked + recode whours (0 99 = .) + replace whours = . if lstatus == 2 | lstatus == 3 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract = . + label var contract "Employment has contract primary job 7 day recall" + label define lblcontract 0 "Without contract" 1 "With contract", replace + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins = . + label var healthins "Employment has health insurance primary job 7 day recall" + label define lblhealthins 0 "Without health insurance" 1 "With health insurance", replace + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec = . + label var socialsec "Employment has social security insurance primary job 7 day recall" + label define lblsocialsec 1 "With social security" 0 "Without social secturity", replace + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union = . + label var union "Union membership at primary job 7 day recall" + label define lblunion 0 "Not union member" 1 "Union member", replace + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l = . + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u = . + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> + gen byte empstat_2=. + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2=. + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2=. + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2004_CMPHS/MUS_2004_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2004_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2004_CMPHS/MUS_2004_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2004_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..254a8a611 --- /dev/null +++ b/GLD/MUS/MUS_2004_CMPHS/MUS_2004_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2004_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1702 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2004_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-23 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2004 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2004 +<_Data collection to_> 12/2004 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 8,640 +<_Sample size (IND)_> 32,626 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2004" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS 04.dta", clear + + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2004 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2004 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=. + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> +/* <_hhid_note> + + I am seeing a potential household ID issue in the 2004 file. The serialno (household ID) repeats across records that look like separate households. Specifically, after row 3, memserialno restarts at 1 and hhno changes, which usually signals a new household, but serialno stays at 3949. Later, the serialno sequence also skips 3950, jumping from 3949 to 3951. This makes me think serialno may need to increment to 3950 starting at row 4 (through the second-to-last row). + + Same issue for 3785! I will replace the data + */ + + * Flag the start of a new household roster + gen byte hh_start = (memserialno == 1) + + * Running household number (1,2,3,...) + gen long hh_run = sum(hh_start) + + gen serialno_new = serialno + replace serialno_new = 3950 in 14991 + replace serialno_new = 3950 in 14992 + replace serialno_new = 3950 in 14993 + replace serialno_new = 3950 in 14994 + replace serialno_new = 3950 in 14995 + replace serialno_new = 3950 in 14996 + replace serialno_new = 3950 in 14997 + + replace serialno_new = 3786 in 14379 + replace serialno_new = 3786 in 14380 + replace serialno_new = 3786 in 14381 + replace serialno_new = 3786 in 14382 + replace serialno_new = 3786 in 14383 + + drop if reltohead==. + + gen hhid_str = string(serialno_new, "%04.0f") + gen hhno_str = string(hhno, "%02.0f") + + gen hhid = hhid_str + hhno_str + label var hhid "Household ID" +* + + +*<_pid_> + gen pid_str = string(memserialno, "%02.0f") + gen pid = hhid + pid_str + + duplicates tag pid, gen(dup) + * There are 16 duplicate pairs + + * Do they share the same labor module responses? + duplicates tag pid reltohead - hrswk, gen(x2) + + tab dup x2, mi + * 1 pair (=2 obs) do not share the same responses in the labor module + + duplicates drop pid reltohead - hrswk, force + + * Inspect the odd pair. + list pid reltohead - hrswk if x2 == 0 & dup == 1 + + * one of which has missing values for the labor module, we drop that! + drop if pid == "37860603" & missing(hrswk) + + + * There are duplicates in PID + duplicates drop pid, force + label var pid "Individual ID" +* + + +*<_weight_> + gen double weight=1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=. + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=. + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if district == 11 + replace subnatid1 = "2 - Pamplemousses" if district == 12 + replace subnatid1 = "3 - Riviere-du-Rempart" if district == 13 + replace subnatid1 = "4 - Flacq" if district == 14 + replace subnatid1 = "5 - Grand Port" if district == 15 + replace subnatid1 = "6 - Savanne" if district == 16 + replace subnatid1 = "7 - Plaine-Wilhems" if district == 17 + replace subnatid1 = "8 - Moka" if district == 18 + replace subnatid1 = "9 - Black River" if district == 19 + replace subnatid1 = "10 - Rodrigues" if district == 1 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + + +*<_subnatid2_> + gen byte subnatid2= . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + label var age "Individual age" +* + + +*<_male_> + gen byte male=sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=reltohead + replace relationharm=4 if reltohead==6 + replace relationharm=5 if reltohead==4 |reltohead==5 |reltohead==7 | reltohead==8 + replace relationharm=6 if reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=maritalstatus + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=schoolatt + recode school (2/4=0) + replace school=. if age<6 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=. if age<6 + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + * Here information is only provided for K-12 (up to Form 6, nothing to identify post-secondary) + gen byte educat7=. + replace educat7=1 if educattain==1 + replace educat7=2 if educattain>=11 & educattain<=16 + replace educat7=3 if inlist(educattain, 16, 17) + replace educat7=4 if educattain>=21 & educattain<=23 + replace educat7=5 if educattain>=24 & educattain<=28 + + * Use ISCED from field of study vble + gen qual1d = int(qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = educattain + replace educat_orig = qualcourse if !missing(qualcourse) + + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if work==1 | activities==1 | awayfrwk==1 + replace lstatus=2 if work==2 & lookfrwk==1 + replace lstatus=3 if lstatus!=1 & availwk==2 + replace lstatus=. if age<12 + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason=whynotavail if lstatus==3 + recode nlfreason (1= 2) (2 = 1) (3= 4) (4 = 3) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=timelkwk if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=timelkwk if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat=empstatus + recode empstat (3=1) (4 5=2) (1=3) (2=4) (6=5) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec=. + replace ocusec=1 if estabname>=1 & estabname<=3 + replace ocusec=2 if estabname>=5 & estabname<=9 + replace ocusec=3 if estabname==4 + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=string(activity, "%05.0f") if !missing(activity) + replace industry_orig= "" if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + + +*<_industrycat_isic_> + gen industry_2d = substr(industry_orig, 1, 2) + gen industrycat_isic = industry_2d + "00" if !missing(industry_orig) + * 5 total cases with code not mapped to ISIC + replace industrycat_isic = "" if inlist(activity, 4520, 83221, 83223, 89109) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(occupation) if !missing(occupation) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + drop occup + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen=paidempl + replace wage_no_compen=0 if empstat==2 + replace wage_no_compen=. if lstatus!=1 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if wage_no_compen!=. + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=hrswk + recode whours (0 99 = .) + replace whours=. if lstatus!=1 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when available and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=1 if nopersons==1 + replace firmsize_l=5 if nopersons==2 + replace firmsize_l=10 if nopersons==3 + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=4 if nopersons==1 + replace firmsize_u=9 if nopersons==2 + replace firmsize_u=. if nopersons==3 + replace firmsize_u=. if lstatus!=1 + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> + gen byte empstat_2=. + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2=. + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2=. + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2005_CMPHS/MUS_2005_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2005_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2005_CMPHS/MUS_2005_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2005_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..fc40316d8 --- /dev/null +++ b/GLD/MUS/MUS_2005_CMPHS/MUS_2005_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2005_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1669 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2005_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-23 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2005 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2005 +<_Data collection to_> 12/2005 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 11,280 +<_Sample size (IND)_> 41,894 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2005" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS 05.dta", clear + + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2005 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2005 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=. + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid_str = string(serialno, "%04.0f") + gen hhno_str = string(hhno, "%02.0f") + + gen hhid = hhid_str + hhno_str + label var hhid "Household ID" +* + + +*<_pid_> + gen pid_str = string(memserialno, "%02.0f") + gen pid = hhid + pid_str + + duplicates tag pid, gen(x) + * There are two duplicates in pid + + * Question: do they share the same responses in the labor module? + duplicates tag pid reltohead - hrsmain, gen(x2) + * Yes they do! + + duplicates drop pid reltohead - hrsmain, force + + isid pid + label var pid "Individual ID" +* + + +*<_weight_> + gen double weight=1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=. + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=. + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if district == 11 + replace subnatid1 = "2 - Pamplemousses" if district == 12 + replace subnatid1 = "3 - Riviere-du-Rempart" if district == 13 + replace subnatid1 = "4 - Flacq" if district == 14 + replace subnatid1 = "5 - Grand Port" if district == 15 + replace subnatid1 = "6 - Savanne" if district == 16 + replace subnatid1 = "7 - Plaine-Wilhems" if district == 17 + replace subnatid1 = "8 - Moka" if district == 18 + replace subnatid1 = "9 - Black River" if district == 19 + replace subnatid1 = "10 - Rodrigues" if district == 1 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + + +*<_subnatid2_> + gen byte subnatid2= . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + label var age "Individual age" +* + + +*<_male_> + gen byte male=sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=reltohead + replace relationharm=4 if reltohead==6 + replace relationharm=5 if reltohead==4 |reltohead==5 |reltohead==7 | reltohead==8 + replace relationharm=6 if reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=maritalstat + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=schoolatt + recode school (2/4=0) + replace school=. if age<6 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=. if age<6 + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7=. + replace educat7=1 if educlevel==1 + replace educat7=2 if educlevel>=11 & educlevel<=16 + replace educat7=3 if inlist(educlevel, 16, 17) + replace educat7=4 if educlevel>=21 & educlevel<=23 + replace educat7=5 if educlevel>=24 & educlevel<=28 + + * Use ISCED from field of study vble + gen qual1d = int(qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = educlevel + replace educat_orig = qualcourse if !missing(qualcourse) + + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if work==1 | activities==1 | awayfromwk==1 + replace lstatus=2 if work==2 & lookingwork==1 + replace lstatus=3 if lstatus!=1 & availwork==2 + replace lstatus=. if age<12 + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason=whynotavail if lstatus==3 + recode nlfreason (5 = 4) (6 = 5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + + +*<_unempldur_l_> + gen byte unempldur_l=timelookwrk if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=timelookwrk if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat=empstatus + recode empstat (3=1) (4 5=2) (1=3) (2=4) (6=5) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec=. + replace ocusec=1 if estabname>=1 & estabname<=3 + replace ocusec=2 if estabname>=5 & estabname<=9 + replace ocusec=3 if estabname==4 + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=string(activity, "%02.0f") if !missing(activity) + replace industry_orig= "" if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + + +*<_industrycat_isic_> + gen industry_2d = substr(industry_orig, 1, 2) + gen industrycat_isic = industry_2d + "00" if !missing(industry_orig) + * 5 total cases with code not mapped to ISIC + replace industrycat_isic = "" if inlist(activity, 4, 83, 89) + replace industrycat_isic = "" if industrycat_isic == "0000" + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(occupation) if !missing(occupation) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + replace occup_isco = "" if inlist(occupation, 36, 39, 45, 63, 64, 65, 75, 85, 94, 95, 99) + label var occup_isco "ISCO code of primary job 7 day recall" +* + +*<_occup_> + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen=paidempl + replace wage_no_compen=0 if empstat==2 + replace wage_no_compen=. if lstatus!=1 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if wage_no_compen!=. + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=hrsmain + recode whours (0 99 = .) + + replace whours=. if lstatus!=1 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when available and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=1 if nopersons==1 + replace firmsize_l=5 if nopersons==2 + replace firmsize_l=10 if nopersons==3 + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=4 if nopersons==1 + replace firmsize_u=9 if nopersons==2 + replace firmsize_u=. if nopersons==3 + replace firmsize_u=. if lstatus!=1 + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels +* Beginning 2005, the secondary activity status is asked in the surveys + +{ +*<_empstat_2_> + gen byte empstat_2=secempstat + recode empstat_2 (3=1) (4 5=2) (1=3) (2=4) (6=5) (0 = .) + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2= string(secondact, "%02.0f") if !missing(secondact) + replace industry_orig_2= "" if lstatus!=1 | missing(empstat_2) + + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = industry_orig_2 + "00" if !missing(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + + +*<_industrycat10_2_> + destring industry_orig_2, gen(industrycat10_2) + recode industrycat10_2 (1/3=1) ( 11/14=2) (15/37=3) (40/41=4) (45=5) (50/55=6) (60/64=7) (65/74=8) (75=9) (76/95=10) (99=.) + replace industrycat10_2 = . if lstatus != 1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = hrssec if !missing(empstat_2) + recode whours_2 (0 = .) + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2006_CMPHS/MUS_2006_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2006_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2006_CMPHS/MUS_2006_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2006_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..78afa23be --- /dev/null +++ b/GLD/MUS/MUS_2006_CMPHS/MUS_2006_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2006_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1665 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2006_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-23 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2006 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2006 +<_Data collection to_> 12/2006 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 11,280 +<_Sample size (IND)_> 41,559 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2006" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS06.dta", clear + + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2006 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2006 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=. + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid_str = string(serialno, "%04.0f") + gen hhno_str = string(hhno, "%02.0f") + + gen hhid = hhid_str + hhno_str + label var hhid "Household ID" +* + + +*<_pid_> + gen pid_str = string(memserialno, "%02.0f") + gen pid = hhid + pid_str + + * drop complete duplicates + duplicates drop + + duplicates tag pid, gen(x1) + duplicates tag pid reltohead - hrsmain, gen(x2) + * 6 duplicates remaining but share same labor respones + + duplicates drop pid reltohead - hrsmain, force + + isid pid + label var pid "Individual ID" +* + + +*<_weight_> + gen double weight=1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=. + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=. + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if district == 11 + replace subnatid1 = "2 - Pamplemousses" if district == 12 + replace subnatid1 = "3 - Riviere-du-Rempart" if district == 13 + replace subnatid1 = "4 - Flacq" if district == 14 + replace subnatid1 = "5 - Grand Port" if district == 15 + replace subnatid1 = "6 - Savanne" if district == 16 + replace subnatid1 = "7 - Plaine-Wilhems" if district == 17 + replace subnatid1 = "8 - Moka" if district == 18 + replace subnatid1 = "9 - Black River" if district == 19 + replace subnatid1 = "10 - Rodrigues" if district == 1 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + + +*<_subnatid2_> + gen byte subnatid2= . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + label var age "Individual age" +* + + +*<_male_> + gen byte male=sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=reltohead + replace relationharm=4 if reltohead==6 + replace relationharm=5 if reltohead==4 |reltohead==5 |reltohead==7 | reltohead==8 + replace relationharm=6 if reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=maritalstat + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=schoolatt + recode school (2/4=0) + replace school=. if age<6 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=. if age<6 + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7=. + replace educat7=1 if educlevel==1 + replace educat7=2 if educlevel>=11 & educlevel<=16 + replace educat7=3 if inlist(educlevel, 16, 17) + replace educat7=4 if educlevel>=21 & educlevel<=26 + replace educat7=5 if educlevel>=27 & educlevel<=31 + + * Use ISCED from field of study vble + gen qual1d = int(qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = educlevel + replace educat_orig = qualcourse if !missing(qualcourse) + + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if work==1 | activities==1 | awayfromwrk==1 + replace lstatus=2 if work==2 & lookingwork==1 + replace lstatus=3 if lstatus!=1 & availwork==2 + replace lstatus=. if age<12 + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason=whynotavail if lstatus==3 + recode nlfreason (2 = 3) (3 = 4) (5 = 2) (6 = .) (6 7 8 = 5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=timelookwrk if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=timelookwrk if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat=empstatus + recode empstat (3=1) (4 5=2) (1=3) (2=4) (6=5) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec=. + replace ocusec=1 if estabname>=1 & estabname<=3 + replace ocusec=2 if estabname>=5 & estabname<=9 + replace ocusec=3 if estabname==4 + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + +*<_industry_orig_> + gen industry_orig=string(industry, "%02.0f") if !missing(industry) + replace industry_orig= "" if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + + +*<_industrycat_isic_> + gen industrycat_isic = industry_orig + "00" if !missing(industry_orig) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(occupation) if !missing(occupation) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + label var occup_isco "ISCO code of primary job 7 day recall" +* + + + +*<_occup_> + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen=paidempl + replace wage_no_compen=0 if empstat==2 + replace wage_no_compen=. if lstatus!=1 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if wage_no_compen!=. + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=hrsmain + recode whours (0 99 = .) + + replace whours=. if lstatus!=1 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when available and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=1 if nopersons==1 + replace firmsize_l=5 if nopersons==2 + replace firmsize_l=10 if nopersons==3 + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=4 if nopersons==1 + replace firmsize_u=9 if nopersons==2 + replace firmsize_u=. if nopersons==3 + replace firmsize_u=. if lstatus!=1 + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> +* Not provided here + gen byte empstat_2=. + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + + +*<_industry_orig_2_> + gen industry_orig_2= string(secondindustry, "%02.0f") if !missing(secondindustry) + replace industry_orig_2= "" if lstatus!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = industry_orig_2 + "00" if !missing(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + + +*<_industrycat10_2_> + destring industry_orig_2, gen(industrycat10_2) + recode industrycat10_2 (1/3=1) ( 11/14=2) (15/37=3) (40/41=4) (45=5) (50/55=6) (60/64=7) (65/74=8) (75=9) (76/95=10) (99=.) + replace industrycat10_2 = . if lstatus != 1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = hrssec if lstatus == 1 + recode whours_2 (0 = .) + + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2007_CMPHS/MUS_2007_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2007_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2007_CMPHS/MUS_2007_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2007_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..8f8b5dab7 --- /dev/null +++ b/GLD/MUS/MUS_2007_CMPHS/MUS_2007_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2007_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1667 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2007_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-25 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2007 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2007 +<_Data collection to_> 12/2007 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 11,280 +<_Sample size (IND)_> 41,845 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2007" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/cmphs07ano.dta", clear + + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2007 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2007 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=. + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(serialno, "%04.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen pid_str = string(memserialno, "%02.0f") + gen pid = hhid + pid_str + + * drop complete duplicates + duplicates drop + + duplicates tag pid, gen(x1) + duplicates tag pid reltohead - hrsmain, gen(x2) + + tab x1 x2, mi + * There are duplicates in PID, share the same responses in the labor module. We can drop them! + + duplicates drop pid reltohead - hrsmain, force + isid pid + label var pid "Individual ID" +* + + +*<_weight_> + gen double weight=1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=. + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=. + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if district == 11 + replace subnatid1 = "2 - Pamplemousses" if district == 12 + replace subnatid1 = "3 - Riviere-du-Rempart" if district == 13 + replace subnatid1 = "4 - Flacq" if district == 14 + replace subnatid1 = "5 - Grand Port" if district == 15 + replace subnatid1 = "6 - Savanne" if district == 16 + replace subnatid1 = "7 - Plaine-Wilhems" if district == 17 + replace subnatid1 = "8 - Moka" if district == 18 + replace subnatid1 = "9 - Black River" if district == 19 + replace subnatid1 = "10 - Rodrigues" if district == 1 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + + +*<_subnatid2_> + gen byte subnatid2= . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + label var age "Individual age" +* + + +*<_male_> + gen byte male=sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=reltohead + replace relationharm=4 if reltohead==6 + replace relationharm=5 if reltohead==4 |reltohead==5 |reltohead==7 | reltohead==8 + replace relationharm=6 if reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=maritalstat + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=schoolatt + recode school (2/4=0) + replace school=. if age<6 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=. if age<6 + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7=. + replace educat7=1 if educlevel==1 + replace educat7=2 if educlevel>=11 & educlevel<=16 + replace educat7=3 if inlist(educlevel, 16, 17) + replace educat7=4 if educlevel>=21 & educlevel<=26 + replace educat7=5 if educlevel>=27 & educlevel<=31 + + * Use ISCED from field of study vble + gen qual1d = int(qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = educlevel + replace educat_orig = qualcourse if !missing(qualcourse) + + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if work==1 | activities==1 | awayfromwk==1 + replace lstatus=2 if work==2 & lookingwork==1 + replace lstatus=3 if lstatus!=1 & availwork==2 + replace lstatus=. if age<12 + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + + +*<_nlfreason_> + gen byte nlfreason=whynotavail if lstatus==3 + recode nlfreason (2 = 3) (3 = 4) (5 = 2) (6 = .) (6 7 8 = 5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=timelookwrk if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=timelookwrk if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat=empstatus + recode empstat (3=1) (4 5=2) (1=3) (2=4) (6=5) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec=. + replace ocusec=1 if estabname>=1 & estabname<=3 + replace ocusec=2 if estabname>=5 & estabname<=9 + replace ocusec=3 if estabname==4 + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=string(activity, "%05.0f") if !missing(activity) + replace industry_orig= "" if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + + +*<_industrycat_isic_> + gen industry_2d = substr(industry_orig, 1, 2) + gen industrycat_isic = industry_2d + "00" if !missing(industry_orig) + * 5 total cases with code not mapped to ISIC + replace industrycat_isic = "" if inlist(activity, 4, 83, 89) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(occupation) if !missing(occupation) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + replace occup_isco = "" if occup_isco == "9900" + label var occup_isco "ISCO code of primary job 7 day recall" +* + + + +*<_occup_> + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen=paidempl + replace wage_no_compen=0 if empstat==2 + replace wage_no_compen=. if lstatus!=1 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if wage_no_compen!=. + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=hrsmain + recode whours (0 99 = .) + + replace whours=. if lstatus!=1 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when available and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=1 if nopersons==1 + replace firmsize_l=5 if nopersons==2 + replace firmsize_l=10 if nopersons==3 + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=4 if nopersons==1 + replace firmsize_u=9 if nopersons==2 + replace firmsize_u=. if nopersons==3 + replace firmsize_u=. if lstatus!=1 + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> + gen byte empstat_2=secempstat + recode empstat_2 (3=1) (4 5=2) (1=3) (2=4) (6=5) + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2= string(secondact, "%05.0f") if !missing(secondact) + replace industry_orig_2= "" if lstatus!=1 | missing(empstat_2) + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen isic_2d_2 = substr(industry_orig_2, 1, 2) + gen industrycat_isic_2 = isic_2d_2 + "00" if !missing(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + destring isic_2d_2, gen(industrycat10_2) + recode industrycat10_2 (1/3=1) ( 11/14=2) (15/37=3) (40/41=4) (45=5) (50/55=6) (60/64=7) (65/74=8) (75=9) (76/95=10) (99=.) + replace industrycat10_2 = . if lstatus != 1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = hrssec if !missing(empstat_2) + recode whours_2 (0 = .) + + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2008_CMPHS/MUS_2008_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2008_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2008_CMPHS/MUS_2008_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2008_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..ca5c689fe --- /dev/null +++ b/GLD/MUS/MUS_2008_CMPHS/MUS_2008_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2008_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1669 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2008_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-26 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2008 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2008 +<_Data collection to_> 12/2008 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 11,280 +<_Sample size (IND)_> 41,121 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2008" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS2008.dta", clear + + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2008 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2008 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=. + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(serialno, "%04.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen pid_str = string(memserialno, "%02.0f") + gen pid = hhid + pid_str + + * drop complete duplicates + duplicates drop + + duplicates tag pid, gen(x1) + duplicates tag pid maritalstat - hrsmain, gen(x2) + * There are duplicates in PID, share the same responses in the labor module. We can drop them! + + tab x1 x2, mi + * All duplicate share the same responses in the labor questoins + duplicates drop pid maritalstat - hrsmain, force + + + * There are duplicates in PID + duplicates drop pid, force + + isid pid + label var pid "Individual ID" +* + + +*<_weight_> + gen double weight=1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=. + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=. + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if district == 11 + replace subnatid1 = "2 - Pamplemousses" if district == 12 + replace subnatid1 = "3 - Riviere-du-Rempart" if district == 13 + replace subnatid1 = "4 - Flacq" if district == 14 + replace subnatid1 = "5 - Grand Port" if district == 15 + replace subnatid1 = "6 - Savanne" if district == 16 + replace subnatid1 = "7 - Plaine-Wilhems" if district == 17 + replace subnatid1 = "8 - Moka" if district == 18 + replace subnatid1 = "9 - Black River" if district == 19 + replace subnatid1 = "10 - Rodrigues" if district == 1 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + + +*<_subnatid2_> + gen byte subnatid2= . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + label var age "Individual age" +* + + +*<_male_> + gen byte male=sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=reltohead + replace relationharm=4 if reltohead==6 + replace relationharm=5 if reltohead==4 |reltohead==5 |reltohead==7 | reltohead==8 + replace relationharm=6 if reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=maritalstat + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=schoolatt + recode school (2/4=0) + replace school=. if age<6 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=. if age<6 + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7=. + replace educat7=1 if educlevel==1 + replace educat7=2 if educlevel>=11 & educlevel<=16 + replace educat7=3 if inlist(educlevel, 16, 17) + replace educat7=4 if educlevel>=21 & educlevel<=26 + replace educat7=5 if educlevel>=27 & educlevel<=31 + * Use ISCED from field of study vble + gen qual1d = int(qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = educlevel + replace educat_orig = qualcourse if !missing(qualcourse) + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if work==1 | activities==1 | awayfromwk==1 + replace lstatus=2 if work==2 & lookingwork==1 + replace lstatus=3 if lstatus!=1 & availwork==2 + replace lstatus=. if age<12 + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason=whynotavail if lstatus==3 + recode nlfreason (2 = 3) (3 = 4) (5 = 2) (6 = .) (6 7 8 = 5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=timelookwrk if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=timelookwrk if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat=empstatus + recode empstat (3=1) (4 5=2) (1=3) (2=4) (6=5) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec=. + replace ocusec=1 if estabname>=1 & estabname<=3 + replace ocusec=2 if estabname>=5 & estabname<=9 + replace ocusec=3 if estabname==4 + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=string(activity, "%02.0f") if !missing(activity) + replace industry_orig= "" if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + + +*<_industrycat_isic_> + gen industry_2d = substr(industry_orig, 1, 2) + gen industrycat_isic = industry_2d + "00" if !missing(industry_orig) + * 5 total cases with code not mapped to ISIC + replace industrycat_isic = "" if inlist(activity, 4, 83, 89) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(occup) if !missing(occup) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + replace occup_isco = "" if occup_isco == "9900" + label var occup_isco "ISCO code of primary job 7 day recall" +* + + + +*<_occup_> + drop occup + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen=paidempl + replace wage_no_compen=0 if empstat==2 + replace wage_no_compen=. if lstatus!=1 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if wage_no_compen!=. + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=hrsmain + recode whours (0 99 = .) + + replace whours=. if lstatus!=1 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when available and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=1 if nopersons==1 + replace firmsize_l=5 if nopersons==2 + replace firmsize_l=10 if nopersons==3 + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=4 if nopersons==1 + replace firmsize_u=9 if nopersons==2 + replace firmsize_u=. if nopersons==3 + replace firmsize_u=. if lstatus!=1 + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_empstat_2_> + gen byte empstat_2=secempstat + recode empstat_2 (3=1) (4 5=2) (1=3) (2=4) (6=5) + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2= string(secondact, "%05.0f") if !missing(secondact) + replace industry_orig_2= "" if lstatus!=1 | missing(empstat_2) + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen isic_2d_2 = substr(industry_orig_2, 1, 2) + gen industrycat_isic_2 = isic_2d_2 + "00" if !missing(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + destring isic_2d_2, gen(industrycat10_2) + recode industrycat10_2 (1/3=1) ( 11/14=2) (15/37=3) (40/41=4) (45=5) (50/55=6) (60/64=7) (65/74=8) (75=9) (76/95=10) (99=.) + replace industrycat10_2 = . if lstatus != 1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = hrssec if !missing(empstat_2) + recode whours_2 (0 = .) + + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2009_CMPHS/MUS_2009_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2009_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2009_CMPHS/MUS_2009_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2009_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..2624e97ad --- /dev/null +++ b/GLD/MUS/MUS_2009_CMPHS/MUS_2009_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2009_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1663 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2009_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-25 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2009 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2009 +<_Data collection to_> 12/2009 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 6,480 +<_Sample size (IND)_> 24,393 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations rev 1 +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities rev 1 +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2009" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS 2009FINAL.dta", clear + + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "isced_76" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2009 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2009 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=. + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(serialno, "%05.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen pid_str = string(memserialno, "%02.0f") + gen pid = hhid + pid_str + + * Drop the complete duplicates + duplicates drop + + duplicates tag pid, gen(x1) + duplicates tag pid maritalstat - hrsmain, gen(x2) + * There are duplicates in PID, share the same responses in the labor module. We can drop them! + duplicates drop pid maritalstat - hrsmain, force + + isid pid + label var pid "Individual ID" +* + + +*<_weight_> + gen double weight=1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=. + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=. + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if district == 11 + replace subnatid1 = "2 - Pamplemousses" if district == 12 + replace subnatid1 = "3 - Riviere-du-Rempart" if district == 13 + replace subnatid1 = "4 - Flacq" if district == 14 + replace subnatid1 = "5 - Grand Port" if district == 15 + replace subnatid1 = "6 - Savanne" if district == 16 + replace subnatid1 = "7 - Plaine-Wilhems" if district == 17 + replace subnatid1 = "8 - Moka" if district == 18 + replace subnatid1 = "9 - Black River" if district == 19 + replace subnatid1 = "10 - Rodrigues" if district == 1 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + + +*<_subnatid2_> + gen byte subnatid2= . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + label var age "Individual age" +* + + +*<_male_> + gen byte male=sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=reltohead + replace relationharm=4 if reltohead==6 + replace relationharm=5 if reltohead==4 |reltohead==5 |reltohead==7 | reltohead==8 + replace relationharm=6 if reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=maritalstat + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=schoolatt + recode school (2/4=0) + replace school=. if age<6 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=. if age<6 + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7=. + replace educat7=1 if educlevel==1 + replace educat7=2 if educlevel>=11 & educlevel<=16 + replace educat7=3 if inlist(educlevel, 16, 17) + replace educat7=4 if educlevel>=21 & educlevel<=26 + replace educat7=5 if educlevel>=27 & educlevel<=31 + + * Use ISCED from field of study vble + gen qual1d = int(qualcourse/100) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = educlevel + replace educat_orig = qualcourse if !missing(qualcourse) + + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if work==1 | activities==1 | awayfromwk==1 + replace lstatus=2 if work==2 & lookingwork==1 + replace lstatus=3 if lstatus!=1 & availwork==2 + replace lstatus=. if age<12 + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason=whynotavail if lstatus==3 + recode nlfreason (2 = 3) (3 = 4) (5 = 2) (6 = .) (6 7 8 = 5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=timelookwrk if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=timelookwrk if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat=empstatus + recode empstat (3=1) (4 5 6=2) (1=3) (2=4) (7 = 5) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec=. + replace ocusec=1 if estabname>=1 & estabname<=3 + replace ocusec=2 if estabname>=5 & estabname<=9 + replace ocusec=3 if estabname==4 + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=string(activity, "%02.0f") if !missing(activity) + replace industry_orig= "" if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + + +*<_industrycat_isic_> + gen industry_2d = substr(industry_orig, 1, 2) + gen industrycat_isic = industry_2d + "00" if !missing(industry_orig) + * 5 total cases with code not mapped to ISIC + replace industrycat_isic = "" if inlist(activity, 4, 83, 89) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(occupation) if !missing(occupation) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + label var occup_isco "ISCO code of primary job 7 day recall" +* + + + +*<_occup_> + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen=paidempl + replace wage_no_compen=0 if empstat==2 + replace wage_no_compen=. if lstatus!=1 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if wage_no_compen!=. + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=hrsmain + recode whours (0 99 = .) + + replace whours=. if lstatus!=1 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when available and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=1 if nopersons==1 + replace firmsize_l=5 if nopersons==2 + replace firmsize_l=10 if nopersons==3 + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=4 if nopersons==1 + replace firmsize_u=9 if nopersons==2 + replace firmsize_u=. if nopersons==3 + replace firmsize_u=. if lstatus!=1 + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> + gen byte empstat_2=secempstat + recode empstat_2 (3=1) (4 5=2) (1=3) (2=4) (6=5) + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2= string(secondact, "%02.0f") if !missing(secondact) + replace industry_orig_2= "" if lstatus!=1 | missing(empstat_2) + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = industry_orig_2 + "00" if !missing(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + destring industry_orig_2, gen(industrycat10_2) + recode industrycat10_2 (1/3=1) ( 11/14=2) (15/37=3) (40/41=4) (45=5) (50/55=6) (60/64=7) (65/74=8) (75=9) (76/95=10) (99=.) + replace industrycat10_2 = . if lstatus != 1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = hrssec if !missing(empstat_2) + recode whours_2 (0 = .) + + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2010_CMPHS/MUS_2010_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2010_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2010_CMPHS/MUS_2010_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2010_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..d09dc653d --- /dev/null +++ b/GLD/MUS/MUS_2010_CMPHS/MUS_2010_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2010_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1670 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2010_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-25 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2010 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2010 +<_Data collection to_> 12/2010 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 11,280 +<_Sample size (IND)_> 41,103 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1976 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> National Classification of Occupations rev 1 +<_ISIC Version_> ISIC version 3 +<_INDUS National_> National Standard Industrial Classification of Economic Activities rev 1 +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2010" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS 2010.dta", clear + + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "isced_76" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_1988" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2010 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2010 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=. + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(Serialnumber, "%05.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen pid_str = string(membernumber, "%02.0f") + gen pid = hhid + pid_str + + * There are duplicates in PID: drop complete duplicates + duplicates drop + + * Check for duplicates in pid and demographic characteristics + duplicates tag pid, gen(x1) + duplicates tag Serialnumber month district householdnumber membernumber age sex reltohead, gen(x2) + + tab x1 x2, mi + * The duplicates in pid share the same age, sex and household relation + * Only differ in some questions relating to the non-labor module but same responses in labor + * Thus, in the perpsective of GLD harmonization, they are duplicates! + duplicates drop pid, force + + isid pid + label var pid "Individual ID" +* + + +*<_weight_> + gen double weight=1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=. + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=. + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1 = "" + replace subnatid1 = "1 - Port Louis" if district == 11 + replace subnatid1 = "2 - Pamplemousses" if district == 12 + replace subnatid1 = "3 - Riviere-du-Rempart" if district == 13 + replace subnatid1 = "4 - Flacq" if district == 14 + replace subnatid1 = "5 - Grand Port" if district == 15 + replace subnatid1 = "6 - Savanne" if district == 16 + replace subnatid1 = "7 - Plaine-Wilhems" if district == 17 + replace subnatid1 = "8 - Moka" if district == 18 + replace subnatid1 = "9 - Black River" if district == 19 + replace subnatid1 = "10 - Rodrigues" if district == 1 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen byte subnatid2= . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + label var age "Individual age" +* + + +*<_male_> + gen byte male=sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=reltohead + replace relationharm=4 if reltohead==6 + replace relationharm=5 if reltohead==4 |reltohead==5 |reltohead==7 | reltohead==8 + replace relationharm=6 if reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=maritalstatus + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=schoolattendance + recode school (2/4=0) + replace school=. if age<6 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=. if age<6 + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7=. + replace educat7=1 if educationlevel==1 | educy==0 + replace educat7=2 if educationlevel>=11 & educationlevel<=16 + replace educat7=3 if inlist(educationlevel, 16, 17) + replace educat7=4 if educationlevel>=21 & educationlevel<=26 + replace educat7=5 if educationlevel>=27 & educationlevel<=31 + + * Use ISCED from field of study vble + gen qual1d = int(qualification/100) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = educationlevel + replace educat_orig = qualification if !missing(qualification) + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if workfor1hour==1 | activity==1 | absentforwork==1 + replace lstatus=2 if workfor1hour==2 & lookingforwork==1 + replace lstatus=3 if lstatus!=1 & availableforwork==2 + replace lstatus=. if age<12 + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason=whynotavailable if lstatus==3 + recode nlfreason (2 = 3) (3 = 4) (5 = 2) (6 = .) (6 7 8 = 5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + + +*<_unempldur_l_> + gen byte unempldur_l=timelookingforwork if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=timelookingforwork if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat=employmentstatus + recode empstat (3=1) (4 5 6=2) (1=3) (2=4) (7 = 5) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec=. + replace ocusec=1 if nameofestablishment>=1 & nameofestablishment<=3 + replace ocusec=2 if nameofestablishment>=5 & nameofestablishment<=9 + replace ocusec=3 if nameofestablishment==4 + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=string(W, "%02.0f") if !missing(W) + replace industry_orig= "" if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + + +*<_industrycat_isic_> + gen industrycat_isic = industry_orig + "00" if !missing(industry_orig) + replace industrycat_isic = "" if inlist(activity, 4, 83, 89) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + + +*<_industrycat10_> + gen isic_1d = substr(industrycat_isic, 1, 1) + gen isic_2d = substr(industrycat_isic, 1, 2) + + destring isic_1d, replace + destring isic_2d, replace + + gen byte industrycat10 = . + replace industrycat10 = 1 if isic_1d == 0 + replace industrycat10 = 2 if inrange(isic_2d, 10, 14) + replace industrycat10 = 3 if inrange(isic_2d, 15, 37) + replace industrycat10 = 4 if inrange(isic_2d, 40, 41) + replace industrycat10 = 5 if isic_2d == 45 + replace industrycat10 = 6 if isic_1d == 5 + replace industrycat10 = 7 if inrange(isic_2d, 60, 64) + replace industrycat10 = 8 if inrange(isic_2d, 65, 74) + replace industrycat10 = 9 if isic_2d == 75 + replace industrycat10 = 10 if inrange(isic_2d, 80, 99) + + drop isic_1d isic_2d + + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(occupation) if !missing(occupation) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + replace occup_isco = "" if inlist(occupation, 26, 47, 55, 65, 77, 87, 99) + label var occup_isco "ISCO code of primary job 7 day recall" +* + + + +*<_occup_> + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen=paidemployment + replace wage_no_compen=0 if empstat==2 + replace wage_no_compen=. if lstatus!=1 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if wage_no_compen!=. + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=hrsatmainjob + recode whours (0 99 = .) + + replace whours=. if lstatus!=1 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when available and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=1 if size==1 + replace firmsize_l=5 if size==2 + replace firmsize_l=10 if size==3 + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=4 if size==1 + replace firmsize_u=9 if size==2 + replace firmsize_u=. if size==3 + replace firmsize_u=. if lstatus!=1 + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_empstat_2_> +* Note that the categories for primary empstat vs secondary differ + gen byte empstat_2= secondaryemploymentstatus + recode empstat_2 (1 = 3) (2 = 4) (3 = 1) (4 5 = 2) (6 = 5) + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + + +*<_industry_orig_2_> + gen industry_orig_2= string(secondactivity, "%02.0f") if !missing(secondactivity) + replace industry_orig_2= "" if lstatus!=1 | missing(empstat_2) + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = industry_orig_2 + "00" if !missing(industry_orig_2) + replace industrycat_isic_2 = "" if inlist(industrycat_isic_2, "0000", "8300") + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + destring industry_orig_2, gen(industrycat10_2) + recode industrycat10_2 (1/3=1) ( 11/14=2) (15/37=3) (40/41=4) (45=5) (50/55=6) (60/64=7) (65/74=8) (75=9) (76/95=10) (99 0 83=.) + replace industrycat10_2 = . if lstatus != 1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = hrsatotherjob if empstat_2 != . & lstatus == 1 + recode whours_2 (0 = .) + + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2011_CMPHS/MUS_2011_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2011_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2011_CMPHS/MUS_2011_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2011_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..dc64a3eb0 --- /dev/null +++ b/GLD/MUS/MUS_2011_CMPHS/MUS_2011_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2011_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1614 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2011_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-25 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2011 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2011 +<_Data collection to_> 12/2011 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 11,280 +<_Sample size (IND)_> 41,671 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1997 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> National Classification of Occupations rev 2 +<_ISIC Version_> ISIC version 4 +<_INDUS National_> National Standard Industrial Classification of Economic Activities rev 2 +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2011" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS2011.dta", clear + + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "isced_97" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_2008" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_4" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2011 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2011 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=. + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(questno, "%05.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen pid_str = string(memberno, "%02.0f") + gen pid = hhid + pid_str + + isid pid + label var pid "Individual ID" +* + + +*<_weight_> + gen double weight=1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=. + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=. + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + + +*<_subnatid1_> + gen subnatid1 = "" + label var subnatid1 "Subnational ID at First Administrative Level" +* + + + +*<_subnatid2_> + gen byte subnatid2= . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + label var age "Individual age" +* + + +*<_male_> + gen byte male=sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=reltohead + replace relationharm=4 if reltohead==6 + replace relationharm=5 if reltohead==4 |reltohead==5 |reltohead==7 | reltohead==8 + replace relationharm=6 if reltohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=maritalstat + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=schoolatt + recode school (2/4=0) + replace school=. if age<6 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=. if age<6 + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> +* The educlevel variable here is at the three digits. in the questinonaire, only two digits. odd! + gen byte educat7=. + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig = educlevel + * Here qual course is 4 digit! + replace educat_orig = qualcourse if !missing(qualcourse) + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if work==1 | activ==1 | absentwk==1 + replace lstatus=2 if work==2 & lookwk==1 + replace lstatus=3 if missing(lstatus) + replace lstatus=. if age<12 + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason=whynotavail if lstatus==3 + recode nlfreason (1/2=1) (5 = 4) (8 = 2) (6 7 9 10 11 12 13 14 = 5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=timelookwork if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=timelookwork if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + recode empstat (3=1) (4 5 6=2) (1=3) (2=4) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec=estname + recode ocusec 1/3=1 4=3 4/8=2 0=1 + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=string(activity, "%02.0f") if !missing(activity) + replace industry_orig= "" if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + + +*<_industrycat_isic_> + gen industrycat_isic = industry_orig + "00" if !missing(industry_orig) + replace industrycat_isic = "" if inlist(activity, 4, 83, 89) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + +*<_industrycat10_> + gen industrycat10 = activity + recode industrycat10 (1/3=1) (5/9 = 2) (10/33 = 3) (35/39 = 4) (41/43 = 5) (45/47 55/56 = 6) (49/53 58/63 = 7) (64/82 = 8) (84 = 9) (85/99 = 10) (4 83 89 = .) + replace industrycat10 = . if lstatus != 1 + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + label define lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified", replace + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(occup) if !missing(occup) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + label var occup_isco "ISCO code of primary job 7 day recall" +* + +*<_occup_> + drop occup + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen=paidempl + replace wage_no_compen=0 if empstat==2 + replace wage_no_compen=. if lstatus!=1 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if wage_no_compen!=. + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=hrsmainjob + recode whours (0 99 = .) + + replace whours=. if lstatus!=1 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when available and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=1 if size==1 + replace firmsize_l=5 if size==2 + replace firmsize_l=10 if size==3 + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=4 if size==1 + replace firmsize_u=9 if size==2 + replace firmsize_u=. if size==3 + replace firmsize_u=. if lstatus!=1 + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> + gen byte empstat_2= secempstat + recode empstat_2 (1 = 3) (2 = 4) (3 = 1) (4 5 = 2) (6 = 5) + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + + +*<_industry_orig_2_> + gen industry_orig_2= string(secondactnew, "%05.0f") if !missing(secondactnew) + replace industry_orig_2= "" if lstatus!=1 | missing(empstat_2) + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen isic_2d_2 = substr(industry_orig_2, 1, 2) + gen industrycat_isic_2 = isic_2d_2 + "00" if !missing(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + destring isic_2d_2, gen(industrycat10_2) + recode industrycat10_2 (1/3=1) (5/9 = 2) (10/33 = 3) (35/39 = 4) (41/43 = 5) (45/47 55/56 = 6) (49/53 58/63 = 7) (64/82 = 8) (84 = 9) (85/99 = 10) + replace industrycat10_2 = . if lstatus != 1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = hrsother if !missing(empstat_2) & lstatus == 1 + recode whours_2 (0 = .) + + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/MUS/MUS_2012_CMPHS/MUS_2012_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2012_CMPHS_V01_M_V01_A_GLD_ALL.do b/GLD/MUS/MUS_2012_CMPHS/MUS_2012_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2012_CMPHS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..3446fdadf --- /dev/null +++ b/GLD/MUS/MUS_2012_CMPHS/MUS_2012_CMPHS_V01_M_V01_A_GLD/Programs/MUS_2012_CMPHS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1623 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> MUS_2012_CMPHS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2026-02-25 + +------------------------------------------------------------------------- + +<_Country_> MUS +<_Survey Title_> Continuous Multi-Purpose Household Survey +<_Survey Year_> 2012 +<_Study ID_> [Microdata Library ID if present] +<_Data collection from_> 01/2012 +<_Data collection to_> 12/2012 +<_Source of dataset_> Statistics Mauritius +<_Sample size (HH)_> 11,280 +<_Sample size (IND)_> 41,699 +<_Sampling method_> Two-stage sampling design +<_Geographic coverage_> National +<_Currency_> Rupee + +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED 1997 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> National Classification of Occupations 2008 +<_ISIC Version_> ISIC version 4 +<_INDUS National_> National Standard Industrial Classification of Economic Activities rev 2 +----------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +==============================================================================================%%*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m +set varabbrev off + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "C:/Users/wb510859/WBG/GLD - Current Contributors/510859_AS" +local country "MUS" +local year "2012" +local survey "CMPHS" +local vermast "V01" +local veralt "V01" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file +use "`path_in_stata'/CMPHS2012.dta", clear + + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "MUS" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "CMPHS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v = "ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version = "isced_97" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version = "isco_2008" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_4" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2012 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int int_year = 2012 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen byte int_month=. + la de lblint_month 1 "January" 2 "February" 3 "March" 4 "April" 5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" 11 "November" 12 "December" + label value int_month lblint_month + label var int_month "Month of the interview" +* + + +*<_hhid_> + gen hhid = string(questno, "%05.0f") + label var hhid "Household ID" +* + + +*<_pid_> + gen pid_str = string(memberno, "%02.0f") + gen pid = hhid + pid_str + isid pid + label var pid "Individual ID" +* + + +*<_weight_> + gen double weight=1 + label var weight "Survey sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + gen weight_q = . + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata=. + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + + +*<_panel_> + gen panel = "" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + gen byte urban=. + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + + +*<_subnatid1_> + gen subnatid1 = "" + label var subnatid1 "Subnational ID at First Administrative Level" +* + + + +*<_subnatid2_> + gen byte subnatid2= . + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen str subnatid3 = "" + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> +/* <_subnatidsurvey_note> + + Variable denoting lowest administrative info to which the survey is still significat. + See entry in GLD Guidelines (https://github.com/worldbank/gld/blob/main/Support/A%20-%20Guides%20and%20Documentation/GLD_1.0_Guidelines.docx) for more details + + */ + gen str subnatidsurvey = "" + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> +/* <_subnatid1_prev_note> + + subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + + */ + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================================= + 4: Demography +==============================================================================================%%*/ + +{ + +*<_hsize_> + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + label var age "Individual age" +* + + +*<_male_> + gen byte male=sex == 1 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=relationtohead + replace relationharm=4 if relationtohead==6 + replace relationharm=5 if relationtohead==4 |relationtohead==5 |relationtohead==7 | relationtohead==8 + replace relationharm=6 if relationtohead==9 + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = . + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital=maritalstat + recode marital (1=1) (3 4 =4) (2=5) (5=2) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values hear_dsablty dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values walk_dsablty dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values conc_dsord dsablty + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values slfcre_dsablty dsablty + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label define dsablty 1 "No – no difficulty" 2 "Yes – some difficulty" 3 "Yes – a lot of difficulty" 4 "Cannot do at all", replace + label values comm_dsablty dsablty + label var comm_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years = . if migrated_binary != 1 + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if migrated_binary != 1 + label de lblmigrated_from_urban 0 "Rural" 1 "Urban" + label values migrated_from_urban lblmigrated_from_urban + label var migrated_from_urban "Migrated from area" +* + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if migrated_binary != 1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" 6 "Within country, admin unknown" 7 "Wholly unknow" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if migrated_binary != 1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary != 1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary != 1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* + + +} + + +/*%%============================================================================================= + 6: Education +==============================================================================================%%*/ + + +{ + +*<_ed_mod_age_> + gen byte ed_mod_age=0 +label var ed_mod_age "Education module application age" +* + +*<_school_> + gen byte school=schoolattendance + recode school (2/4=0) + replace school=. if age<6 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=. if age<6 + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7=. + replace educat7=1 if educationlevel==1 | educy==0 + replace educat7=2 if educationlevel>=11 & educationlevel<=16 + replace educat7=3 if inlist(educationlevel, 16, 17) + replace educat7=4 if educationlevel>=21 & educationlevel<=26 + replace educat7=5 if educationlevel>=27 & educationlevel<=31 + + * Use ISCED from field of study vble + gen qual1d = int(qualification/1000) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4 = 3) (5 = 4) (6 7 = 5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5 = 3) (6 7 = 4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> +* I included field of study and education level here. + gen educat_orig = educationlevel + replace educat_orig = qualification if !missing(qualification) + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = . + label var educat_isced "ISCED standardised level of education" +* + + +*----------6.1: Education cleanup------------------------------* + +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) +local ed_vars "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach ed_var of local ed_vars { + cap confirm numeric variable `ed_var' + if _rc == 0 { // is indeed numeric + replace `ed_var' = . if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `ed_var' = "" if ( age < ed_mod_age & !missing(age) ) + } +} + + +* + + +} + + +/*%%============================================================================================= + 7: Training +==============================================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + label de lblvocational 0 "No" 1 "Yes" + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen str vocational_field_orig = "" + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + + +/*%%============================================================================================= + 8: Labour +==============================================================================================%%*/ + +*<_minlaborage_> + gen byte minlaborage=12 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if workforIhr==1 | activitiesforsalepay==1 | absentfromwork==1 + replace lstatus=2 if workforIhr==2 & lookwk==1 + replace lstatus=3 if missing(lstatus) + replace lstatus=. if age + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = . if age < minlaborage & !missing(age) + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + replace underemployment = . if age < minlaborage & !missing(age) + replace underemployment = . if lstatus != 1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason=whynotavailable if lstatus==3 + recode nlfreason (1/2=1) (5 = 4) (8 = 2) (6 7 9 10 11 12 13 14 = 5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=timelookwork if lstatus==2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=timelookwork if lstatus==2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen empstat = employmentstatus + recode empstat (3=1) (4 5 6=2) (1=3) (2=4) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + + +*<_ocusec_> + gen byte ocusec=establishmentname + recode ocusec 1/3=1 4=3 4/8=2 0=1 + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + +*<_industry_orig_> + gen industry_orig=string(activity, "%02.0f") if !missing(activity) + replace industry_orig= "" if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = industry_orig + "00" if !missing(industry_orig) + * 5 total cases with code not mapped to ISIC + replace industrycat_isic = "" if inlist(activity, 4, 83, 89) + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + + +*<_industrycat10_> + gen industrycat10 = activity + recode industrycat10 (1/3=1) (5/9 = 2) (10/33 = 3) (35/39 = 4) (41/43 = 5) (45/47 55/56 = 6) (49/53 58/63 = 7) (64/82 = 8) (84 = 9) (85/99 = 10) (4 83 89 = .) + replace industrycat10 = . if lstatus != 1 + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + label define lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified", replace + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + gen occup_orig = string(occupation) if !missing(occupation) + replace occup_orig = "" if lstatus != 1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> + gen occup_isco = occup_orig + "00" if !missing(occup_orig) & lstatus == 1 + label var occup_isco "ISCO code of primary job 7 day recall" +* + +*<_occup_> + gen occup = substr(occup_isco, 1, 1) + destring occup, replace + label var occup "1 digit occupational classification, primary job 7 day recall" + label define lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others", replace + label values occup lbloccup +* + + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if inrange(occup, 1, 3) + replace occup_skill = 2 if inrange(occup, 4, 8) + replace occup_skill = 1 if occup == 9 + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_wage_no_compen_> + gen double wage_no_compen=paidempl + replace wage_no_compen=0 if empstat==2 + replace wage_no_compen=. if lstatus!=1 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=5 if wage_no_compen!=. + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=hrsmainjob + recode whours (0 99 = .) + + replace whours=. if lstatus!=1 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths = . + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> +/* <_wage_total_note> + + Use gross wages when available and net wages only when gross wages are not available. + This is done to make it easy to compare earnings in formal and informal sectors. + + */ + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract=. + label var contract "Employment has contract primary job 7 day recall" + la de lblcontract 0 "Without contract" 1 "With contract" + label values contract lblcontract +* + + +*<_healthins_> + gen byte healthins=. + label var healthins "Employment has health insurance primary job 7 day recall" + la de lblhealthins 0 "Without health insurance" 1 "With health insurance" + label values healthins lblhealthins +* + + +*<_socialsec_> + gen byte socialsec=. + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=1 if size==1 + replace firmsize_l=5 if size==2 + replace firmsize_l=10 if size==3 + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=4 if size==1 + replace firmsize_u=9 if size==2 + replace firmsize_u=. if size==3 + replace firmsize_u=. if lstatus!=1 + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +*<_empstat_2_> + gen byte empstat_2= secondaruempstatus + recode empstat_2 (1 = 3) (2 = 4) (3 = 1) (4 5 = 2) (6 = 5) + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2= string(secondaryactivity, "%05.0f") if !missing(secondaryactivity) + replace industry_orig_2= "" if lstatus!=1 | missing(empstat_2) + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen isic_2d_2 = substr(industry_orig_2, 1, 2) + gen industrycat_isic_2 = isic_2d_2 + "00" if !missing(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + destring isic_2d_2, gen(industrycat10_2) + recode industrycat10_2 (1/3=1) (5/9 = 2) (10/33 = 3) (35/39 = 4) (41/43 = 5) (45/47 55/56 = 6) (49/53 58/63 = 7) (64/82 = 8) (84 = 9) (85/99 = 10) + replace industrycat10_2 = . if lstatus != 1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2 "Broad Economic Activities classification, secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2=. + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if inrange(occup_2, 1, 3) + replace occup_skill_2 = 2 if inrange(occup_2, 4, 8) + replace occup_skill_2 = 1 if occup_2 == 9 + la de lblskill2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2 lblskill2 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2=. + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = hrsatotherjob if !missing(empstat_2) & lstatus == 1 + recode whours_2 (0 = .) + + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen firmsize_l_2 = . + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + label var firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + +} + +*----------8.4: 7 day reference additional jobs------------------------------* + +*<_t_hours_others_> + gen t_hours_others = . + label var t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* + + +*<_t_wage_nocompen_others_> + gen t_wage_nocompen_others = . + label var t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others = . + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total = . + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total = . + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total = . + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ + +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & !missing(age) + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & !missing(age) + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year = . + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year = . + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ + +*<_empstat_year_> + gen byte empstat_year=. + replace empstat_year=. if lstatus_year!=1 + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(industrycat_isic_year) + *int_classif_universe, var(industrycat_isic_year) universe(ISIC) + count + *list + *assert `r(N)' == 0 + restore + + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year = industrycat10_year + recode industrycat4_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + + * Check that no errors --> using our universe check function, count should be 0 (no obs wrong) + * https://github.com/worldbank/gld/tree/main/Support/Z%20-%20GLD%20Ecosystem%20Tools/ISIC%20ISCO%20universe%20check + preserve + *drop if missing(occup_isco_year) + *int_classif_universe, var(occup_isco_year) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> --- this var has the same name as other and when quoted in the keep and order codes is repeated. + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year = . + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year = . + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year = . + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year = . + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year = . + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year = . + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year = . + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year = . + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen firmsize_l_year = . + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen firmsize_u_year = . + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year = industrycat10_2_year + recode industrycat4_2_year (1 = 1) (2 3 4 5 = 2) (6 7 8 9 = 3) (10 = 4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year = . + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year = . + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year = . + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = . + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year = . + label var t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> + gen t_wage_others_year = . + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year = . + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year = . + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs = . + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual = . + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc = . + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome = t_wage_total_year + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_vars "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach lab_var of local lab_vars { + cap confirm numeric variable `lab_var' + if _rc == 0 { // is indeed numeric + replace `lab_var' = . if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `lab_var' = "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight weight_m weight_q psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach kept_var of local kept_vars { + + capture assert missing(`kept_var') + if !_rc drop `kept_var' + +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/Support/B - Country Survey Details/MUS/CMPHS/1. Introduction to Mauritius CMPHS.md b/Support/B - Country Survey Details/MUS/CMPHS/1. Introduction to Mauritius CMPHS.md new file mode 100644 index 000000000..8f648a229 --- /dev/null +++ b/Support/B - Country Survey Details/MUS/CMPHS/1. Introduction to Mauritius CMPHS.md @@ -0,0 +1,83 @@ +# Introduction to Mauritius Continuous Multi-Purpose Household Survey (CMPHS) + +- [What is the CMPHS?](#what-is-the-cmphs) +- [What does the CMPHS cover?](#what-does-the-cmphs-cover) +- [Where can the data be found?](#where-can-the-data-be-found) +- [What is the sampling procedure?](#what-is-the-sampling-procedure) +- [What is the geographic significance level?](#what-is-the-geographic-significance-level) +- [Other noteworthy aspects](#other-noteworthy-aspects) + +## What is the CMPHS? + +The Continuous Multi-Purpose Household Survey (CMPHS) is a household survey conducted in Mauritius by the Central Statistics Office (CSO), now Statistics Mauritius. It is the main source of labour market statistics in the country, including labour force, employment, and unemployment. The first CMPHS was conducted in 1999, and from 2001 onwards it was conducted annually. + +## What does the CMPHS cover? + +The Mauritius CMPHS covers demographic characteristics, labour force, education and training, health, household conditions, environment, and individual income. The harmonized years and sample sizes used in the GLD harmonization are as follows: + +| Year | # Persons | # Households | +|---|---:|---:| +| 2001 | 24,539 | 6,300 | +| 2002 | 24,552 | 6,300 | +| 2003 | 24,393 | 6,480 | +| 2004 | 32,626 | 8,640 | +| 2005 | 41,894 | 11,280 | +| 2006 | 41,559 | 11,280 | +| 2007 | 41,845 | 11,280 | +| 2008 | 41,121 | 11,280 | +| 2009 | 40,385 | 11,280 | +| 2010 | 41,103 | 11,280 | +| 2011 | 41,671 | 11,280 | +| 2012 | 41,699 | 11,280 | + +## Where can the data be found? + +The datasets are not publicly accessible. The World Bank has been granted access to the datasets. If you work or are part of the World Bank Group, kindly contact the Jobs Group with a formal request for access through gld@worldbank.org. + +## What is the sampling procedure? + +The Mauritius CMPHS uses a stratified two-stage sampling design. In the first stage, primary sampling units (PSUs) are selected with probability proportional to size. In the second stage, a fixed number of households is selected within each PSU. + +There were changes in the sample design over time. Before 2005, around 525 households were surveyed each month, resulting in about 6,300 households per year. These rounds were based on the 1999 master sample and covered private non-institutional households in urban, semi-urban, and rural areas in the islands of Mauritius and Rodrigues. + +From 2005 onwards, the annual sample size increased to 11,280 households. These rounds followed a 2-2-2 rotation sampling design, where half of the households interviewed in one quarter were re-interviewed in the following quarter in order to support quarterly estimates. + +In the microdata available to the GLD team, however, only the first interview of each household appears to be available. As a result, the data support annual analysis, but not the intended quarter-to-quarter follow-up of households. + +## What is the geographic significance level? + +The official reports detail estimates by area of residence, namely urban and rural areas. + +## Other noteworthy aspects + +### Survey structure + +The CMPHS is designed as a continuous survey with quarterly fieldwork. However, the microdata available for GLD appear to retain only one interview per household. This is important for users because the survey design allows repeated interviews within the year, but the available data do not support the construction of quarterly household panels. + +### Weight variable +The datasets received by the World Bank do not contain a household or individual weight variable. This applies to all harmonized CMPHS rounds currently available to the GLD team. + +Users should therefore be careful when interpreting levels and distributions from the data, as unweighted estimates are not expected to be consistent with official estimates. + +### Industry classification + +The Mauritius CMPHS uses the National Standard Industrial Classification of Economic Activities (NSIC) to code industry. NSIC Revision 1, used from 2001 to 2010, is compatible with ISIC Revision 3 at the 2-digit level, while NSIC Revision 2, used in 2011 and 2012, is compatible with ISIC Revision 4 at the 2-digit level. + +| Year | Classification in survey | ISIC revision compatibility | Level of compatibility | +|:----:|:------------------------:|:---------------------------:|:----------------------:| +| 2001-2010 | NSIC Revision 1 | ISIC Revision 3 | 2 digits | +| 2011-2012 | NSIC Revision 2 | ISIC Revision 4 | 2 digits | + + +### Occupation classification + +The Mauritius CMPHS uses the National Standard Classification of Occupation (NASCO) to code occupation. The version used from 2001 to 2010 is compatible with ISCO 1988 at the 2-digit level, while NASCO-08, used in 2011 and 2012, is compatible with ISCO-08 at the 2-digit level. + +| Year | Classification in survey | ISCO revision compatibility | Level of compatibility | +|:----:|:------------------------:|:---------------------------:|:----------------------:| +| 2001-2010 | NASCO-99 | ISCO 1988 | 2 digits | +| 2011-2012 | NASCO-08 | ISCO 2008 | 2 digits | + +### Education + +Information on educational attainment in the Mauritius CMPHS is recorded by year level, and the main education variable does not identify attainment beyond secondary schooling. In the GLD harmonization, post-secondary attainment is coded using a separate variable on field of study or qualification. More details are provided in a [separate document here](Education.md). diff --git a/Support/B - Country Survey Details/MUS/CMPHS/Education.md b/Support/B - Country Survey Details/MUS/CMPHS/Education.md new file mode 100644 index 000000000..ee2dbe064 --- /dev/null +++ b/Support/B - Country Survey Details/MUS/CMPHS/Education.md @@ -0,0 +1,69 @@ +# Education in the Mauritius CMPHS + +## Overview + +In the Mauritius CMPHS, educational attainment is primarily recorded by year level. The raw education attainment variable does not identify levels beyond secondary schooling in a way that is sufficient for GLD harmonization. + +To identify post-secondary attainment, the harmonization relies on a separate variable that records the respondent's qualification. This variable follows the National Standard Classification of Education (NSCED), Mauritius' adaptation of the International Standard Classification of Education (ISCED), and is used to distinguish higher levels of education. + +## Classification used in the qualification variable + +The qualification variable is based on NSCED for most years and on NSCED-97 in 2011 and 2012, corresponding to the adaptations of ISCED 1976 and ISCED 1997, respectively. + +| Year | Classification in survey | International compatibility | +|:----:|:------------------------:|:---------------------------:| +| 2001-2010 | NSCED | ISCED 1976 | +| 2011-2012 | NSCED-97 | ISCED 1997 | + +## Mapping of qualification codes to GLD education categories + +The harmonization relies on the first digit of the qualification code to identify the broad education level. + +The qualification variable is used only to identify post-secondary attainment. Codes `0` to `3` are not used to construct `educat7`, since levels up to secondary are already identified from the main raw education variable. The qualification variable is used only for codes `4` to `8`, which distinguish post-secondary and university education. + +The table below summarizes the interpretation used in the GLD harmonization. + +| Code | ISCED level | Description | Qualification | GLD harmonized category | +|:----:|:-----------:|:------------|:----------------------|:------------------------| +| 0 | 0 | Pre-primary | | Not used in harmonization | +| 1 | 1 | Primary | Certificate of Primary Education | Not used in harmonization | +| 2 | 2 | Lower secondary | Pre-Voc (Yr I - IIII) | Not used in harmonization | +| 3 | 3 | Upper secondary | National Trade Certificate (NTC) Level 3, Certificate | Not used in harmonization | +| 4 | 4 | Post-secondary | NTC Level 2, Certificate | Higher than secondary but not university | +| 5 | 5 | First stage of tertiary education | Diploma | Higher than secondary but not university | +| 6 | 5 | First stage of tertiary education | Degree (BSc) | University incomplete or complete | +| 7 | 5 | First stage of tertiary education | Master degree | University incomplete or complete | +| 8 | 6 | Second stage of tertiary education | MPhil/PhD | University incomplete or complete | + +In the GLD harmonization, codes `4` and `5` are grouped as `Higher than secondary but not university`, while codes `6` to `8` are grouped as `University incomplete or complete`. + +## Sample coding logic + +Below is an illustration of the coding logic used to harmonize the qualification information into GLD education categories. + +```stata +*<_educat7_> + gen byte educat7=. + replace educat7=1 if educationlevel==1 | educy==0 + replace educat7=2 if educationlevel>=11 & educationlevel<=16 + replace educat7=3 if educationlevel==17 + replace educat7=4 if educationlevel>=21 & educationlevel<=26 + replace educat7=5 if educationlevel>=27 & educationlevel<=31 + + * Use qualification variable for post-secondary attainment + gen qual1d = int(qualification/1000) + replace educat7=6 if inlist(qual1d, 4, 5) + replace educat7=7 if inlist(qual1d, 6, 7, 8) + drop qual1d + + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + +``` +## Field of study information +Users interested in the post-secondary field of study information can refer to the variable educat_orig, which retains the original education coding from the survey. This variable contains both the raw education information up to secondary level and the more detailed qualification information for post-secondary education. These can be distinguished by the number of digits: the raw education information is stored in two digits, except in 2012 when it is stored in three digits, while the post-secondary qualification information is stored in three digits, except in 2012 when it is stored in four digits. + +However, the meaning of the detailed qualification or field of study codes is not fully documented in the materials available to the GLD team, and these codes are not fully compatible with ISCED categories. Their detailed interpretation is therefore beyond the scope of the GLD harmonization, and users interested in this information would need to determine the meaning of the raw codes separately. +