diff --git a/GLD/ARM/ARM_2008_ILCS/ARM_2008_ILCS_V01_M_V01_A_GLD/Programs/ARM_2008_ILCS_V01_M_V01_A_GLD_ALL.do b/GLD/ARM/ARM_2008_ILCS/ARM_2008_ILCS_V01_M_V01_A_GLD/Programs/ARM_2008_ILCS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..e32232861 --- /dev/null +++ b/GLD/ARM/ARM_2008_ILCS/ARM_2008_ILCS_V01_M_V01_A_GLD/Programs/ARM_2008_ILCS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1753 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> ARM_2008_ILCS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2024-09-11 + +------------------------------------------------------------------------- + +<_Country_> Armenia +<_Survey Title_> Integrated Living Conditions Survey +<_Survey Year_> 2008 +<_Study ID_> https://microdatalib.worldbank.org/index.php/catalog/2615 +<_Data collection from_> [MM/YYYY] +<_Data collection to_> [MM/YYYY] +<_Source of dataset_> [Source of data, e.g. NSO] +<_Sample size (HH)_> [#] +<_Sample size (IND)_> [#] +<_Sampling method_> [Brief description] +<_Geographic coverage_> [To what level is data significant] +<_Currency_> [Currency used for wages] + +----------------------------------------------------------------------- + +<_ICLS Version_> [Version of ICLS for Labor Questions] +<_ISCED Version_> [Version of ICLS for Labor Questions] +<_ISCO Version_> [Version of ICLS for Labor Questions] +<_OCCUP National_> [Version of ICLS for Labor Questions] +<_ISIC Version_> [Version of ICLS for Labor Questions] +<_INDUS National_> [Version of ICLS for Labor Questions] + +----------------------------------------------------------------------- +<_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 "Y:/GLD-Harmonization/529026_MG/Countries" +local country "ARM" +local year "2008" +local survey "ILCS" +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 + +* Check whether there is a weight file +local has_wf = fileexists("`path_in_stata/weight.dta'") + +* Start with HH +use "`path_in_stata'/hh.dta" + +* If there is a weight file, merge it in +if `has_wf' { + merge 1:1 recno using "`path_in_stata/weight.dta'", assert(match) nogen +} + +* Add member roster +merge 1:m recno using "`path_in_stata'/mem.dta", assert(match) nogen + +* 2008 has employment in mem.dta + +* Add number labels +numlabel, add force + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "ARM" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "ILCS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "GLD" + 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 = "" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3.1" + 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_year= 2008 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month = date + label 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> + + Values are running number. Would have preferred making it a string with 0001 to 5184, but leave as is since + GMD has it this way. For PID concatenate this with 01-12 but leave as is. + + */ + gen hhid = recno + label var hhid "Household ID" +* + + +*<_pid_> + gen pid = memnum + label var pid "Individual ID" +* + + +*<_weight_> + * Weight already exists + *gen weight = . + 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_> + * typev is 0 if YErevan, 1 if urban (other), rural is 2 + gen byte urban = inrange(typev, 0,1) + replace urban = 0 if typev == 2 + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + The variable is string and country-specific categorical. Numeric entries are coded in string format using the following naming convention: "1 – Hatay". That is, the variable itself is to be string, not a labelled numeric vector. + + Example of entries would be "1 - Alaska", "2 - Arkansas", ... + + */ + gen str subnatid1 = "" + replace subnatid1 = "1 - Yerevan" if marz == 1 + replace subnatid1 = "2 - Aragatsotn" if marz == 2 + replace subnatid1 = "3 - Ararat" if marz == 3 + replace subnatid1 = "4 - Armavir" if marz == 4 + replace subnatid1 = "5 - Gegharkunik" if marz == 5 + replace subnatid1 = "6 - Lori" if marz == 6 + replace subnatid1 = "7 - Kotayk" if marz == 7 + replace subnatid1 = "8 - Shirak" if marz == 8 + replace subnatid1 = "9 - Syunik" if marz == 9 + replace subnatid1 = "10 - Vayoc Dzor" if marz == 10 + replace subnatid1 = "11 - Tavush" if marz == 11 +* + + +*<_subnatid2_> + gen str 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_> + * If keep all + gen hsize = members + /* * If drop absentees + gen helper = 1 + egen hh_abs_no = total(helper), by(recno) + replace hsize = hsize - hh_abs_no + drop helper hh_abs_no + */ + label var hsize "Household size" +* + + +*<_age_> + * Already in there + *gen age = . + label var age "Individual age" +* + + +*<_male_> + gen male = a1_1 + recode male (2 = 0) + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen relationharm = a1_2 + recode relationharm (4 = 3) (6 = 4) (7 = 5) (8 = 6) + 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_> + clonevar relationcs = a1_2 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = a1_5 + recode marital (3 = 5) (5 = 3) + label var marital "Marital status" + la de 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" + 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 +==============================================================================================%%*/ + + +{ + +* Migration questions are at household level this year - cannot use + +*<_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 = . + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + 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 = . + 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" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = . + *label de lblmigrated_from_code + *label values migrated_from_code lblmigrated_from_code + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = . + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + 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_> + +/* <_ed_mod_age_note> + +Education module is only asked to those XX and older. + + */ + +gen byte ed_mod_age = 6 +label var ed_mod_age "Education module application age" + +* + +*<_school_> + gen byte school = 0 + replace school = 1 if e2_4 == 1 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = 1 + replace literacy = 0 if e2_2 == 0 + replace literacy = . if mi(e2_2) + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + * Number of years is a combination of level (e2_2) and years in that course (e2_3) + gen byte educy =. + replace educy = 0 if e2_2 == 0 + replace educy = e2_3 if e2_2 == 1 & inrange(e2_3,0,4) + replace educy = 4 + e2_3 if e2_2 == 2 & inrange(e2_3,0,5) + replace educy = 9 + e2_3 if e2_2 == 3 & inrange(e2_3,0,3) + replace educy = 9 + e2_3 if e2_2 == 4 & inrange(e2_3,0,2) + replace educy = 9 + e2_3 if e2_2 == 5 & inrange(e2_3,0,5) + replace educy = 12 + e2_3 if e2_2 == 6 & inrange(e2_3,0,7) + replace educy = 16 + e2_3 if e2_2 == 7 & inrange(e2_3,0,4) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7 =. + replace educat7 = 1 if e2_2 == 0 + replace educat7 = 2 if e2_2 == 1 & e2_3 < 4 + replace educat7 = 3 if e2_2 == 1 & e2_3 == 4 + replace educat7 = 4 if e2_2 == 2 + replace educat7 = 5 if inrange(e2_2, 3, 4) + replace educat7 = 6 if e2_2 == 5 + replace educat7 = 7 if inrange(e2_2, 6, 7) + 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", 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" + 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_> + clonevar educat_orig = e2_2 + 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_var "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach v of local ed_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `v'= "" 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 = 15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus = . + + * Employed if either has work (d1_1) or will go back (d1_2) + replace lstatus = 1 if d1_1 == 1 | d1_2 == 1 + + * Unemployed if looking for a job (yes to d4_5 two forms) and willing to accept (yes to d4_14) + replace lstatus = 2 if inrange(d4_5, 1, 2) & d4_14 == 1 + + * Remaining people would all go to NLF but since data is 15-75 and there is the absentee issue, define precisely + replace lstatus = 3 if (d4_5 == 3 & d4_14 == 2) | (d4_5 == 3 & d4_14 == 1) | (inrange(d4_5, 1, 2) & d4_14 == 2) + + replace lstatus = . if age < minlaborage + 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 = 0 + replace potential_lf = 1 if (d4_5 == 3 & d4_14 == 1) | (inrange(d4_5, 1, 2) & d4_14 == 2) + replace potential_lf = . if age < minlaborage & 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 & 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=. + 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=. + replace unempldur_l = 0 if d4_11 == 1 + replace unempldur_l = 1 if d4_11 == 2 + replace unempldur_l = 4 if d4_11 == 3 + replace unempldur_l = 7 if d4_11 == 4 + replace unempldur_l = 13 if d4_11 == 5 + replace unempldur_l = 25 if d4_11 == 6 + replace unempldur_l = 49 if d4_11 == 7 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=. + replace unempldur_u = 1 if d4_11 == 1 + replace unempldur_u = 3 if d4_11 == 2 + replace unempldur_u = 6 if d4_11 == 3 + replace unempldur_u = 12 if d4_11 == 4 + replace unempldur_u = 24 if d4_11 == 5 + replace unempldur_u = 48 if d4_11 == 6 + replace unempldur_u = 999 if d4_11 == 7 + replace unempldur_u = . if lstatus != 2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* + +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat = d1_7 + recode empstat (2 = 1) (5 = 2) (6 = 4) (7 = 5) + 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_> +/* <_ocusec_note> + + While other years have code 2 as "municipality", here it is "community". Translating from Armenian + gives the same. Of the 98 answers, if weighted, 40% work in Public Admin, 23.4% in education, 13.3% + in provision of public services (culture, sport, ...). They are also 98% with contract. + Assume this is public as well + + Code 4 is "mixed - with government particiaption, send to state owned" + + */ + gen byte ocusec = d1_6 + recode ocusec (2 7 = 1) (3 5 6 = 2) (4 = 3) + 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 = d1_4 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + replace industrycat_isic = "A" if d1_4 == 1 + replace industrycat_isic = "B" if d1_4 == 2 + replace industrycat_isic = "C" if d1_4 == 3 + replace industrycat_isic = "D" if d1_4 == 4 + replace industrycat_isic = "E" if d1_4 == 5 + replace industrycat_isic = "F" if d1_4 == 6 + replace industrycat_isic = "G" if d1_4 == 7 + replace industrycat_isic = "H" if d1_4 == 8 + replace industrycat_isic = "I" if d1_4 == 9 + replace industrycat_isic = "J" if d1_4 == 10 + replace industrycat_isic = "K" if d1_4 == 11 + replace industrycat_isic = "L" if d1_4 == 12 + replace industrycat_isic = "M" if d1_4 == 13 + replace industrycat_isic = "N" if d1_4 == 14 | d1_4 == 15 + replace industrycat_isic = "O" if d1_4 == 16 + replace industrycat_isic = "P" if d1_4 == 17 + replace industrycat_isic = "Q" if d1_4 == 18 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = . + replace industrycat10 = 1 if inrange(d1_4, 1, 2) + replace industrycat10 = 2 if d1_4 == 3 + replace industrycat10 = 3 if d1_4 == 4 + replace industrycat10 = 4 if d1_4 == 5 + replace industrycat10 = 5 if d1_4 == 6 + replace industrycat10 = 6 if inrange(d1_4, 7, 8) + replace industrycat10 = 7 if d1_4 == 9 + replace industrycat10 = 8 if inrange(d1_4, 10, 11) + replace industrycat10 = 9 if d1_4 == 12 + replace industrycat10 = 10 if inrange(d1_4, 13, 18) + 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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + + * 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) + *int_classif_universe, var(occup_isco) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + gen byte occup = . + 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_> + egen double wage_no_compen = rowtotal(d1_17 d1_18), missing + replace wage_no_compen = . if lstatus != 1 | empstat == 2 | wage_no_compen == 0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + replace unitwage = . if mi(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 = d1_14 + replace whours = . if whours == 0 | 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 = 0 + replace contract = 1 if d1_7 == 1 + replace contract = . if lstatus != 1 + 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 firmsize_l = . + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen 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 = d2_4 + recode empstat_2 (2 = 1) (5 = 2) (6 = 4) (7 = 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 = d2_3 + recode ocusec_2 (2 7 = 1) (3 5 6 = 2) (4 = 3) + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2 = d2_2 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = "" + replace industrycat_isic_2 = "A" if d2_2 == 1 + replace industrycat_isic_2 = "B" if d2_2 == 2 + replace industrycat_isic_2 = "C" if d2_2 == 3 + replace industrycat_isic_2 = "D" if d2_2 == 4 + replace industrycat_isic_2 = "E" if d2_2 == 5 + replace industrycat_isic_2 = "F" if d2_2 == 6 + replace industrycat_isic_2 = "G" if d2_2 == 7 + replace industrycat_isic_2 = "H" if d2_2 == 8 + replace industrycat_isic_2 = "I" if d2_2 == 9 + replace industrycat_isic_2 = "J" if d2_2 == 10 + replace industrycat_isic_2 = "K" if d2_2 == 11 + replace industrycat_isic_2 = "L" if d2_2 == 12 + replace industrycat_isic_2 = "M" if d2_2 == 13 + replace industrycat_isic_2 = "N" if d2_2 == 14 | d2_2 == 15 + replace industrycat_isic_2 = "O" if d2_2 == 16 + replace industrycat_isic_2 = "P" if d2_2 == 17 + replace industrycat_isic_2 = "Q" if d2_2 == 18 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + replace industrycat10_2 = 1 if inrange(d2_2, 1, 2) + replace industrycat10_2 = 2 if d2_2 == 3 + replace industrycat10_2 = 3 if d2_2 == 4 + replace industrycat10_2 = 4 if d2_2 == 5 + replace industrycat10_2 = 5 if d2_2 == 6 + replace industrycat10_2 = 6 if inrange(d2_2, 7, 8) + replace industrycat10_2 = 7 if d2_2 == 9 + replace industrycat10_2 = 8 if inrange(d2_2, 10, 11) + replace industrycat10_2 = 9 if d2_2 == 12 + replace industrycat10_2 = 10 if inrange(d2_2, 13, 18) + 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_> + egen double wage_no_compen_2 = rowtotal(d2_11 d2_12), missing + replace wage_no_compen_2 = . if mi(empstat_2) | empstat_2 == 2 | wage_no_compen_2 == 0 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = 5 + replace unitwage_2 = . if mi(wage_no_compen_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 < minlaborage & age != . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year=. if age < minlaborage & 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 & 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 = . + 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_var "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 v of local lab_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `v'= "" 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 var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/ARM/ARM_2009_ILCS/ARM_2009_ILCS_V01_M_V01_A_GLD/Programs/ARM_2009_ILCS_V01_M_V01_A_GLD_ALL.do b/GLD/ARM/ARM_2009_ILCS/ARM_2009_ILCS_V01_M_V01_A_GLD/Programs/ARM_2009_ILCS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..3c631f184 --- /dev/null +++ b/GLD/ARM/ARM_2009_ILCS/ARM_2009_ILCS_V01_M_V01_A_GLD/Programs/ARM_2009_ILCS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1798 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> ARM_2009_ILCS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2024-09-11 + +------------------------------------------------------------------------- + +<_Country_> Armenia +<_Survey Title_> Integrated Living Conditions Survey +<_Survey Year_> 2009 +<_Study ID_> https://microdatalib.worldbank.org/index.php/catalog/2615 +<_Data collection from_> [MM/YYYY] +<_Data collection to_> [MM/YYYY] +<_Source of dataset_> [Source of data, e.g. NSO] +<_Sample size (HH)_> [#] +<_Sample size (IND)_> [#] +<_Sampling method_> [Brief description] +<_Geographic coverage_> [To what level is data significant] +<_Currency_> [Currency used for wages] + +----------------------------------------------------------------------- + +<_ICLS Version_> [Version of ICLS for Labor Questions] +<_ISCED Version_> [Version of ICLS for Labor Questions] +<_ISCO Version_> [Version of ICLS for Labor Questions] +<_OCCUP National_> [Version of ICLS for Labor Questions] +<_ISIC Version_> [Version of ICLS for Labor Questions] +<_INDUS National_> [Version of ICLS for Labor Questions] + +----------------------------------------------------------------------- +<_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 "Y:/GLD-Harmonization/529026_MG/Countries" +local country "ARM" +local year "2009" +local survey "ILCS" +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 + +* Check whether there is a weight file +local has_wf = fileexists("`path_in_stata'/weight.dta") + +* Start with HH +use "`path_in_stata'/hh.dta" + +* If there is a weight file, merge it in +if `has_wf' { + merge 1:1 recno using "`path_in_stata'/weight.dta", assert(match) nogen +} + +* Add member roster +merge 1:m recno using "`path_in_stata'/mem.dta", assert(match) nogen + +* Add employment section +merge 1:1 recno memnum using "`path_in_stata'/d1", assert(match master) nogen + +* Add number labels +numlabel, add force + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "ARM" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "ILCS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "GLD" + 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 = "" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3.1" + 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_year= 2009 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month = date + label 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> + + Values are running number. Would have preferred making it a string with 0001 to 5184, but leave as is since + GMD has it this way. For PID concatenate this with 01-12 but leave as is. + + */ + gen hhid = recno + label var hhid "Household ID" +* + + +*<_pid_> + gen pid = memnum + label var pid "Individual ID" +* + + +*<_weight_> + * Weight already exists + *gen weight = . + 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_> + * PSU already exists + *gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = recno + 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_> + * typev is 0 if YErevan, 1 if urban (other), rural is 2 + gen byte urban = inrange(typev, 0,1) + replace urban = 0 if typev == 2 + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + The variable is string and country-specific categorical. Numeric entries are coded in string format using the following naming convention: "1 – Hatay". That is, the variable itself is to be string, not a labelled numeric vector. + + Example of entries would be "1 - Alaska", "2 - Arkansas", ... + + */ + gen str subnatid1 = "" + replace subnatid1 = "1 - Yerevan" if marz == 1 + replace subnatid1 = "2 - Aragatsotn" if marz == 2 + replace subnatid1 = "3 - Ararat" if marz == 3 + replace subnatid1 = "4 - Armavir" if marz == 4 + replace subnatid1 = "5 - Gegharkunik" if marz == 5 + replace subnatid1 = "6 - Lori" if marz == 6 + replace subnatid1 = "7 - Kotayk" if marz == 7 + replace subnatid1 = "8 - Shirak" if marz == 8 + replace subnatid1 = "9 - Syunik" if marz == 9 + replace subnatid1 = "10 - Vayoc Dzor" if marz == 10 + replace subnatid1 = "11 - Tavush" if marz == 11 +* + + +*<_subnatid2_> + gen str 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 + + */ + decode urban, generate(helper) + generate subnatidsurvey = string(urban) + " - " + helper + drop helper + 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_> + * If keep all + gen hsize = members + /* * If drop absentees + gen helper = 1 + egen hh_abs_no = total(helper), by(recno) + replace hsize = hsize - hh_abs_no + drop helper hh_abs_no + */ + label var hsize "Household size" +* + + +*<_age_> + * Already in there + *gen age = . + label var age "Individual age" +* + + +*<_male_> + gen male = a1_1 + recode male (2 = 0) + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen relationharm = a1_2 + recode relationharm (4 = 3) (6 = 4) (7 = 5) (8 = 6) + 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_> + clonevar relationcs = a1_2 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = a1_5 + recode marital (3 = 5) (5 = 3) + label var marital "Marital status" + la de 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" + 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 +==============================================================================================%%*/ + + +{ + +* Migration is not done as it is much more narrowly defined as migrated and returned. Thus anyone who +* migrated from their home town to the capital city would not be included. + +*<_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 = . + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + 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 = . + 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" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = . + *label de lblmigrated_from_code + *label values migrated_from_code lblmigrated_from_code + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = . + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + 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_> + +/* <_ed_mod_age_note> + +Education module is only asked to those XX and older. + + */ + +gen byte ed_mod_age = 6 +label var ed_mod_age "Education module application age" + +* + +*<_school_> + gen byte school = 0 + replace school = 1 if e2_4 == 1 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = 1 + replace literacy = 0 if e2_2 == 0 + replace literacy = . if mi(e2_2) + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + * Number of years is a combination of level (e2_2) and years in that course (e2_3) + gen byte educy =. + replace educy = 0 if e2_2 == 0 + replace educy = e2_3 if e2_2 == 1 & inrange(e2_3,0,4) + replace educy = 4 + e2_3 if e2_2 == 2 & inrange(e2_3,0,5) + replace educy = 9 + e2_3 if e2_2 == 3 & inrange(e2_3,0,3) + replace educy = 9 + e2_3 if e2_2 == 4 & inrange(e2_3,0,2) + replace educy = 9 + e2_3 if e2_2 == 5 & inrange(e2_3,0,5) + replace educy = 12 + e2_3 if e2_2 == 6 & inrange(e2_3,0,7) + replace educy = 16 + e2_3 if e2_2 == 7 & inrange(e2_3,0,4) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7 =. + replace educat7 = 1 if e2_2 == 0 + replace educat7 = 2 if e2_2 == 1 & e2_3 < 4 + replace educat7 = 3 if e2_2 == 1 & e2_3 == 4 + replace educat7 = 4 if e2_2 == 2 + replace educat7 = 5 if inrange(e2_2, 3, 4) + replace educat7 = 6 if e2_2 == 5 + replace educat7 = 7 if inrange(e2_2, 6, 7) + 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", 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" + 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_> + clonevar educat_orig = e2_2 + 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_var "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach v of local ed_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `v'= "" 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 = 15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus = 1 if !mi(d1_4a) + + * For unemployed we need looking for a job (d2_5) and willing to accept (d3_11) + * Ensured all who looked answer the willing question + count if inrange(d3_5,1,2) & mi(d3_11) + assert `r(N)' == 0 + replace lstatus = 2 if lstatus == . & inrange(d3_5, 1, 2) & d3_11 == 1 + + * Normally, I would set all others to NLF, but given that we have the absentees, assign only to no in d2_5 + replace lstatus = 3 if lstatus == . & d3_5 == 3 + replace lstatus = 3 if lstatus == . & inrange(d3_5, 1, 2) & d3_11 == 2 + + replace lstatus = . if age < minlaborage + 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 = 0 + * Either not looking but would accept or looking but would not accept + replace potential_lf = 1 if (d3_5 == 3 & d3_11 == 1) | (inrange(d3_5,1,2) & d3_11 == 2) + replace potential_lf = . if age < minlaborage & 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 = 1 if d1_25a == 1 + replace underemployment = 0 if d1_25a == 2 + replace underemployment = . if age < minlaborage & 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=. + 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=. + replace unempldur_l = 0 if d3_13 == 1 + replace unempldur_l = 1 if d3_13 == 2 + replace unempldur_l = 4 if d3_13 == 3 + replace unempldur_l = 7 if d3_13 == 4 + replace unempldur_l = 13 if d3_13 == 5 + replace unempldur_l = 25 if d3_13 == 6 + replace unempldur_l = 49 if d3_13 == 7 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=. + replace unempldur_u = 1 if d3_13 == 1 + replace unempldur_u = 3 if d3_13 == 2 + replace unempldur_u = 6 if d3_13 == 3 + replace unempldur_u = 12 if d3_13 == 4 + replace unempldur_u = 24 if d3_13 == 5 + replace unempldur_u = 48 if d3_13 == 6 + replace unempldur_u = 999 if d3_13 == 7 + replace unempldur_u = . if lstatus != 2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* + +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat = d1_8a + recode empstat (2 3 = 1) (4 = 3) (5 6 8 = 4) (7 = 2) (90 = 5) + 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", replace + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = d1_9a + recode ocusec (2 = 1) (3/5 = 2) + 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_> + decode d1_5a, gen(industry_orig) + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + replace industrycat_isic = "A" if d1_5a == 1 + replace industrycat_isic = "B" if d1_5a == 2 + replace industrycat_isic = "C" if d1_5a == 3 + replace industrycat_isic = "D" if d1_5a == 4 + replace industrycat_isic = "E" if d1_5a == 5 + replace industrycat_isic = "F" if d1_5a == 6 + replace industrycat_isic = "G" if d1_5a == 7 + replace industrycat_isic = "H" if d1_5a == 8 + replace industrycat_isic = "I" if d1_5a == 9 + replace industrycat_isic = "J" if d1_5a == 10 + replace industrycat_isic = "K" if d1_5a == 11 + replace industrycat_isic = "L" if d1_5a == 12 + replace industrycat_isic = "M" if d1_5a == 13 + replace industrycat_isic = "N" if d1_5a == 14 + replace industrycat_isic = "O" if d1_5a == 15 + replace industrycat_isic = "P" if d1_5a == 16 + replace industrycat_isic = "Q" if d1_5a == 17 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = . + replace industrycat10 = 1 if inrange(d1_5a, 1, 2) + replace industrycat10 = 2 if d1_5a == 3 + replace industrycat10 = 3 if d1_5a == 4 + replace industrycat10 = 4 if d1_5a == 5 + replace industrycat10 = 5 if d1_5a == 6 + replace industrycat10 = 6 if inrange(d1_5a, 7, 8) + replace industrycat10 = 7 if d1_5a == 9 + replace industrycat10 = 8 if inrange(d1_5a, 10, 11) + replace industrycat10 = 9 if d1_5a == 12 + replace industrycat10 = 10 if inrange(d1_5a, 13, 17) + 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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + + * 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) + *int_classif_universe, var(occup_isco) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + gen byte occup = . + 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_> + egen double wage_no_compen = rowtotal(d1_17a d1_19a), missing + replace wage_no_compen = . if lstatus != 1 | empstat == 2 | wage_no_compen == 0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + replace unitwage = . if mi(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 = d1_26a + replace whours = . if whours == 0 | 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 = 0 + replace contract = 1 if d1_8a == 1 | d1_8a == 2 + replace contract = . if lstatus != 1 + 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 firmsize_l = . + replace firmsize_l = 1 if d1_11a == 1 + replace firmsize_l = 6 if d1_11a == 2 + replace firmsize_l = 16 if d1_11a == 3 + replace firmsize_l = 31 if d1_11a == 4 + replace firmsize_l = 50 if d1_11a == 5 + replace firmsize_l = 100 if d1_11a == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_l = 100 if ocusec == 1 & mi(firmsize_l) + + replace firmsize_l = . if lstatus != 1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen firmsize_u= . + replace firmsize_u = 5 if d1_11a == 1 + replace firmsize_u = 15 if d1_11a == 2 + replace firmsize_u = 30 if d1_11a == 3 + replace firmsize_u = 49 if d1_11a == 4 + replace firmsize_u = 99 if d1_11a == 5 + replace firmsize_u = 9999 if d1_11a == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_u = 9999 if ocusec == 1 & mi(firmsize_u) + + 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 = d1_8b + recode empstat_2 (2 = 1) (5 6 = 4) (7 = 2) (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 = d1_9b + recode ocusec_2 (2 = 1) (3/5 = 2) (0 = .) + replace ocusec_2 = . if mi(empstat_2) + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + decode d1_5b, 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 = "" + replace industrycat_isic_2 = "A" if d1_5b == 1 + replace industrycat_isic_2 = "B" if d1_5b == 2 + replace industrycat_isic_2 = "C" if d1_5b == 3 + replace industrycat_isic_2 = "D" if d1_5b == 4 + replace industrycat_isic_2 = "E" if d1_5b == 5 + replace industrycat_isic_2 = "F" if d1_5b == 6 + replace industrycat_isic_2 = "G" if d1_5b == 7 + replace industrycat_isic_2 = "H" if d1_5b == 8 + replace industrycat_isic_2 = "I" if d1_5b == 9 + replace industrycat_isic_2 = "J" if d1_5b == 10 + replace industrycat_isic_2 = "K" if d1_5b == 11 + replace industrycat_isic_2 = "L" if d1_5b == 12 + replace industrycat_isic_2 = "M" if d1_5b == 13 + replace industrycat_isic_2 = "N" if d1_5b == 14 + replace industrycat_isic_2 = "O" if d1_5b == 15 + replace industrycat_isic_2 = "P" if d1_5b == 16 + replace industrycat_isic_2 = "Q" if d1_5b == 17 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + replace industrycat10_2 = 1 if inrange(d1_5b, 1, 2) + replace industrycat10_2 = 2 if d1_5b == 3 + replace industrycat10_2 = 3 if d1_5b == 4 + replace industrycat10_2 = 4 if d1_5b == 5 + replace industrycat10_2 = 5 if d1_5b == 6 + replace industrycat10_2 = 6 if inrange(d1_5b, 7, 8) + replace industrycat10_2 = 7 if d1_5b == 9 + replace industrycat10_2 = 8 if inrange(d1_5b, 10, 11) + replace industrycat10_2 = 9 if d1_5b == 12 + replace industrycat10_2 = 10 if inrange(d1_5b, 13, 17) + 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_> + egen double wage_no_compen_2 = rowtotal(d1_17b d1_19b), missing + replace wage_no_compen_2 = . if mi(empstat_2) | empstat_2 == 2 | wage_no_compen_2 == 0 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = 5 + replace unitwage_2 = . if mi(wage_no_compen_2) + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = d1_26b + replace whours_2 = . if whours_2 == 0 | mi(empstat_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 = . + replace firmsize_l_2 = 1 if d1_11b == 1 + replace firmsize_l_2 = 6 if d1_11b == 2 + replace firmsize_l_2 = 16 if d1_11b == 3 + replace firmsize_l_2 = 31 if d1_11b == 4 + replace firmsize_l_2 = 50 if d1_11b == 5 + replace firmsize_l_2 = 100 if d1_11b == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_l_2 = 100 if ocusec_2 == 1 & mi(firmsize_l_2) + + replace firmsize_l_2 = . if mi(empstat_2) + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + replace firmsize_u_2 = 5 if d1_11b == 1 + replace firmsize_u_2 = 15 if d1_11b == 2 + replace firmsize_u_2 = 30 if d1_11b == 3 + replace firmsize_u_2 = 49 if d1_11b == 4 + replace firmsize_u_2 = 99 if d1_11b == 5 + replace firmsize_u_2 = 9999 if d1_11b == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_u_2 = 9999 if ocusec_2 == 1 & mi(firmsize_u_2) + + replace firmsize_u_2 = . if mi(empstat_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 < minlaborage & age != . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year=. if age < minlaborage & 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 & 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 = . + 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_var "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 v of local lab_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `v'= "" 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 var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/ARM/ARM_2010_ILCS/ARM_2010_ILCS_V01_M_V01_A_GLD/Programs/ARM_2010_ILCS_V01_M_V01_A_GLD_ALL.do b/GLD/ARM/ARM_2010_ILCS/ARM_2010_ILCS_V01_M_V01_A_GLD/Programs/ARM_2010_ILCS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..0ebad0fd0 --- /dev/null +++ b/GLD/ARM/ARM_2010_ILCS/ARM_2010_ILCS_V01_M_V01_A_GLD/Programs/ARM_2010_ILCS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1767 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> ARM_2010_ILCS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2024-09-11 + +------------------------------------------------------------------------- + +<_Country_> Armenia +<_Survey Title_> Integrated Living Conditions Survey +<_Survey Year_> 2010 +<_Study ID_> https://microdatalib.worldbank.org/index.php/catalog/2615 +<_Data collection from_> [MM/YYYY] +<_Data collection to_> [MM/YYYY] +<_Source of dataset_> [Source of data, e.g. NSO] +<_Sample size (HH)_> [#] +<_Sample size (IND)_> [#] +<_Sampling method_> [Brief description] +<_Geographic coverage_> [To what level is data significant] +<_Currency_> [Currency used for wages] + +----------------------------------------------------------------------- + +<_ICLS Version_> [Version of ICLS for Labor Questions] +<_ISCED Version_> [Version of ICLS for Labor Questions] +<_ISCO Version_> [Version of ICLS for Labor Questions] +<_OCCUP National_> [Version of ICLS for Labor Questions] +<_ISIC Version_> [Version of ICLS for Labor Questions] +<_INDUS National_> [Version of ICLS for Labor Questions] + +----------------------------------------------------------------------- +<_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 "Y:/GLD-Harmonization/529026_MG/Countries" +local country "ARM" +local year "2010" +local survey "ILCS" +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 + +* Check whether there is a weight file +local has_wf = fileexists("`path_in_stata/weight.dta'") + +* Start with HH +use "`path_in_stata'/hh.dta" + +* If there is a weight file, merge it in +if `has_wf' { + merge 1:1 recno using "`path_in_stata/weight.dta'", assert(match) nogen +} + +* Add member roster +merge 1:m recno using "`path_in_stata'/mem.dta", assert(match) nogen + +* Add employment section +merge 1:1 recno memnum using "`path_in_stata'/d1", assert(match master) nogen + +* Add number labels +numlabel, add force + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "ARM" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "ILCS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "GLD" + 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 = "" + 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 = 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_year= 2010 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month = date + label 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> + + Values are 1-5184 running. Would have preferred making it a string with 0001 to 5184, but leave as is since + GMD has it this way. For PID concatenate this with 01-12 but leave as is. + + */ + gen hhid = recno + label var hhid "Household ID" +* + + +*<_pid_> + gen pid = memnum + label var pid "Individual ID" +* + + +*<_weight_> + *gen weight = weight + 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_> + * typev is 0 if Yerevan, 1 if urban (other), rural is 2 + gen byte urban = inrange(typev, 0,1) + replace urban = 0 if typev == 2 + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + +*<_subnatid1_> +/* <_subnatid1_note> + + The variable is string and country-specific categorical. Numeric entries are coded in string format using the following naming convention: "1 – Hatay". That is, the variable itself is to be string, not a labelled numeric vector. + + Example of entries would be "1 - Alaska", "2 - Arkansas", ... + + */ + gen str subnatid1 = "" + replace subnatid1 = "1 - Yerevan" if marz == 1 + replace subnatid1 = "2 - Aragatsotn" if marz == 2 + replace subnatid1 = "3 - Ararat" if marz == 3 + replace subnatid1 = "4 - Armavir" if marz == 4 + replace subnatid1 = "5 - Gegharkunik" if marz == 5 + replace subnatid1 = "6 - Lori" if marz == 6 + replace subnatid1 = "7 - Kotayk" if marz == 7 + replace subnatid1 = "8 - Shirak" if marz == 8 + replace subnatid1 = "9 - Syunik" if marz == 9 + replace subnatid1 = "10 - Vayoc Dzor" if marz == 10 + replace subnatid1 = "11 - Tavush" if marz == 11 + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen str 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 + + */ + decode urban, generate(helper) + generate subnatidsurvey = string(urban) + " - " + helper + drop helper + 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_> + * If keep all + gen hsize = members + /* * If drop absentees + gen helper = 1 + egen hh_abs_no = total(helper), by(recno) + replace hsize = hsize - hh_abs_no + drop helper hh_abs_no + */ + label var hsize "Household size" +* + + +*<_age_> + * Already in there + *gen age = . + label var age "Individual age" +* + + +*<_male_> + gen male = a1_1 + recode male (2 = 0) + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen relationharm = a1_2 + recode relationharm (4 = 3) (6 = 4) (7 = 5) (8 = 6) + 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_> + clonevar relationcs = a1_2 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = a1_5 + recode marital (3 = 5) (5 = 3) + 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 +==============================================================================================%%*/ + + +{ + +* Migration is not done as it is much more narrowly defined as migrated and returned. Thus anyone who +* migrated from their home town to the capital city would not be included. + +*<_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 = . + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + 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 = . + 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" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = . + *label de lblmigrated_from_code + *label values migrated_from_code lblmigrated_from_code + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = . + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + 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_> + +/* <_ed_mod_age_note> + +Education module is only asked to those XX and older. + + */ + +gen byte ed_mod_age = 6 +label var ed_mod_age "Education module application age" + +* + + +*<_school_> + gen byte school = 0 + replace school = 1 if e2_7 == 1 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = 1 + replace literacy = 0 if e2_2 == 0 + replace literacy = . if mi(e2_2) + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + * Number of years is a combination of level (e2_2) and years in that course (e2_3) + gen byte educy =. + replace educy = 0 if e2_2 == 0 + replace educy = e2_3 if e2_2 == 1 & inrange(e2_3,0,4) + replace educy = 4 + e2_3 if e2_2 == 2 & inrange(e2_3,0,5) + replace educy = 9 + e2_3 if e2_2 == 3 & inrange(e2_3,0,3) + replace educy = 9 + e2_3 if e2_2 == 4 & inrange(e2_3,0,2) + replace educy = 9 + e2_3 if e2_2 == 5 & inrange(e2_3,0,5) + replace educy = 12 + e2_3 if e2_2 == 6 & inrange(e2_3,0,7) + replace educy = 16 + e2_3 if e2_2 == 7 & inrange(e2_3,0,4) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7 =. + replace educat7 = 1 if e2_2 == 0 + replace educat7 = 2 if e2_2 == 1 & e2_3 < 4 + replace educat7 = 3 if e2_2 == 1 & e2_3 == 4 + replace educat7 = 4 if e2_2 == 2 + replace educat7 = 5 if inrange(e2_2, 3, 4) + replace educat7 = 6 if e2_2 == 5 + replace educat7 = 7 if inrange(e2_2, 6, 7) + 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", 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" + 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_> + clonevar educat_orig = e2_2 + 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_var "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach v of local ed_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `v'= "" 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 = 15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + * Logic is either have a job (yes to D1_1a) or returning (D1_2a) + * However the returning is subject to reasons (D1_3a) that are not + * a skip pattern but upon probing of the enumerator + * The below tab shows that some go to main job, others don't + * tab d1_3a d1_4a,m + gen byte lstatus = 1 if !mi(d1_4a) + + * For unemployed we need looking for a job (d2_5) and willing to accept (d2_10) + * Ensured all who looked answer the willing question + count if inrange(d2_5,1,2) & mi(d2_10) + assert `r(N)' == 0 + replace lstatus = 2 if lstatus == . & inrange(d2_5, 1, 2) & d2_10 == 1 + + * Normally, I would set all others to NLF, but given that we have the absentees, assign only to no in d2_5 + replace lstatus = 3 if lstatus == . & d2_5 == 3 + replace lstatus = 3 if lstatus == . & inrange(d2_5, 1, 2) & d2_10 == 2 + + replace lstatus = . if age < minlaborage + 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 = 0 + * Either not looking but would accept or looking but would not accept + replace potential_lf = 1 if (d2_5 == 3 & d2_10 == 1) | (inrange(d2_5,1,2) & d2_10 == 2) + replace potential_lf = . if age < minlaborage & 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 = 0 + replace underemployment = 1 if d1_23a == 7 + replace underemployment = . if age < minlaborage & 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=. + 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=. + replace unempldur_l = 0 if d2_9 == 1 + replace unempldur_l = 1 if d2_9 == 2 + replace unempldur_l = 4 if d2_9 == 3 + replace unempldur_l = 7 if d2_9 == 4 + replace unempldur_l = 13 if d2_9 == 5 + replace unempldur_l = 25 if d2_9 == 6 + replace unempldur_l = 49 if d2_9 == 7 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=. + replace unempldur_u = 1 if d2_9 == 1 + replace unempldur_u = 3 if d2_9 == 2 + replace unempldur_u = 6 if d2_9 == 3 + replace unempldur_u = 12 if d2_9 == 4 + replace unempldur_u = 24 if d2_9 == 5 + replace unempldur_u = 48 if d2_9 == 6 + replace unempldur_u = 999 if d2_9 == 7 + replace unempldur_u = . if lstatus != 2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat = d1_7a + recode empstat (2 3 = 1) (4 = 3) (5 6 8 = 4) (7 = 2) + 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 = d1_8a + recode ocusec (2 = 1) (3/5 = 2) + 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_> + decode d1_5a, gen(industry_orig) + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + replace industrycat_isic = "A" if d1_5a == 1 + replace industrycat_isic = "B" if d1_5a == 2 + replace industrycat_isic = "C" if d1_5a == 3 + replace industrycat_isic = "D" if d1_5a == 4 + replace industrycat_isic = "E" if d1_5a == 5 + replace industrycat_isic = "F" if d1_5a == 6 + replace industrycat_isic = "G" if d1_5a == 7 + replace industrycat_isic = "H" if d1_5a == 8 + replace industrycat_isic = "I" if d1_5a == 9 + replace industrycat_isic = "J" if d1_5a == 10 + replace industrycat_isic = "K" if d1_5a == 11 + replace industrycat_isic = "L" if d1_5a == 12 + replace industrycat_isic = "M" if d1_5a == 13 + replace industrycat_isic = "N" if d1_5a == 14 + replace industrycat_isic = "O" if d1_5a == 15 + replace industrycat_isic = "P" if d1_5a == 16 + replace industrycat_isic = "Q" if d1_5a == 17 + replace industrycat_isic = "R" if d1_5a == 18 + replace industrycat_isic = "S" if d1_5a == 19 + replace industrycat_isic = "T" if d1_5a == 20 + replace industrycat_isic = "U" if d1_5a == 21 + + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = . + replace industrycat10 = 1 if d1_5a == 1 + replace industrycat10 = 2 if d1_5a == 2 + replace industrycat10 = 3 if d1_5a == 3 + replace industrycat10 = 4 if inrange(d1_5a,4,5) + replace industrycat10 = 5 if d1_5a == 6 + replace industrycat10 = 6 if inlist(d1_5a, 7, 9) + replace industrycat10 = 7 if inlist(d1_5a, 8, 10) + replace industrycat10 = 8 if inrange(d1_5a, 11, 14) + replace industrycat10 = 9 if d1_5a == 15 + replace industrycat10 = 10 if inrange(d1_5a, 16, 21) + 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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + + * 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) + *int_classif_universe, var(occup_isco) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + gen byte occup = . + 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_> + egen double wage_no_compen = rowtotal(d1_13a d1_15a), missing + replace wage_no_compen = . if lstatus != 1 | empstat == 2 | wage_no_compen == 0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + replace unitwage = . if mi(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 = d1_21a + replace whours = . if whours == 0 | 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 = 0 + replace contract = 1 if d1_7a == 1 | d1_7a == 2 + replace contract = . if lstatus != 1 + 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 firmsize_l = . + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen 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 = d1_7b + recode empstat_2 (2 3 = 1) (4 = 3) (5 6 8 = 4) (7 = 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 = d1_8b + recode ocusec_2 (2 = 1) (3/5 = 2) (0 = .) + replace ocusec_2 = . if mi(empstat_2) + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + decode d1_5b, 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 = "" + replace industrycat_isic_2 = "A" if d1_5b == 1 + replace industrycat_isic_2 = "B" if d1_5b == 2 + replace industrycat_isic_2 = "C" if d1_5b == 3 + replace industrycat_isic_2 = "D" if d1_5b == 4 + replace industrycat_isic_2 = "E" if d1_5b == 5 + replace industrycat_isic_2 = "F" if d1_5b == 6 + replace industrycat_isic_2 = "G" if d1_5b == 7 + replace industrycat_isic_2 = "H" if d1_5b == 8 + replace industrycat_isic_2 = "I" if d1_5b == 9 + replace industrycat_isic_2 = "J" if d1_5b == 10 + replace industrycat_isic_2 = "K" if d1_5b == 11 + replace industrycat_isic_2 = "L" if d1_5b == 12 + replace industrycat_isic_2 = "M" if d1_5b == 13 + replace industrycat_isic_2 = "N" if d1_5b == 14 + replace industrycat_isic_2 = "O" if d1_5b == 15 + replace industrycat_isic_2 = "P" if d1_5b == 16 + replace industrycat_isic_2 = "Q" if d1_5b == 17 + replace industrycat_isic_2 = "R" if d1_5b == 18 + replace industrycat_isic_2 = "S" if d1_5b == 19 + replace industrycat_isic_2 = "T" if d1_5b == 20 + replace industrycat_isic_2 = "U" if d1_5b == 21 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + replace industrycat10_2 = 1 if d1_5b == 1 + replace industrycat10_2 = 2 if d1_5b == 2 + replace industrycat10_2 = 3 if d1_5b == 3 + replace industrycat10_2 = 4 if inrange(d1_5b,4,5) + replace industrycat10_2 = 5 if d1_5b == 6 + replace industrycat10_2 = 6 if inlist(d1_5b, 7, 9) + replace industrycat10_2 = 7 if inlist(d1_5b, 8, 10) + replace industrycat10_2 = 8 if inrange(d1_5b, 11, 14) + replace industrycat10_2 = 9 if d1_5b == 15 + replace industrycat10_2 = 10 if inrange(d1_5b, 16, 21) + 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_> + egen double wage_no_compen_2 = rowtotal(d1_13b d1_15b), missing + replace wage_no_compen_2 = . if mi(empstat_2) | empstat_2 == 2 | wage_no_compen_2 == 0 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = 5 + replace unitwage_2 = . if mi(wage_no_compen_2) + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = d1_21b + replace whours_2 = . if whours_2 == 0 | mi(empstat_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 < minlaborage & age != . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year=. if age < minlaborage & 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 & 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 = . + 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_var "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 v of local lab_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `v'= "" 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 var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/ARM/ARM_2011_ILCS/ARM_2011_ILCS_V01_M_V01_A_GLD/Programs/ARM_2011_ILCS_V01_M_V01_A_GLD_ALL.do b/GLD/ARM/ARM_2011_ILCS/ARM_2011_ILCS_V01_M_V01_A_GLD/Programs/ARM_2011_ILCS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..9ea07ab49 --- /dev/null +++ b/GLD/ARM/ARM_2011_ILCS/ARM_2011_ILCS_V01_M_V01_A_GLD/Programs/ARM_2011_ILCS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1782 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> ARM_2011_ILCS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2024-09-11 + +------------------------------------------------------------------------- + +<_Country_> Armenia +<_Survey Title_> Integrated Living Conditions Survey +<_Survey Year_> 2011 +<_Study ID_> https://microdatalib.worldbank.org/index.php/catalog/2615 +<_Data collection from_> [MM/YYYY] +<_Data collection to_> [MM/YYYY] +<_Source of dataset_> [Source of data, e.g. NSO] +<_Sample size (HH)_> [#] +<_Sample size (IND)_> [#] +<_Sampling method_> [Brief description] +<_Geographic coverage_> [To what level is data significant] +<_Currency_> [Currency used for wages] + +----------------------------------------------------------------------- + +<_ICLS Version_> [Version of ICLS for Labor Questions] +<_ISCED Version_> [Version of ICLS for Labor Questions] +<_ISCO Version_> [Version of ICLS for Labor Questions] +<_OCCUP National_> [Version of ICLS for Labor Questions] +<_ISIC Version_> [Version of ICLS for Labor Questions] +<_INDUS National_> [Version of ICLS for Labor Questions] + +----------------------------------------------------------------------- +<_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 "Y:/GLD-Harmonization/529026_MG/Countries" +local country "ARM" +local year "2011" +local survey "ILCS" +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 + +* Check whether there is a weight file +local has_wf = fileexists("`path_in_stata'/Weight.dta") + +* Start with HH +use "`path_in_stata'/hh.dta" + +* If there is a weight file, merge it in +if `has_wf' { + merge 1:1 recno using "`path_in_stata'/Weight.dta", assert(match) nogen +} + +* Add member roster +merge 1:m recno using "`path_in_stata'/mem.dta", assert(match) nogen + +* Add employment section +merge 1:1 recno memnum using "`path_in_stata'/d1", assert(match master) nogen + +* Add number labels +numlabel, add force + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "ARM" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "ILCS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "GLD" + 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 = "" + 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_year= 2011 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month = date + label 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> + + Values are 1-5184 running. Would have preferred making it a string with 0001 to 5184, but leave as is since + GMD has it this way. For PID concatenate this with 01-12 but leave as is. + + */ + gen hhid = recno + label var hhid "Household ID" +* + + +*<_pid_> + gen pid = memnum + label var pid "Individual ID" +* + + +*<_weight_> + * Weight already exists + *gen weight = . + 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_> + * typev is 0 if YErevan, 1 if urban (other), rural is 2 + gen byte urban = inrange(typev, 0,1) + replace urban = 0 if typev == 2 + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + The variable is string and country-specific categorical. Numeric entries are coded in string format using the following naming convention: "1 – Hatay". That is, the variable itself is to be string, not a labelled numeric vector. + + Example of entries would be "1 - Alaska", "2 - Arkansas", ... + + */ + gen str subnatid1 = "" + replace subnatid1 = "1 - Yerevan" if marz == 1 + replace subnatid1 = "2 - Aragatsotn" if marz == 2 + replace subnatid1 = "3 - Ararat" if marz == 3 + replace subnatid1 = "4 - Armavir" if marz == 4 + replace subnatid1 = "5 - Gegharkunik" if marz == 5 + replace subnatid1 = "6 - Lori" if marz == 6 + replace subnatid1 = "7 - Kotayk" if marz == 7 + replace subnatid1 = "8 - Shirak" if marz == 8 + replace subnatid1 = "9 - Syunik" if marz == 9 + replace subnatid1 = "10 - Vayoc Dzor" if marz == 10 + replace subnatid1 = "11 - Tavush" if marz == 11 +* + + +*<_subnatid2_> + gen str 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 + + */ + decode urban, generate(helper) + generate subnatidsurvey = string(urban) + " - " + helper + drop helper + 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_> + * If keep all + gen hsize = members + /* * If drop absentees + gen helper = 1 + egen hh_abs_no = total(helper), by(recno) + replace hsize = hsize - hh_abs_no + drop helper hh_abs_no + */ + label var hsize "Household size" +* + + +*<_age_> + * Already in there + *gen age = . + label var age "Individual age" +* + + +*<_male_> + gen male = a1_1 + recode male (2 = 0) + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen relationharm = a1_2 + recode relationharm (4 = 3) (6 = 4) (7 = 5) (8 = 6) + 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_> + clonevar relationcs = a1_2 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = a1_5 + recode marital (3 = 5) (5 = 3) + 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 +==============================================================================================%%*/ + + +{ + +* Migration is not done as it is much more narrowly defined as migrated and returned. Thus anyone who +* migrated from their home town to the capital city would not be included. + +*<_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 = . + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + 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 = . + 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" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = . + *label de lblmigrated_from_code + *label values migrated_from_code lblmigrated_from_code + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = . + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + 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_> + +/* <_ed_mod_age_note> + +Education module is only asked to those 6 and older. + + */ + +gen byte ed_mod_age = 6 +label var ed_mod_age "Education module application age" + +* + +*<_school_> + gen byte school = 0 + replace school = 1 if e2_7 == 1 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = 1 + replace literacy = 0 if e2_2 == 0 + replace literacy = . if mi(e2_2) + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + * Number of years is a combination of level (e2_2) and years in that course (e2_3) + gen byte educy =. + replace educy = 0 if e2_2 == 0 + replace educy = e2_3 if e2_2 == 1 & inrange(e2_3,0,4) + replace educy = 4 + e2_3 if e2_2 == 2 & inrange(e2_3,0,5) + replace educy = 9 + e2_3 if e2_2 == 3 & inrange(e2_3,0,3) + replace educy = 9 + e2_3 if e2_2 == 4 & inrange(e2_3,0,2) + replace educy = 9 + e2_3 if e2_2 == 5 & inrange(e2_3,0,5) + replace educy = 12 + e2_3 if e2_2 == 6 & inrange(e2_3,0,7) + replace educy = 16 + e2_3 if e2_2 == 7 & inrange(e2_3,0,4) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7 =. + replace educat7 = 1 if e2_2 == 0 + replace educat7 = 2 if e2_2 == 1 & e2_3 < 4 + replace educat7 = 3 if e2_2 == 1 & e2_3 == 4 + replace educat7 = 4 if e2_2 == 2 + replace educat7 = 5 if inrange(e2_2, 3, 4) + replace educat7 = 6 if e2_2 == 5 + replace educat7 = 7 if inrange(e2_2, 6, 7) + 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", 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" + 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_> + clonevar educat_orig = e2_2 + 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_var "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach v of local ed_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `v'= "" 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 = 15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + * Logic is either have a job (yes to D1_1a) or returning (D1_2a) + * However the returning is subject to reasons (D1_3a) that are not + * a skip pattern but upon probing of the enumerator + * The below tab shows that some go to main job, others don't + * tab d1_3a d1_4a,m + gen byte lstatus = 1 if !mi(d1_4a) + + * For unemployed we need looking for a job (d2_5) and willing to accept (d2_10) + * Ensured all who looked answer the willing question + count if inrange(d2_5,1,2) & mi(d2_10) + assert `r(N)' == 0 + replace lstatus = 2 if lstatus == . & inrange(d2_5, 1, 2) & d2_10 == 1 + + * Normally, I would set all others to NLF, but given that we have the absentees, assign only to no in d2_5 + replace lstatus = 3 if lstatus == . & d2_5 == 3 + replace lstatus = 3 if lstatus == . & inrange(d2_5, 1, 2) & d2_10 == 2 + + replace lstatus = . if age < minlaborage + 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 = 0 + * Either not looking but would accept or looking but would not accept + replace potential_lf = 1 if (d2_5 == 3 & d2_10 == 1) | (inrange(d2_5,1,2) & d2_10 == 2) + replace potential_lf = . if age < minlaborage & 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 = 0 + replace underemployment = 1 if d1_24a == 7 + replace underemployment = . if age < minlaborage & 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=. + 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=. + replace unempldur_l = 0 if d2_9 == 1 + replace unempldur_l = 1 if d2_9 == 2 + replace unempldur_l = 4 if d2_9 == 3 + replace unempldur_l = 7 if d2_9 == 4 + replace unempldur_l = 13 if d2_9 == 5 + replace unempldur_l = 25 if d2_9 == 6 + replace unempldur_l = 49 if d2_9 == 7 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=. + replace unempldur_u = 1 if d2_9 == 1 + replace unempldur_u = 3 if d2_9 == 2 + replace unempldur_u = 6 if d2_9 == 3 + replace unempldur_u = 12 if d2_9 == 4 + replace unempldur_u = 24 if d2_9 == 5 + replace unempldur_u = 48 if d2_9 == 6 + replace unempldur_u = 999 if d2_9 == 7 + replace unempldur_u = . if lstatus != 2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat = d1_7a + recode empstat (2 3 = 1) (4 = 3) (5 6 8 = 4) (7 = 2) + 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 = d1_9a + recode ocusec (2 = 1) (3/5 = 2) + 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(d1_5a, "%02.0f") + replace industry_orig = "" if industry_orig == "." + 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 !mi(industry_orig) + + * 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) + int_classif_universe, var(industrycat_isic) universe(ISIC) + count + list + *assert `r(N)' == 0 + restore + + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = . + replace industrycat10 = 1 if inrange(industry_orig, "01", "03") + replace industrycat10 = 2 if inrange(industry_orig, "05", "09") + replace industrycat10 = 3 if inrange(industry_orig, "10", "33") + replace industrycat10 = 4 if inrange(industry_orig, "35", "39") + replace industrycat10 = 5 if inrange(industry_orig, "41", "43") + replace industrycat10 = 6 if inrange(industry_orig, "45", "47") | inrange(industry_orig, "55", "56") + replace industrycat10 = 7 if inrange(industry_orig, "49", "53") | inrange(industry_orig, "58", "63") + replace industrycat10 = 8 if inrange(industry_orig, "64", "82") + replace industrycat10 = 9 if inrange(industry_orig, "84", "84") + replace industrycat10 = 10 if inrange(industry_orig, "85", "99") + 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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + + * 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) + *int_classif_universe, var(occup_isco) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + gen byte occup = . + 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_> + egen double wage_no_compen = rowtotal(d1_14a d1_16a), missing + replace wage_no_compen = . if lstatus != 1 | empstat == 2 | wage_no_compen == 0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + replace unitwage = . if mi(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 = d1_22a + replace whours = . if whours == 0 | 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 = 0 + replace contract = 1 if d1_7a == 1 | d1_7a == 2 + replace contract = . if lstatus != 1 + 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 firmsize_l = . + replace firmsize_l = 1 if d1_11a == 1 + replace firmsize_l = 6 if d1_11a == 2 + replace firmsize_l = 16 if d1_11a == 3 + replace firmsize_l = 31 if d1_11a == 4 + replace firmsize_l = 50 if d1_11a == 5 + replace firmsize_l = 100 if d1_11a == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_l = 100 if ocusec == 1 & mi(firmsize_l) + + replace firmsize_l = . if lstatus != 1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen firmsize_u= . + replace firmsize_u = 5 if d1_11a == 1 + replace firmsize_u = 15 if d1_11a == 2 + replace firmsize_u = 30 if d1_11a == 3 + replace firmsize_u = 49 if d1_11a == 4 + replace firmsize_u = 99 if d1_11a == 5 + replace firmsize_u = 9999 if d1_11a == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_u = 9999 if ocusec == 1 & mi(firmsize_u) + + 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 = d1_7b + recode empstat_2 (2 3 = 1) (4 = 3) (5 6 8 = 4) (7 = 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 = d1_9b + recode ocusec_2 (2 = 1) (3/5 = 2) (0 = .) + replace ocusec_2 = . if mi(empstat_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(d1_5b, "%02.0f") + replace industry_orig_2 = "" if industry_orig_2 == "." + replace industry_orig_2 = "" if industry_orig_2 == "00" + replace industry_orig_2 = "" if mi(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 !mi(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + replace industrycat10_2 = 1 if inrange(industry_orig_2, "01", "03") + replace industrycat10_2 = 2 if inrange(industry_orig_2, "05", "09") + replace industrycat10_2 = 3 if inrange(industry_orig_2, "10", "33") + replace industrycat10_2 = 4 if inrange(industry_orig_2, "35", "39") + replace industrycat10_2 = 5 if inrange(industry_orig_2, "41", "43") + replace industrycat10_2 = 6 if inrange(industry_orig_2, "45", "47") | inrange(industry_orig_2, "55", "56") + replace industrycat10_2 = 7 if inrange(industry_orig_2, "49", "53") | inrange(industry_orig_2, "58", "63") + replace industrycat10_2 = 8 if inrange(industry_orig_2, "64", "82") + replace industrycat10_2 = 9 if inrange(industry_orig_2, "84", "84") + replace industrycat10_2 = 10 if inrange(industry_orig_2, "85", "99") + 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_> + egen double wage_no_compen_2 = rowtotal(d1_14b d1_16b), missing + replace wage_no_compen_2 = . if mi(empstat_2) | empstat_2 == 2 | wage_no_compen_2 == 0 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = 5 + replace unitwage_2 = . if mi(wage_no_compen_2) + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = d1_22b + replace whours_2 = . if whours_2 == 0 | mi(empstat_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 = . + replace firmsize_l_2 = 1 if d1_11b == 1 + replace firmsize_l_2 = 6 if d1_11b == 2 + replace firmsize_l_2 = 16 if d1_11b == 3 + replace firmsize_l_2 = 31 if d1_11b == 4 + replace firmsize_l_2 = 50 if d1_11b == 5 + replace firmsize_l_2 = 100 if d1_11b == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_l_2 = 100 if ocusec_2 == 1 & mi(firmsize_l_2) + + replace firmsize_l_2 = . if mi(empstat_2) + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + replace firmsize_u_2 = 5 if d1_11b == 1 + replace firmsize_u_2 = 15 if d1_11b == 2 + replace firmsize_u_2 = 30 if d1_11b == 3 + replace firmsize_u_2 = 49 if d1_11b == 4 + replace firmsize_u_2 = 99 if d1_11b == 5 + replace firmsize_u_2 = 9999 if d1_11b == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_u_2 = 9999 if ocusec_2 == 1 & mi(firmsize_u_2) + + replace firmsize_u_2 = . if mi(empstat_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 < minlaborage & age != . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year=. if age < minlaborage & 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 & 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 = . + 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_var "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 v of local lab_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `v'= "" 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 var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/ARM/ARM_2012_ILCS/ARM_2012_ILCS_V01_M_V01_A_GLD/Programs/ARM_2012_ILCS_V01_M_V01_A_GLD_ALL.do b/GLD/ARM/ARM_2012_ILCS/ARM_2012_ILCS_V01_M_V01_A_GLD/Programs/ARM_2012_ILCS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..368a0bdbc --- /dev/null +++ b/GLD/ARM/ARM_2012_ILCS/ARM_2012_ILCS_V01_M_V01_A_GLD/Programs/ARM_2012_ILCS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1818 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> ARM_2012_ILCS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2024-09-11 + +------------------------------------------------------------------------- + +<_Country_> Armenia +<_Survey Title_> Integrated Living Conditions Survey +<_Survey Year_> 2012 +<_Study ID_> https://microdatalib.worldbank.org/index.php/catalog/2615 +<_Data collection from_> [MM/YYYY] +<_Data collection to_> [MM/YYYY] +<_Source of dataset_> [Source of data, e.g. NSO] +<_Sample size (HH)_> [#] +<_Sample size (IND)_> [#] +<_Sampling method_> [Brief description] +<_Geographic coverage_> [To what level is data significant] +<_Currency_> [Currency used for wages] + +----------------------------------------------------------------------- + +<_ICLS Version_> [Version of ICLS for Labor Questions] +<_ISCED Version_> [Version of ICLS for Labor Questions] +<_ISCO Version_> [Version of ICLS for Labor Questions] +<_OCCUP National_> [Version of ICLS for Labor Questions] +<_ISIC Version_> [Version of ICLS for Labor Questions] +<_INDUS National_> [Version of ICLS for Labor Questions] + +----------------------------------------------------------------------- +<_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 "Y:/GLD-Harmonization/529026_MG/Countries" +local country "ARM" +local year "2012" +local survey "ILCS" +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 + +* Check whether there is a weight file +local has_wf = fileexists("`path_in_stata/weight.dta'") + +* Start with HH +use "`path_in_stata'/hh.dta" + +* If there is a weight file, merge it in +if `has_wf' { + merge 1:1 recno using "`path_in_stata/weight.dta'", assert(match) nogen +} + +* Add member roster +merge 1:m recno using "`path_in_stata'/mem.dta", assert(match) nogen + +* Add employment section +merge 1:1 recno memnum using "`path_in_stata'/d1", assert(match master) nogen + +* Add number labels +numlabel, add force + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "ARM" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "ILCS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "GLD" + 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 = "" + 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_year= 2012 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month = date + label 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> + + Values are 1-5184 running. Would have preferred making it a string with 0001 to 5184, but leave as is since + GMD has it this way. For PID concatenate this with 01-12 but leave as is. + + */ + gen hhid = recno + label var hhid "Household ID" +* + + +*<_pid_> + gen pid = memnum + label var pid "Individual ID" +* + + +*<_weight_> + *gen weight = . + 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_> + +/* <_psu_note> + + We have (at the moment) no documentation on 2012. The variable PSU only has 9 distinct values, roughtly equal + (each number is ~2,200). If you look at the start (list in 1/20) you can see it aligns with the households + (where recno's 1 to 9 are equal to psu, then with recno's 10-18 it is 1-9 again and so forth). It further + aligns with the weights (that is, a block of PSUs has a different weight). It thus seems that PSU does not + directly denote the PSU but rather the numbering of the HHs within the PSU (where 9 HHs are interviewed per + PSU). In 2009, when we do have an accurate PSU (and a methodology text to confirm this) they had always 8 HHs + per PSU. It seems most plausible that this is the case. hence we use the ordering to create a PSU + + */ + + * Sort by recno and memnum (as data is in file already, just in case) to have the order of 9 households/block + rename psu PSU + sort recno memnum + + * Generate a new variable to identify PSUs + gen psu = . + + * Initialize the block counter + local psu_counter = 0 + + * Loop through the data to identify the start of each block + forvalues i = 1/`=_N' { + if PSU[`i'] == 1 & (PSU[`i'-1] != 1 | `i' == 1) { + local psu_counter = `psu_counter' + 1 + } + quietly : replace psu = `psu_counter' if _n == `i' + } + + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = recno + 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_> + * typev is 0 if Yerevan, 1 if urban (other), rural is 2 + gen byte urban = inrange(typev, 0,1) + replace urban = 0 if typev == 2 + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + The variable is string and country-specific categorical. Numeric entries are coded in string format using the following naming convention: "1 – Hatay". That is, the variable itself is to be string, not a labelled numeric vector. + + Example of entries would be "1 - Alaska", "2 - Arkansas", ... + + */ + gen str subnatid1 = "" + replace subnatid1 = "1 - Yerevan" if marz == 1 + replace subnatid1 = "2 - Aragatsotn" if marz == 2 + replace subnatid1 = "3 - Ararat" if marz == 3 + replace subnatid1 = "4 - Armavir" if marz == 4 + replace subnatid1 = "5 - Gegharkunik" if marz == 5 + replace subnatid1 = "6 - Lori" if marz == 6 + replace subnatid1 = "7 - Kotayk" if marz == 7 + replace subnatid1 = "8 - Shirak" if marz == 8 + replace subnatid1 = "9 - Syunik" if marz == 9 + replace subnatid1 = "10 - Vayoc Dzor" if marz == 10 + replace subnatid1 = "11 - Tavush" if marz == 11 +* + + +*<_subnatid2_> + gen str 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 + + */ + decode urban, generate(helper) + generate subnatidsurvey = string(urban) + " - " + helper + drop helper + 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_> + * If keep all + gen hsize = members + /* * If drop absentees + gen helper = 1 + egen hh_abs_no = total(helper), by(recno) + replace hsize = hsize - hh_abs_no + drop helper hh_abs_no + */ + label var hsize "Household size" +* + + + +*<_age_> + * Already in there + *gen age = . + label var age "Individual age" +* + + +*<_male_> + gen male = a1_1 + recode male (2 = 0) + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen relationharm = a1_2 + recode relationharm (4 = 3) (6 = 4) (7 = 5) (8 = 6) + 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_> + clonevar relationcs = a1_2 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = a1_5 + recode marital (3 = 5) (5 = 3) + 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 +==============================================================================================%%*/ + + +{ + +* Migration is not done as it is much more narrowly defined as migrated and returned. Thus anyone who +* migrated from their home town to the capital city would not be included. + + +*<_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 = . + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + 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 = . + 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" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = . + *label de lblmigrated_from_code + *label values migrated_from_code lblmigrated_from_code + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = . + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + 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_> + +/* <_ed_mod_age_note> + +Education module is only asked to those XX and older. + + */ + +gen byte ed_mod_age = 6 +label var ed_mod_age "Education module application age" + +* + +*<_school_> + gen byte school = 0 + replace school = 1 if e2_7 == 1 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = 1 + replace literacy = 0 if e2_2 == 0 + replace literacy = . if mi(e2_2) + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + * Number of years is a combination of level (e2_2) and years in that course (e2_3) + gen byte educy =. + replace educy = 0 if e2_2 == 0 + replace educy = e2_3 if e2_2 == 1 & inrange(e2_3,0,4) + replace educy = 4 + e2_3 if e2_2 == 2 & inrange(e2_3,0,5) + replace educy = 9 + e2_3 if e2_2 == 3 & inrange(e2_3,0,3) + replace educy = 9 + e2_3 if e2_2 == 4 & inrange(e2_3,0,2) + replace educy = 9 + e2_3 if e2_2 == 5 & inrange(e2_3,0,5) + replace educy = 12 + e2_3 if e2_2 == 6 & inrange(e2_3,0,7) + replace educy = 16 + e2_3 if e2_2 == 7 & inrange(e2_3,0,4) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7 =. + replace educat7 = 1 if e2_2 == 0 + replace educat7 = 2 if e2_2 == 1 & e2_3 < 4 + replace educat7 = 3 if e2_2 == 1 & e2_3 == 4 + replace educat7 = 4 if e2_2 == 2 + replace educat7 = 5 if inrange(e2_2, 3, 4) + replace educat7 = 6 if e2_2 == 5 + replace educat7 = 7 if inrange(e2_2, 6, 7) + 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", 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" + 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_> + clonevar educat_orig = e2_2 + 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_var "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach v of local ed_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `v'= "" 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 = 15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +*<_lstatus_> + + * Logic is either have a job (yes to D1_1a) or returning (D1_2a) + * However the returning is subject to reasons (D1_3a) that are not + * a skip pattern but upon probing of the enumerator + * The below tab shows that some go to main job, others don't + * tab d1_3a d1_4a,m + gen byte lstatus = 1 if !mi(d1_4a) + + * For unemployed we need looking for a job (d2_5) and willing to accept (d2_10) + * Ensured all who looked answer the willing question + count if inrange(d2_5,1,2) & mi(d2_10) + assert `r(N)' == 0 + replace lstatus = 2 if lstatus == . & inrange(d2_5, 1, 2) & d2_10 == 1 + + * Normally, I would set all others to NLF, but given that we have the absentees, assign only to no in d2_5 + replace lstatus = 3 if lstatus == . & d2_5 == 3 + replace lstatus = 3 if lstatus == . & inrange(d2_5, 1, 2) & d2_10 == 2 + + replace lstatus = . if age < minlaborage + 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 = 0 + * Either not looking but would accept or looking but would not accept + replace potential_lf = 1 if (d2_5 == 3 & d2_10 == 1) | (inrange(d2_5,1,2) & d2_10 == 2) + replace potential_lf = . if age < minlaborage & 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 = 0 + replace underemployment = 1 if d1_24a == 7 + replace underemployment = . if age < minlaborage & 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=. + 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=. + replace unempldur_l = 0 if d2_9 == 1 + replace unempldur_l = 1 if d2_9 == 2 + replace unempldur_l = 4 if d2_9 == 3 + replace unempldur_l = 7 if d2_9 == 4 + replace unempldur_l = 13 if d2_9 == 5 + replace unempldur_l = 25 if d2_9 == 6 + replace unempldur_l = 49 if d2_9 == 7 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=. + replace unempldur_u = 1 if d2_9 == 1 + replace unempldur_u = 3 if d2_9 == 2 + replace unempldur_u = 6 if d2_9 == 3 + replace unempldur_u = 12 if d2_9 == 4 + replace unempldur_u = 24 if d2_9 == 5 + replace unempldur_u = 48 if d2_9 == 6 + replace unempldur_u = 999 if d2_9 == 7 + replace unempldur_u = . if lstatus != 2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat = d1_7a + recode empstat (2 3 = 1) (4 = 3) (5 6 8 = 4) (7 = 2) + 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 = d1_9a + recode ocusec (2 = 1) (3/5 = 2) + 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(d1_5a, "%02.0f") + replace industry_orig = "" if industry_orig == "." + 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 !mi(industry_orig) + + * 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) + int_classif_universe, var(industrycat_isic) universe(ISIC) + count + list + *assert `r(N)' == 0 + restore + + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = . + replace industrycat10 = 1 if inrange(industry_orig, "01", "03") + replace industrycat10 = 2 if inrange(industry_orig, "05", "09") + replace industrycat10 = 3 if inrange(industry_orig, "10", "33") + replace industrycat10 = 4 if inrange(industry_orig, "35", "39") + replace industrycat10 = 5 if inrange(industry_orig, "41", "43") + replace industrycat10 = 6 if inrange(industry_orig, "45", "47") | inrange(industry_orig, "55", "56") + replace industrycat10 = 7 if inrange(industry_orig, "49", "53") | inrange(industry_orig, "58", "63") + replace industrycat10 = 8 if inrange(industry_orig, "64", "82") + replace industrycat10 = 9 if inrange(industry_orig, "84", "84") + replace industrycat10 = 10 if inrange(industry_orig, "85", "99") + 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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + + +*<_occup_isco_> + gen occup_isco = "" + + * 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) + *int_classif_universe, var(occup_isco) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + gen byte occup = . + 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_> + egen double wage_no_compen = rowtotal(d1_14a d1_16a), missing + replace wage_no_compen = . if lstatus != 1 | empstat == 2 | wage_no_compen == 0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + replace unitwage = . if mi(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 = d1_22a + replace whours = . if whours == 0 | 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 = 0 + replace contract = 1 if d1_7a == 1 | d1_7a == 2 + replace contract = . if lstatus != 1 + 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 firmsize_l = . + replace firmsize_l = 1 if d1_11a == 1 + replace firmsize_l = 6 if d1_11a == 2 + replace firmsize_l = 16 if d1_11a == 3 + replace firmsize_l = 31 if d1_11a == 4 + replace firmsize_l = 50 if d1_11a == 5 + replace firmsize_l = 100 if d1_11a == 6 + + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_l = 100 if ocusec == 1 & mi(firmsize_l) + + replace firmsize_l = . if lstatus != 1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen firmsize_u= . + replace firmsize_u = 5 if d1_11a == 1 + replace firmsize_u = 15 if d1_11a == 2 + replace firmsize_u = 30 if d1_11a == 3 + replace firmsize_u = 49 if d1_11a == 4 + replace firmsize_u = 99 if d1_11a == 5 + replace firmsize_u = 9999 if d1_11a == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_u = 9999 if ocusec == 1 & mi(firmsize_u) + + 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 = d1_7b + recode empstat_2 (2 3 = 1) (4 = 3) (5 6 8 = 4) (7 = 2) (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 = d1_9b + recode ocusec_2 (2 = 1) (3/5 = 2) (0 = .) + replace ocusec_2 = . if mi(empstat_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(d1_5b, "%02.0f") + replace industry_orig_2 = "" if industry_orig_2 == "." + replace industry_orig_2 = "" if industry_orig_2 == "00" + replace industry_orig_2 = "" if mi(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 !mi(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + replace industrycat10_2 = 1 if inrange(industry_orig_2, "01", "03") + replace industrycat10_2 = 2 if inrange(industry_orig_2, "05", "09") + replace industrycat10_2 = 3 if inrange(industry_orig_2, "10", "33") + replace industrycat10_2 = 4 if inrange(industry_orig_2, "35", "39") + replace industrycat10_2 = 5 if inrange(industry_orig_2, "41", "43") + replace industrycat10_2 = 6 if inrange(industry_orig_2, "45", "47") | inrange(industry_orig_2, "55", "56") + replace industrycat10_2 = 7 if inrange(industry_orig_2, "49", "53") | inrange(industry_orig_2, "58", "63") + replace industrycat10_2 = 8 if inrange(industry_orig_2, "64", "82") + replace industrycat10_2 = 9 if inrange(industry_orig_2, "84", "84") + replace industrycat10_2 = 10 if inrange(industry_orig_2, "85", "99") + 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_> + egen double wage_no_compen_2 = rowtotal(d1_14b d1_16b), missing + replace wage_no_compen_2 = . if mi(empstat_2) | empstat_2 == 2 | wage_no_compen_2 == 0 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = 5 + replace unitwage_2 = . if mi(wage_no_compen_2) + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = d1_22b + replace whours_2 = . if whours_2 == 0 | mi(empstat_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 = . + replace firmsize_l_2 = 1 if d1_11b == 1 + replace firmsize_l_2 = 6 if d1_11b == 2 + replace firmsize_l_2 = 16 if d1_11b == 3 + replace firmsize_l_2 = 31 if d1_11b == 4 + replace firmsize_l_2 = 50 if d1_11b == 5 + replace firmsize_l_2 = 100 if d1_11b == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_l_2 = 100 if ocusec_2 == 1 & mi(firmsize_l_2) + + replace firmsize_l_2 = . if mi(empstat_2) + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + replace firmsize_u_2 = 5 if d1_11b == 1 + replace firmsize_u_2 = 15 if d1_11b == 2 + replace firmsize_u_2 = 30 if d1_11b == 3 + replace firmsize_u_2 = 49 if d1_11b == 4 + replace firmsize_u_2 = 99 if d1_11b == 5 + replace firmsize_u_2 = 9999 if d1_11b == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_u_2 = 9999 if ocusec_2 == 1 & mi(firmsize_u_2) + + replace firmsize_u_2 = . if mi(empstat_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 < minlaborage & age != . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year=. if age < minlaborage & 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 & 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 = . + 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_var "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 v of local lab_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `v'= "" 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 var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/GLD/ARM/ARM_2013_ILCS/ARM_2013_ILCS_V01_M_V01_A_GLD/Programs/ARM_2013_ILCS_V01_M_V01_A_GLD_ALL.do b/GLD/ARM/ARM_2013_ILCS/ARM_2013_ILCS_V01_M_V01_A_GLD/Programs/ARM_2013_ILCS_V01_M_V01_A_GLD_ALL.do new file mode 100644 index 000000000..152cbc836 --- /dev/null +++ b/GLD/ARM/ARM_2013_ILCS/ARM_2013_ILCS_V01_M_V01_A_GLD/Programs/ARM_2013_ILCS_V01_M_V01_A_GLD_ALL.do @@ -0,0 +1,1904 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +==============================================================================================%%*/ + +/* ----------------------------------------------------------------------- + +<_Program name_> ARM_2013_ILCS_V01_M_V01_A_GLD_ALL.do +<_Application_> Stata 18 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2024-09-11 + +------------------------------------------------------------------------- + +<_Country_> Armenia +<_Survey Title_> Integrated Living Conditions Survey +<_Survey Year_> 2013 +<_Study ID_> https://microdatalib.worldbank.org/index.php/catalog/2615 +<_Data collection from_> [MM/YYYY] +<_Data collection to_> [MM/YYYY] +<_Source of dataset_> [Source of data, e.g. NSO] +<_Sample size (HH)_> [#] +<_Sample size (IND)_> [#] +<_Sampling method_> [Brief description] +<_Geographic coverage_> [To what level is data significant] +<_Currency_> [Currency used for wages] + +----------------------------------------------------------------------- + +<_ICLS Version_> [Version of ICLS for Labor Questions] +<_ISCED Version_> [Version of ICLS for Labor Questions] +<_ISCO Version_> [Version of ICLS for Labor Questions] +<_OCCUP National_> [Version of ICLS for Labor Questions] +<_ISIC Version_> [Version of ICLS for Labor Questions] +<_INDUS National_> [Version of ICLS for Labor Questions] + +----------------------------------------------------------------------- +<_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 "Y:/GLD-Harmonization/529026_MG/Countries" +local country "ARM" +local year "2013" +local survey "ILCS" +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 + +* Check whether there is a weight file +local has_wf = fileexists("`path_in_stata/weight.dta'") + +* Start with HH +use "`path_in_stata'/hh.dta" + +* If there is a weight file, merge it in +if `has_wf' { + merge 1:1 recno using "`path_in_stata/weight.dta'", assert(match) nogen +} + +* Add member roster +merge 1:m recno using "`path_in_stata'/mem.dta", assert(match) nogen + +* Add employment section +merge 1:1 recno memnum using "`path_in_stata'/d1", assert(match master) nogen + +* Add number labels +numlabel, add force + +/* + +There is an issue with the data. When merging, there are 1,329 individuals who should have answers to +section d1 (employment section for those aged 15 to 75 - inclusive) but do not merge + +gen miss_emp = inrange(age,15,75) & mi(d1_1a) + +Additionally, there are 229 individuals who answer no to the first question but then have the follow up missing. + +gen wrong_emp = inrange(age,15,75) & mi(d1_2a) & d1_1a == 2 + +Note that these all respond to the unemployment question (d2_1) with "Compulsory military" + +If we make a variable that contains either case + +gen either = miss_emp | wrong_emp + +and compare this to the people who state that they have been missing from the household (a1_7) we get the following + + . tab either a1_7 if inrange(age,15,75),m + + | If during the whole survey month + | some members of the household + | are absent, then + either | 1. .up to 2. 3 mont . | Total + -----------+---------------------------------+---------- + 0 | 1 0 13,500 | 13,501 + 1 | 299 1,252 7 | 1,558 + -----------+---------------------------------+---------- + Total | 300 1,252 13,507 | 15,059 + + . + . + . tab either a1_7 if inrange(age,15,75),m col nofreq + + | If during the whole survey month + | some members of the household + | are absent, then + either | 1. .up to 2. 3 mont . | Total + -----------+---------------------------------+---------- + 0 | 0.33 0.00 99.95 | 89.65 + 1 | 99.67 100.00 0.05 | 10.35 + -----------+---------------------------------+---------- + Total | 100.00 100.00 100.00 | 100.00 + +As can be seen, nearly all cases where employment is missing are the cases where people are declared absent. + +The full dataset contains 19,831 individuals. If the people absent are dropped we get to 18,200. The ILO dataset states +has 18,196 rows (https://webapps.ilo.org/surveyLib/index.php/catalog/6540/data-dictionary/FA_ARM_HILCS_2013_FULL?file_name=ARM_HILCS_2013_FULL - they call is "cases") + +Hence it would seem that they have trimmed these cases. + +However, the population numbers do not align. + +Total population for the full 19,831 is 3,127,434 +Total population accroding to WB Data is 2,901,385 (https://data.worldbank.org/indicator/SP.POP.TOTL?locations=AM) +Total + +ILOSTAT has working age pop 15+ + +The full dataset for 15+ gives us 2,560,389 +The reduced (not absent) 15+ is 2,336,590 +ILOSTAT has (same source claimed) 2,155,400 (https://rshiny.ilo.org/dataexplorer56/?lang=en&id=POP_XWAP_SEX_AGE_GEO_NB_A) + +So despite being very close in the number of observations between non-absent and ILO, the weighted numbers are different. + +The data from the ARMStat site (https://armstat.am/en/?nid=965) is for the LFS series. +A bit confusing but the data from 2008 to 2013 is actually from ILCS so we may compare it + +There they use the concept of "permanent/resident" population which excludes the absentees. +Without them the numbers agree (exxcept for small disagreements between unemployed and NLF) + +Hence drop absentees from data +*/ +*drop if !mi(a1_7) + + +/*%%============================================================================================= + 2: Survey & ID +==============================================================================================%%*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "ARM" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "ILCS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "GLD" + 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 = "" + 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 = 2013 + 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_year= 2013 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month = date + label 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> + + Values are 1-5184 running. Would have preferred making it a string with 0001 to 5184, but leave as is since + GMD has it this way. For PID concatenate this with 01-12 but leave as is. + + */ + gen hhid = recno + label var hhid "Household ID" +* + + +*<_pid_> + gen pid = memnum + label var pid "Individual ID" +* + + +*<_weight_> + *gen weight = weight + 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_> + +/* <_psu_note> + + We have (at the moment) no documentation on 2013. The variable PSU only has 9 distinct values, roughtly equal + (each number is ~2,200). If you look at the start (list in 1/20) you can see it aligns with the households + (where recno's 1 to 9 are equal to psu, then with recno's 10-18 it is 1-9 again and so forth). It further + aligns with the weights (that is, a block of PSUs has a different weight). It thus seems that PSU does not + directly denote the PSU but rather the numbering of the HHs within the PSU (where 9 HHs are interviewed per + PSU). In 2009, when we do have an accurate PSU (and a methodology text to confirm this) they had always 8 HHs + per PSU. It seems most plausible that this is the case. hence we use the ordering to create a PSU + + */ + + * Sort by recno and memnum (as data is in file already, just in case) to have the order of 9 households/block + sort recno memnum + + * Generate a new variable to identify PSUs + gen psu = . + + * Initialize the block counter + local psu_counter = 0 + + * Loop through the data to identify the start of each block + forvalues i = 1/`=_N' { + if PSU[`i'] == 1 & (PSU[`i'-1] != 1 | `i' == 1) { + local psu_counter = `psu_counter' + 1 + } + quietly : replace psu = `psu_counter' if _n == `i' + } + + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = recno + 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_> + +* There seems to be visit no info in the questionnaire, but nothing in the data, cannot confirm, leave missing + gen visit_no = . + label var visit_no "Visit number in panel" +* + +} + + +/*%%============================================================================================= + 3: Geography +==============================================================================================%%*/ + +{ + +*<_urban_> + * typev is 0 if Yerevan, 1 if urban (other), rural is 2 + gen byte urban = inrange(typev, 0,1) + replace urban = 0 if typev == 2 + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + The variable is string and country-specific categorical. Numeric entries are coded in string format using the following naming convention: "1 – Hatay". That is, the variable itself is to be string, not a labelled numeric vector. + + Example of entries would be "1 - Alaska", "2 - Arkansas", ... + + */ + gen str subnatid1 = "" + replace subnatid1 = "1 - Yerevan" if marz == 1 + replace subnatid1 = "2 - Aragatsotn" if marz == 2 + replace subnatid1 = "3 - Ararat" if marz == 3 + replace subnatid1 = "4 - Armavir" if marz == 4 + replace subnatid1 = "5 - Gegharkunik" if marz == 5 + replace subnatid1 = "6 - Lori" if marz == 6 + replace subnatid1 = "7 - Kotayk" if marz == 7 + replace subnatid1 = "8 - Shirak" if marz == 8 + replace subnatid1 = "9 - Syunik" if marz == 9 + replace subnatid1 = "10 - Vayoc Dzor" if marz == 10 + replace subnatid1 = "11 - Tavush" if marz == 11 +* + + +*<_subnatid2_> + gen str 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 + + */ + decode urban, generate(helper) + generate subnatidsurvey = string(urban) + " - " + helper + drop helper + 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_> + * If keep all + gen hsize = members + /* * If drop absentees + gen helper = 1 + egen hh_abs_no = total(helper), by(recno) + replace hsize = hsize - hh_abs_no + drop helper hh_abs_no + */ + label var hsize "Household size" +* + + +*<_age_> + * Already in there + *gen age = . + label var age "Individual age" +* + + +*<_male_> + gen male = a1_1 + recode male (2 = 0) + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen relationharm = a1_2 + recode relationharm (4 = 3) (6 = 4) (7 = 5) (8 = 6) + 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_> + clonevar relationcs = a1_2 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = a1_5 + recode marital (3 = 5) (5 = 3) + 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 +==============================================================================================%%*/ + + +{ + +* Migration is not done as it is much more narrowly defined as migrated and returned. Thus anyone who +* migrated from their home town to the capital city would not be included. For example, while 31% of the +* population is in Yerevan, only 22% of migrants are. + +*<_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 = . + label var migrated_years "Years since latest migration" +* + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + 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 = . + 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" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code = . + *label de lblmigrated_from_code + *label values migrated_from_code lblmigrated_from_code + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + gen migrated_from_country = . + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason = . + 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 +==============================================================================================%%*/ + +* Education looks tricky. There are responses in the HH roster section (a1_9) +* and in a separate education section (e2). They do not agree 100% - odd +* Information about the education system to confirm the data is from +* https://www.aacrao.org/edge/country/armenia and +* https://www.unicef.org/armenia/media/15496/file/Education%20Sector%20Analysis%20for%20Armenia.pdf +* visited in September 2024 + +{ + +*<_ed_mod_age_> + +/* <_ed_mod_age_note> + +Education module is only asked to those XX and older. + + */ + +gen byte ed_mod_age = 6 +label var ed_mod_age "Education module application age" + +* + +*<_school_> + gen byte school = 0 + replace school = 1 if e2_7 == 1 + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = 1 + replace literacy = 0 if e2_2 == 0 + replace literacy = . if mi(e2_2) + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + * Number of years is a combination of level (e2_2) and years in that course (e2_3) + gen byte educy =. + replace educy = 0 if e2_2 == 0 + replace educy = e2_3 if e2_2 == 1 & inrange(e2_3,0,4) + replace educy = 4 + e2_3 if e2_2 == 2 & inrange(e2_3,0,5) + replace educy = 9 + e2_3 if e2_2 == 3 & inrange(e2_3,0,3) + replace educy = 9 + e2_3 if e2_2 == 4 & inrange(e2_3,0,2) + replace educy = 9 + e2_3 if e2_2 == 5 & inrange(e2_3,0,5) + replace educy = 12 + e2_3 if e2_2 == 6 & inrange(e2_3,0,7) + replace educy = 16 + e2_3 if e2_2 == 7 & inrange(e2_3,0,4) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7 =. + replace educat7 = 1 if e2_2 == 0 + replace educat7 = 2 if e2_2 == 1 & e2_3 < 4 + replace educat7 = 3 if e2_2 == 1 & e2_3 == 4 + replace educat7 = 4 if e2_2 == 2 + replace educat7 = 5 if inrange(e2_2, 3, 4) + replace educat7 = 6 if e2_2 == 5 + replace educat7 = 7 if inrange(e2_2, 6, 7) + 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", 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" + 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_> + clonevar educat_orig = e2_2 + 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_var "school literacy educy educat7 educat5 educat4 educat_orig educat_isced" + +foreach v of local ed_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < ed_mod_age & !missing(age) ) + } + else { // is not + replace `v'= "" 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 = 15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + + * Logic is either have a job (yes to D1_1a) or returning (D1_2a) + * However the returning is subject to reasons (D1_3a) that are not + * a skip pattern but upon probing of the enumerator + * The below tab shows that some go to main job, others don't + * tab d1_3a d1_4a,m + gen byte lstatus = 1 if !mi(d1_4a) + + * For unemployed we need looking for a job (d2_5) and willing to accept (d2_9) + * Ensured all who looked answer the willing question + count if inrange(d2_5,1,2) & mi(d2_9) + assert `r(N)' == 0 + replace lstatus = 2 if lstatus == . & inrange(d2_5, 1, 2) & d2_9 == 1 + + * Normally, I would set all others to NLF, but given that we have the absentees, assign only to no in d2_5 + replace lstatus = 3 if lstatus == . & d2_5 == 3 + replace lstatus = 3 if lstatus == . & inrange(d2_5, 1, 2) & d2_9 == 2 + + replace lstatus = . if age < minlaborage + 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 = 0 + * Either not looking but would accept or looking but would not accept + replace potential_lf = 1 if (d2_5 == 3 & d2_9 == 1) | (inrange(d2_5,1,2) & d2_9 == 2) + replace potential_lf = . if age < minlaborage & 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 = 0 + replace underemployment = 1 if d1_24a == 7 + replace underemployment = . if age < minlaborage & 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 = . + 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 = . + replace unempldur_l = 0 if d2_8 == 1 + replace unempldur_l = 3 if d2_8 == 2 + replace unempldur_l = 12 if d2_8 == 3 + replace unempldur_l = 24 if d2_8 == 4 + replace unempldur_l = 48 if d2_8 == 5 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=. + replace unempldur_u = 3 if d2_8 == 1 + replace unempldur_u = 12 if d2_8 == 2 + replace unempldur_u = 24 if d2_8 == 3 + replace unempldur_u = 48 if d2_8 == 4 + replace unempldur_u = 9999 if d2_8 == 5 + replace unempldur_u = . if lstatus != 2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + gen byte empstat = d1_7a + recode empstat (2 = 1) (5 = 4) (6 = 2) + 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 = d1_9a + recode ocusec (2 = 1) (3/5 = 2) + 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(d1_5a, "%02.0f") + replace industry_orig = "" if industry_orig == "." + 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 !mi(industry_orig) + + * 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) + int_classif_universe, var(industrycat_isic) universe(ISIC) + count + list + *assert `r(N)' == 0 + restore + + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = . + replace industrycat10 = 1 if inrange(industry_orig, "01", "03") + replace industrycat10 = 2 if inrange(industry_orig, "05", "09") + replace industrycat10 = 3 if inrange(industry_orig, "10", "33") + replace industrycat10 = 4 if inrange(industry_orig, "35", "39") + replace industrycat10 = 5 if inrange(industry_orig, "41", "43") + replace industrycat10 = 6 if inrange(industry_orig, "45", "47") | inrange(industry_orig, "55", "56") + replace industrycat10 = 7 if inrange(industry_orig, "49", "53") | inrange(industry_orig, "58", "63") + replace industrycat10 = 8 if inrange(industry_orig, "64", "82") + replace industrycat10 = 9 if inrange(industry_orig, "84", "84") + replace industrycat10 = 10 if inrange(industry_orig, "85", "99") + 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 = d1_6a + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + + * 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) + *int_classif_universe, var(occup_isco) universe(ISCO) + count + *list + *assert `r(N)' == 0 + restore + + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + gen byte occup = d1_6a + recode occup (51 52 = 5) (99 = 10) + 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_> + egen double wage_no_compen = rowtotal(d1_14a d1_16a), missing + replace wage_no_compen = . if lstatus != 1 | empstat == 2 | wage_no_compen == 0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + +/* <_unitwage_note> + Unitwage refers to the unit used to record wage_no_compen, *not* the unit of + general wage payent. For example, PHL LFS asks about wage periodicity, then + asks for basic daily pay. The value of that pay would be wage_no_compen, + while unitwage is code 1 ("Daily") for all, regardless of the periodicity. + */ + + gen byte unitwage = 5 + replace unitwage = . if mi(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 = d1_22a + replace whours = . if whours == 0 | 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 = 0 + replace contract = 1 if d1_7a == 1 + replace contract = . if lstatus != 1 + 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 firmsize_l = . + replace firmsize_l = 1 if d1_11a == 1 + replace firmsize_l = 6 if d1_11a == 2 + replace firmsize_l = 16 if d1_11a == 3 + replace firmsize_l = 31 if d1_11a == 4 + replace firmsize_l = 50 if d1_11a == 5 + replace firmsize_l = 100 if d1_11a == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_l = 100 if ocusec == 1 & mi(firmsize_l) + + replace firmsize_l = . if lstatus != 1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen firmsize_u= . + replace firmsize_u = 5 if d1_11a == 1 + replace firmsize_u = 15 if d1_11a == 2 + replace firmsize_u = 30 if d1_11a == 3 + replace firmsize_u = 49 if d1_11a == 4 + replace firmsize_u = 99 if d1_11a == 5 + replace firmsize_u = 9999 if d1_11a == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_u = 9999 if ocusec == 1 & mi(firmsize_u) + + 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 = d1_7b + recode empstat_2 (2 = 1) (5 = 4) (6 = 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 = d1_9b + recode ocusec_2 (2 = 1) (3/5 = 2) + replace ocusec_2 = . if mi(empstat_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(d1_5b, "%02.0f") + replace industry_orig_2 = "" if industry_orig_2 == "." + replace industry_orig_2 = "" if mi(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 !mi(industry_orig_2) + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + replace industrycat10_2 = 1 if inrange(industry_orig_2, "01", "03") + replace industrycat10_2 = 2 if inrange(industry_orig_2, "05", "09") + replace industrycat10_2 = 3 if inrange(industry_orig_2, "10", "33") + replace industrycat10_2 = 4 if inrange(industry_orig_2, "35", "39") + replace industrycat10_2 = 5 if inrange(industry_orig_2, "41", "43") + replace industrycat10_2 = 6 if inrange(industry_orig_2, "45", "47") | inrange(industry_orig_2, "55", "56") + replace industrycat10_2 = 7 if inrange(industry_orig_2, "49", "53") | inrange(industry_orig_2, "58", "63") + replace industrycat10_2 = 8 if inrange(industry_orig_2, "64", "82") + replace industrycat10_2 = 9 if inrange(industry_orig_2, "84", "84") + replace industrycat10_2 = 10 if inrange(industry_orig_2, "85", "99") + 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 = d1_6b + 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 = d1_6b + recode occup_2 (51 52 = 5) (99 = 10) + 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_> + egen double wage_no_compen_2 = rowtotal(d1_14b d1_16b), missing + replace wage_no_compen_2 = . if mi(empstat_2) | empstat_2 == 2 | wage_no_compen_2 == 0 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = 5 + replace unitwage_2 = . if mi(wage_no_compen_2) + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = d1_22b + replace whours_2 = . if whours_2 == 0 | mi(empstat_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 = . + replace firmsize_l_2 = 1 if d1_11b == 1 + replace firmsize_l_2 = 6 if d1_11b == 2 + replace firmsize_l_2 = 16 if d1_11b == 3 + replace firmsize_l_2 = 31 if d1_11b == 4 + replace firmsize_l_2 = 50 if d1_11b == 5 + replace firmsize_l_2 = 100 if d1_11b == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_l_2 = 100 if ocusec_2 == 1 & mi(firmsize_l_2) + + replace firmsize_l_2 = . if mi(empstat_2) + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen firmsize_u_2 = . + replace firmsize_u_2 = 5 if d1_11b == 1 + replace firmsize_u_2 = 15 if d1_11b == 2 + replace firmsize_u_2 = 30 if d1_11b == 3 + replace firmsize_u_2 = 49 if d1_11b == 4 + replace firmsize_u_2 = 99 if d1_11b == 5 + replace firmsize_u_2 = 9999 if d1_11b == 6 + + * Add in public sector workers (skip firm size as largest bracket) + replace firmsize_u_2 = 9999 if ocusec_2 == 1 & mi(firmsize_u_2) + + replace firmsize_u_2 = . if mi(empstat_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 < minlaborage & age != . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year=. if age < minlaborage & 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 & 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 = . + 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_var "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 v of local lab_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `v'= "" 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 var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`out_file'", replace + +* diff --git a/Support/B - Country Survey Details/ARM/ILCS/1. Introduction to ARM ILCS.md b/Support/B - Country Survey Details/ARM/ILCS/1. Introduction to ARM ILCS.md index fb9c9b366..189117005 100644 --- a/Support/B - Country Survey Details/ARM/ILCS/1. Introduction to ARM ILCS.md +++ b/Support/B - Country Survey Details/ARM/ILCS/1. Introduction to ARM ILCS.md @@ -87,4 +87,28 @@ The only exception are 228 individuals in 2013 who are coded as absent but answe ### Coding of education variables -Text \ No newline at end of file +The Armenian education system has a 4 + 5 + 3 structure where the first four years represent primary, the middle five years general secondary, and the latter three upper secondary. + +Specific to Armenia are the different paths and academic levels of vocational training, some requiring upper secondary education, others available to graduates of general education. + +[This UNESCO website](https://unevoc.unesco.org/home/Dynamic+TVET+Country+Profiles/country=ARM) summarises the (current) education situation in Armenia, including tertiary education. + +The Armenian ICLS questionnaire asks household members in the roster module about education and in the specific education module for people aged 6 and above. The GLD harmonization uses the latter, with the screenshot below showing the relevant questionnaire section. +

+ +![education questions](utilities/education_vars.png) + +The coding of the GLD variable `educat7` uses the following coding logic: + + +| Q2 - Ed level | Q3 - Ed year | GLD Educat 7 | +|-------------------------------------|------------------|---------------------------------------------| +| 0. Illiterate | Any value | 1. No education | +| 1. Primary (1-4 forms) | Under four years | 2. Primary incomplete | +| 1. Primary (1-4 forms) | If four years | 3. Primary complete | +| 2. Basic secondary (5-9 forms) | Any value | 4. Secondary incomplete | +| 3. Advanced secondary (10-12 forms) | Any value | 5. Secondary complete | +| 4. Secondary vocation | Any value | 5. Secondary complete | +| 5. College (vocational) | Any value | 6. Higher than secondary but not university | +| 6. Higher | Any value | 7. University incomplete or complete | +| 7. Post-graduate | Any value | 7. University incomplete or complete | \ No newline at end of file diff --git a/Support/B - Country Survey Details/ARM/ILCS/utilities/education_vars.png b/Support/B - Country Survey Details/ARM/ILCS/utilities/education_vars.png new file mode 100644 index 000000000..7d5bd911f Binary files /dev/null and b/Support/B - Country Survey Details/ARM/ILCS/utilities/education_vars.png differ