diff --git a/GLD/ARM/ARM_2014_LFS/ARM_2014_LFS_V01_M_V03_A_GLD/Programs/ARM_2014_LFS_V01_M_V03_A_GLD_ALL.do b/GLD/ARM/ARM_2014_LFS/ARM_2014_LFS_V01_M_V03_A_GLD/Programs/ARM_2014_LFS_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..5218b540a --- /dev/null +++ b/GLD/ARM/ARM_2014_LFS/ARM_2014_LFS_V01_M_V03_A_GLD/Programs/ARM_2014_LFS_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,1835 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> ARM_2014_LFS_V01_M_V03_A_GLD_ALL.do +<_Application_> Stata SE 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2023-12-16 +------------------------------------------------------------------------- +<_Country_> Armenia (ARM) +<_Survey Title_> National Labour Force Survey +<_Survey Year_> 2014 +<_Study ID_> ARM_2014_LFS_v01_M +<_Data collection from (M/Y)_> [01/2014] +<_Data collection to (M/Y)_> [12/2014] +<_Source of dataset_> The Armenian 2014 to 2021 data is downloaded from + the website of Statistical Committee of the + Republic of Armenia:https://armstat.am/en/?nid=212 + The data is publicly available. +<_Sample size (HH)_> 7,679 (vs 7,680 planned) +<_Sample size (IND)_> 29,453 +<_Sampling method_> A stratified two-stage probability sample design + with 14 domains as the primary strata and 18,000 + households as the SSU. +<_Geographic coverage_> All 11 regions/marzes. +<_Currency_> Armenian Dram +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 08 +<_OCCUP National_> NSCO +<_ISIC Version_> ISIC Rev.4 +<_INDUS National_> ISIC Rev.4 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [YYYY-MM-DD] File: [As in Program name above] - [Description of changes] +* Date: [YYYY-MM-DD] File: [As in Program name above] - [Description of changes] +* Date: 2024-09-24 - Update vars educy, educat7 +* Date: 2024-10-09 - Include weight by quarter, correct contract variable + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "ARM" +local year "2014" +local survey "LFS" +local vermast "V01" +local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file + + use "`path_in_stata'/ARM_LFS_2014_raw.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="LFS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + 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="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 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=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=A6_Month + 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_> + tostring A1, gen(hid) format(%03.0f) + tostring A6_Month, gen(month) format(%03.0f) + egen hhid=concat(month hid) + label var hhid "Household id" +* + + +*<_pid_> + sort hhid B12 + bys hhid: gen memberid=_n + tostring memberid, gen(id_str) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight=Weigths_Year + label var weight "Household sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + egen weight_q = rowtotal(Weights_1 Weights_2 Weights_3 Weigths_4) + 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=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + decode A3, gen(marzname) + decode A5, gen(urbanstat) + gen strata=marzname+" "+urbanstat + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=A5 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + gen subnatid1=A3 + tostring subnatid1, replace + replace subnatid1=subnatid1+" - "+marzname + + * Unite names to entire series + replace subnatid1 = "5 - Gegharkunik" if subnatid1 == "5 - Gegharquniq" + replace subnatid1 = "6 - Lori" if subnatid1 == "6 - Lory" + replace subnatid1 = "7 - Kotayk" if subnatid1 == "7 - Kotayq" + replace subnatid1 = "9 - Syunik" if subnatid1 == "9 - Sjuniq" + replace subnatid1 = "10 - Vayoc Dzor" if subnatid1 == "10 - Vajoc Dzor" + + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey=subnatid1+" "+urbanstat + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + bys hhid: egen hsize=max(memberid) + label var hsize "Household size" +* + + +*<_age_> + +/*<_age_note_> + +3 observations in the raw data set have negative (-1) age values. +They were coded as missing values in the harmonization. + +*<_age_note_>*/ + + gen age=Age + replace age=. if Age<0 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=B11 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + +/*<_relationharm_note_> + +6 households (18 observations) in the raw data set do not have household heads. +Their household IDs are: + +001376 +002376 +003502 +004083 +006371 +007438 + +During the harmonization, we did not assign household heads to these households. +But users can assign household heads based on their relationship to the head and +other characteristics such as gender and age. + +*<_relationharm_note_>*/ + + gen byte relationharm=B12 + recode relationharm (6 9=3) (7 8=4) (10=5) (11=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 +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=B12 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=B16 + recode marital (1=2) (2=1) (3=5) + 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=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +================================================================================================*/ + +{ +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + replace migrated_binary=. if age + +*<_migrated_years_> + gen migrated_years = . + replace migrated_years=. if migrated_binary!=1 + replace migrated_years=. if age + + +*<_migrated_from_urban_> + gen migrated_from_urban = . + replace migrated_from_urban = . if age + + +*<_migrated_from_cat_> + gen migrated_from_cat = . + replace migrated_from_cat = . if age + + +*<_migrated_from_code_> + gen migrated_from_code = "" + replace migrated_from_code = "" if age + + +*<_migrated_from_country_> + gen migrated_from_country = "" + replace migrated_from_country = "" if migrated_binary!=1 + replace migrated_from_country = "" if age + + +*<_migrated_reason_> + gen migrated_reason = . + replace migrated_reason = . if migrated_binary!=1 + replace migrated_reason = . if age +} + + +/*%%============================================================================================= + 6: Education +================================================================================================*/ + + +{ +*<_ed_mod_age_> + gen byte ed_mod_age=6 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=. + replace school=. if age + + +*<_literacy_> + gen byte literacy=. + replace literacy=0 if B15==1 + replace literacy=1 if inrange(B15,2,9) + replace literacy=. if age + + +*<_educy_> + gen byte educy=. + replace educy = 0 if B15 == 1 | B15 == 2 + replace educy = 4 if B15 == 3 + replace educy = 9 if B15 == 4 + replace educy = 12 if B15 == 5 + replace educy = 11 if B15 == 6 + replace educy = 15 if B15 == 7 + replace educy = 16 if B15 == 8 + replace educy = 20 if B15 == 9 + replace educy=. if ageage & !mi(educy) & !mi(age) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7= B15 + recode educat7 (6=5) (7=6) (8/9=7) + replace educat7=. if age + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + replace educat5=. if age + + +*<_educat4_> + gen byte educat4=educat5 + replace educat4=. if age + + +*<_educat_orig_> + gen educat_orig=B15 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + label var educat_isced "ISCED standardised level of education" +* + + +*<_educat_isced_v_> + gen educat_isced_v="ISCED-2011" + label var educat_isced_v "Version of the ISCED used" +* + +*----------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_isced +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +replace educat_isced_v="." if ( age < ed_mod_age & !missing(age) ) +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=. + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + 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=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen vocational_field_orig=. + replace vocational_field_orig=. if vocational!=1 + 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_> + +/*<_minlaborage_note_> + +The age range for the labor section is 15-75. + +*<_minlaborage_note_>*/ + + gen byte minlaborage=15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if G1==1|inrange(G3,1,5)|inrange(G4,1,2) + replace lstatus=2 if lstatus==.&inrange(Z57,1,2) + replace lstatus=3 if lstatus==.&!mi(Z49_4group) + replace lstatus=. if age75&!mi(age)] + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or inrange(E45,1,3) & (Z57==2) +2)searching but not immediately available to work or Z57==1 & inlist(E45,4,6) + +*/ + + gen potential_lf=. + replace potential_lf=1 if [inrange(E45,1,3) & (Z57==2)] | [Z57==1 & inlist(E45,4,6)] + replace potential_lf=0 if [inrange(E45,1,3) & (Z57==1)] | [Z57==1 & inrange(E45,1,3)] + replace potential_lf=. if age75&!mi(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=E41 + replace underemployment=1 if inrange(E41,1,3) + replace underemployment=0 if E41==4 + replace underemployment=. if age75&!mi(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=Z49_4group + recode nlfreason (4=5) + replace nlfreason=. if age75&!mi(age)] + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=Z52 + recode unempldur_l (1=0) (2=3) (3=12) (4=24) (5=36) + replace unempldur_l=. if age75&!mi(age)] + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=Z52 + recode unempldur_u (1=3) (2=12) (3=24) (4=36) (5=.) + replace unempldur_u=. if age75&!mi(age)] + 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=D8 + recode empstat (2 7=1) (5=4) (6=2) (8=5) + replace empstat=. if lstatus!=1|age + + +*<_ocusec_> + gen byte ocusec=D11 + recode ocusec (3 4=2) + replace ocusec=. if lstatus!=1|age + + +*<_industry_orig_> + gen industry_orig=D6_21group + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" +quietly +{ + replace industrycat_isic="A" if D6_21group==1 + replace industrycat_isic="B" if D6_21group==2 + replace industrycat_isic="C" if D6_21group==3 + replace industrycat_isic="D" if D6_21group==4 + replace industrycat_isic="E" if D6_21group==5 + replace industrycat_isic="F" if D6_21group==6 + replace industrycat_isic="G" if D6_21group==7 + replace industrycat_isic="H" if D6_21group==8 + replace industrycat_isic="I" if D6_21group==9 + replace industrycat_isic="J" if D6_21group==10 + replace industrycat_isic="K" if D6_21group==11 + replace industrycat_isic="L" if D6_21group==12 + replace industrycat_isic="M" if D6_21group==13 + replace industrycat_isic="N" if D6_21group==14 + replace industrycat_isic="O" if D6_21group==15 + replace industrycat_isic="P" if D6_21group==16 + replace industrycat_isic="Q" if D6_21group==17 + replace industrycat_isic="R" if D6_21group==18 + replace industrycat_isic="S" if D6_21group==19 + replace industrycat_isic="T" if D6_21group==20 + replace industrycat_isic="U" if D6_21group==21 +} + + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10=D6_21group + recode industrycat10 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10=. if lstatus!=1 + 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 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), 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=D5_9group + replace occup_orig=. if lstatus!=1|[age>75&!mi(age)] + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco="" + replace occup_isco="" if lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=D5_9group + replace occup_skill=1 if D5_9group==9 + replace occup_skill=2 if inrange(D5_9group, 4, 8) + replace occup_skill=3 if inrange(D5_9group, 1, 3) + replace occup_skill=. if lstatus!=1 + 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" +* + + +*<_occup_> + gen occup=D5_9group + replace occup=. if lstatus!=1|[age>75&!mi(age)] + 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 +* + + +*<_wage_no_compen_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into to parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry, occupation, income categories and gender to estimate their +specific income values. + +16.32% of total non-missing wage values were imputed using this method. + +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage14=D14_1+D14_2 + replace wage14=. if wage14==0 + + * First replace outliers by + winsor2 wage14, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat=. + replace salary_cat=1 if inrange(wage14_w, 1, 45000) + replace salary_cat=2 if wage14_w==45000 + replace salary_cat=3 if inrange(wage14_w, 45001, 90000) + replace salary_cat=4 if inrange(wage14_w, 90000, 180000) + replace salary_cat=5 if inrange(wage14_w, 180000, 360000) + replace salary_cat=6 if inrange(wage14_w, 360000, 500000) + replace salary_cat=7 if inrange(wage14_w, 500000, 700000) + replace salary_cat=8 if inrange(wage14_w, 700000, 3450000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage14_w[iw=weight], by(industrycat10 occup male urban salary_cat) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage14_w wage_group_estimate + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat D15 + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat10 occup male urban D15 using "`salary_helper'", keep(master matched) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage14 if !mi(wage14)&mi(D15) + + * Now add the categorised means + replace wage_no_compen=wage_group_estimate if inrange(D15,1,8)&!mi(wage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" + +* + + +*<_unitwage_> + gen byte unitwage=D16 + recode unitwage (4=5) (5=7) (6=8) (7=10) + replace unitwage=. if lstatus!=1 | empstat==2 + 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=E39_1 + replace whours=. if lstatus!=1|E39_1==0 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths=. + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total=. + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + +/*<_contract_note_> + +There is no separate contract question in the questionnaire. +This contract variable was coded based on employment status question which asks +wether an employed respondent had a contract or not. + +*<_contract_note_>*/ + + gen byte contract = . + replace contract = (D8 == 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=. + replace healthins=1 if D9_6==1 + replace healthins=0 if D9_6==2 + replace healthins=. if lstatus!=1 + 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=. + replace socialsec=. if lstatus!=1 + 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=. + replace union=1 if D23==1 + replace union=0 if D23==2 + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=. 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=E27 + recode empstat_2 (2 7=1) (5=4) (6=2) + replace empstat_2=. if lstatus!=1|E24!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2=E29 + recode ocusec_2 (3 4=2) + replace ocusec_2=. if lstatus!=1|E24!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=E26_21group + replace industry_orig_2=. if lstatus!=1|E24!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" +quietly +{ + replace industrycat_isic_2="A" if E26_21group==1 + replace industrycat_isic_2="B" if E26_21group==2 + replace industrycat_isic_2="C" if E26_21group==3 + replace industrycat_isic_2="D" if E26_21group==4 + replace industrycat_isic_2="E" if E26_21group==5 + replace industrycat_isic_2="F" if E26_21group==6 + replace industrycat_isic_2="G" if E26_21group==7 + replace industrycat_isic_2="H" if E26_21group==8 + replace industrycat_isic_2="I" if E26_21group==9 + replace industrycat_isic_2="J" if E26_21group==10 + replace industrycat_isic_2="K" if E26_21group==11 + replace industrycat_isic_2="L" if E26_21group==12 + replace industrycat_isic_2="M" if E26_21group==13 + replace industrycat_isic_2="N" if E26_21group==14 + replace industrycat_isic_2="O" if E26_21group==15 + replace industrycat_isic_2="P" if E26_21group==16 + replace industrycat_isic_2="Q" if E26_21group==17 + replace industrycat_isic_2="R" if E26_21group==18 + replace industrycat_isic_2="S" if E26_21group==19 + replace industrycat_isic_2="T" if E26_21group==20 + replace industrycat_isic_2="U" if E26_21group==21 +} + + replace industrycat_isic_2="" if industrycat_isic_2=="."|E24!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen industrycat10_2=E26_21group + recode industrycat10_2 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10_2=. if lstatus!=1|E24!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=E25_9group + replace occup_orig_2=. if lstatus!=1|E24!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|E24!=1 + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2=E25_9group + replace occup_skill_2=1 if E25_9group==9 + replace occup_skill_2=2 if inrange(E25_9group,4,8) + replace occup_skill_2=3 if inrange(E25_9group,1,3) + replace occup_skill_2=. if E25_9group==0|lstatus!=1|E24!=1 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen occup_2=E25_9group + replace occup_2=. if lstatus!=1|E24!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + + gen wage32=E32_1+E32_2 + replace wage32=. if wage32==0 + + * First replace outliers by + winsor2 wage32, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat2=. + replace salary_cat2=1 if inrange(wage32_w, 1, 45000) + replace salary_cat2=2 if wage32_w==45000 + replace salary_cat2=3 if inrange(wage32_w, 45001, 90000) + replace salary_cat2=4 if inrange(wage32_w, 90000, 180000) + replace salary_cat2=5 if inrange(wage32_w, 180000, 360000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage32_w[iw=weight], by(industrycat10_2 occup_2 male urban salary_cat2) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage32_w wage_group_estimate2 + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat2 E33 + tempfile salary_helper2 + save "`salary_helper2'" + + * Restore, merge in + restore + merge m:1 industrycat10_2 occup_2 male urban E33 using "`salary_helper2'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen_2=. + + * Fill it first with values that are accurate + replace wage_no_compen_2=wage32 if !mi(wage32)&mi(E33) + + * Now add the categorised means + replace wage_no_compen_2=wage_group_estimate2 if inrange(E33,1,5)&!mi(wage_group_estimate2) + + * Keep only for employed employees, label + replace wage_no_compen_2=. if E24!=1|empstat_2==2 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=E34 + recode unitwage_2 (4=5) (5=7) (6=8) (7=10) + replace unitwage_2=. if lstatus!=1|E24!=1 + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=E38_2 + replace whours_2=. if E38_2==0|E24!=1 + 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 byte firmsize_l_2=. + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte 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 primary & secondary jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others=. + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total=. + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total=. + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total=. + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + + +*<_potential_lf_year_> + gen byte potential_lf_year=. + replace potential_lf_year=. if age + + +*<_underemployment_year_> + gen byte underemployment_year=. + replace underemployment_year=. if age + + +*<_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 "Disable" 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 day 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="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + 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 "1 digit industry classification (Broad Economic Activities), 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 str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard 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 +* + + +*<_wage_no_compen_year_> + 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 byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte 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 day 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 "1 digit industry classification (Broad Economic Activities), 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_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard 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 +* + + +*<_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 byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte 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 primary & secondary 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=. + replace njobs=1 if lstatus==1&E24!=1 + replace njobs=2 if lstatus==1&E24==1 + replace njobs=. if lstatus!=1 + 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=. + 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'/`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/ARM/ARM_2015_LFS/ARM_2015_LFS_V01_M_V03_A_GLD/Programs/ARM_2015_LFS_V01_M_V03_A_GLD_ALL.do b/GLD/ARM/ARM_2015_LFS/ARM_2015_LFS_V01_M_V03_A_GLD/Programs/ARM_2015_LFS_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..fabd08876 --- /dev/null +++ b/GLD/ARM/ARM_2015_LFS/ARM_2015_LFS_V01_M_V03_A_GLD/Programs/ARM_2015_LFS_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,1843 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> ARM_2015_LFS_V01_M_V03_A_GLD_ALL.do +<_Application_> Stata SE 18 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2023-12-20 +------------------------------------------------------------------------- +<_Country_> Armenia (ARM) +<_Survey Title_> National Labour Force Survey +<_Survey Year_> 2015 +<_Study ID_> ARM_2015_LFS_v01_M +<_Data collection from (M/Y)_> [01/2015] +<_Data collection to (M/Y)_> [12/2015] +<_Source of dataset_> The Armenian 2015 to 2021 data is downloaded from + the website of Statistical Committee of the + Republic of Armenia:https://armstat.am/en/?nid=212 + The data is publicly available. +<_Sample size (HH)_> 7,788 +<_Sample size (IND)_> 29,662 +<_Sampling method_> A stratified two-stage probability sample design + with 14 domains as the primary strata and 18,000 + households as the SSU. +<_Geographic coverage_> All 11 regions/marzes. +<_Currency_> Armenian Dram +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 08 +<_OCCUP National_> NSCO +<_ISIC Version_> ISIC Rev.4 +<_INDUS National_> ISIC Rev.4 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [YYYY-MM-DD] File: [As in Program name above] - [Description of changes] +* Date: [YYYY-MM-DD] File: [As in Program name above] - [Description of changes] +* Date: 2024-09-24 - Update vars educy, educat7 +* Date: 2024-10-09 - Include weight by quarter, correct contract variable + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "ARM" +local year "2015" +local survey "LFS" +local vermast "V01" +local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file + + use "`path_in_stata'/ARM_LFS_2015_raw.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="LFS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + 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="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 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=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=A6_Month + 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_> + tostring A1, gen(hid) format(%03.0f) + tostring A6_Month, gen(month) format(%03.0f) + egen hhid=concat(month hid) + label var hhid "Household id" +* + + +*<_pid_> + sort hhid B12 + bys hhid: gen memberid=_n + tostring memberid, gen(id_str) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight=Weights_year + label var weight "Household sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + egen weight_q = rowtotal(Weights_1 Weights_2 Weights_3 Weights_4) + 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=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + decode A3, gen(marzname) + decode A5, gen(urbanstat) + gen strata=marzname+" "+urbanstat + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=A5 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + gen subnatid1=A3 + tostring subnatid1, replace + replace subnatid1=subnatid1+" - "+marzname + + * Unite names to entire series + replace subnatid1 = "5 - Gegharkunik" if subnatid1 == "5 - Gegharquniq" + replace subnatid1 = "6 - Lori" if subnatid1 == "6 - Lory" + replace subnatid1 = "7 - Kotayk" if subnatid1 == "7 - Kotayq" + replace subnatid1 = "9 - Syunik" if subnatid1 == "9 - Syuniq" + + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey=subnatid1+" "+urbanstat + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + bys hhid: egen hsize=max(memberid) + label var hsize "Household size" +* + + +*<_age_> + +/*<_age_note_> + +3 observations in the raw data set have negative (-1) age values. +They were coded as missing values in the harmonization. + +*<_age_note_>*/ + + gen age=Age + replace age=. if Age<0 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=B11 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + +/*<_relationharm_note_> + +1 household (3 observations) in the raw data set does not have household head: 004318 + +During the harmonization, we did not assign household head to the household. +But users can assign household heads based on their relationship to the head and +other characteristics such as gender and age. + +*<_relationharm_note_>*/ + + gen byte relationharm=B12 + recode relationharm (6 9=3) (7 8=4) (10=5) (11=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 +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=B12 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=B16 + recode marital (1=2) (2=1) (3=5) + 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=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +================================================================================================*/ + +{ +*<_migrated_mod_age_> + gen migrated_mod_age=. + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time=. + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary=. + label de lblmigrated_binary 0 "No" 1 "Yes" + replace migrated_binary=. if age + +*<_migrated_years_> + gen migrated_years=. + replace migrated_years=. if migrated_binary!=1 + replace migrated_years=. if age + + +*<_migrated_from_urban_> + gen migrated_from_urban=. + replace migrated_from_urban=. if age + + +*<_migrated_from_cat_> + gen migrated_from_cat=. + replace migrated_from_cat=. if age + + +*<_migrated_from_code_> + gen migrated_from_code="" + replace migrated_from_code="" if age + + +*<_migrated_from_country_> + gen migrated_from_country="" + replace migrated_from_country="" if migrated_binary!=1 + replace migrated_from_country="" if age + + +*<_migrated_reason_> + gen migrated_reason=. + replace migrated_reason=. if migrated_binary!=1 + replace migrated_reason=. if age +} + + +/*%%============================================================================================= + 6: Education +================================================================================================*/ + + +{ +*<_ed_mod_age_> + gen byte ed_mod_age=6 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=. + replace school=. if age + + +*<_literacy_> + gen byte literacy=. + replace literacy=0 if B15==1 + replace literacy=1 if inrange(B15,2,9) + replace literacy=. if age + + +*<_educy_> + gen byte educy=. + replace educy = 0 if B15 == 1 | B15 == 2 + replace educy = 4 if B15 == 3 + replace educy = 9 if B15 == 4 + replace educy = 12 if B15 == 5 + replace educy = 11 if B15 == 6 + replace educy = 15 if B15 == 7 + replace educy = 16 if B15 == 8 + replace educy = 20 if B15 == 9 + replace educy=. if ageage & !mi(educy) & !mi(age) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7= B15 + recode educat7 (6=5) (7=6) (8/9=7) + replace educat7=. if age + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + replace educat5=. if age + + +*<_educat4_> + gen byte educat4=educat5 + replace educat4=. if age + + +*<_educat_orig_> + gen educat_orig=B15 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + label var educat_isced "ISCED standardised level of education" +* + + +*<_educat_isced_v_> + gen educat_isced_v="ISCED-2011" + label var educat_isced_v "Version of the ISCED used" +* + +*----------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_isced +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +replace educat_isced_v="." if ( age < ed_mod_age & !missing(age) ) +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=. + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + 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=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen vocational_field_orig=. + replace vocational_field_orig=. if vocational!=1 + 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_> + +/*<_minlaborage_note_> + +The age range for the labor section is 15-75. + +*<_minlaborage_note_>*/ + + gen byte minlaborage=15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + +/*<_lstatus_note> + +According to the national definition of Armenia, the economically inavtive population +includes + +1)full-time pupils and students +2)housekeepers +3)pensioners +4)other jobless peope including conscripts + +And the economically inavtive population also needs to be within the age range of +15 and 75. +*<_lstatus_note>*/ + + gen byte lstatus=. + replace lstatus=1 if G1==1|inrange(G3,1,5)|inrange(G4,1,2) + replace lstatus=2 if lstatus==.&inrange(Z57,1,2) + replace lstatus=3 if !mi(Z49_4groups)&lstatus==. + replace lstatus=. if !inrange(age,15,75) + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or inrange(E45,1,3) & (Z57==2) +2)searching but not immediately available to work or Z57==1 & inlist(E45,4,6) + +*/ + + gen potential_lf=. + replace potential_lf=1 if [inrange(E45,1,3) & (Z57==2)] | [Z57==1 & inlist(E45,4,6)] + replace potential_lf=0 if [inrange(E45,1,3) & (Z57==1)] | [Z57==1 & inrange(E45,1,3)] + replace potential_lf=. if age75&!mi(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=E41 + replace underemployment=1 if inrange(E41,1,3) + replace underemployment=0 if E41==4 + replace underemployment=. if age75&!mi(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=Z49_4groups + recode nlfreason (4=5) + replace nlfreason=. if age75&!mi(age)] + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=Z52 + recode unempldur_l (1=0) (2=3) (3=12) (4=24) (5=36) + replace unempldur_l=. if age75&!mi(age)] + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=Z52 + recode unempldur_u (1=3) (2=12) (3=24) (4=36) (5=.) + replace unempldur_u=. if age75&!mi(age)] + 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=D8 + recode empstat (2 7=1) (5=4) (6=2) (8=5) + replace empstat=. if lstatus!=1|age + + +*<_ocusec_> + gen byte ocusec=D11 + recode ocusec (3 4=2) + replace ocusec=. if lstatus!=1|age + + +*<_industry_orig_> + gen industry_orig=D6_21groups + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" +quietly +{ + replace industrycat_isic="A" if D6_21groups==1 + replace industrycat_isic="B" if D6_21groups==2 + replace industrycat_isic="C" if D6_21groups==3 + replace industrycat_isic="D" if D6_21groups==4 + replace industrycat_isic="E" if D6_21groups==5 + replace industrycat_isic="F" if D6_21groups==6 + replace industrycat_isic="G" if D6_21groups==7 + replace industrycat_isic="H" if D6_21groups==8 + replace industrycat_isic="I" if D6_21groups==9 + replace industrycat_isic="J" if D6_21groups==10 + replace industrycat_isic="K" if D6_21groups==11 + replace industrycat_isic="L" if D6_21groups==12 + replace industrycat_isic="M" if D6_21groups==13 + replace industrycat_isic="N" if D6_21groups==14 + replace industrycat_isic="O" if D6_21groups==15 + replace industrycat_isic="P" if D6_21groups==16 + replace industrycat_isic="Q" if D6_21groups==17 + replace industrycat_isic="R" if D6_21groups==18 + replace industrycat_isic="S" if D6_21groups==19 + replace industrycat_isic="T" if D6_21groups==20 + replace industrycat_isic="U" if D6_21groups==21 +} + + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10=D6_21groups + recode industrycat10 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10=. if lstatus!=1 + 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 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), 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=D5_9group + replace occup_orig=. if lstatus!=1|[age>75&!mi(age)] + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco="" + replace occup_isco="" if lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=D5_9group + replace occup_skill=1 if D5_9group==9 + replace occup_skill=2 if inrange(D5_9group, 4, 8) + replace occup_skill=3 if inrange(D5_9group, 1, 3) + replace occup_skill=. if lstatus!=1 + 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" +* + + +*<_occup_> + gen occup=D5_9group + replace occup=. if lstatus!=1|[age>75&!mi(age)] + 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 +* + + +*<_wage_no_compen_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into to parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry, occupation, income categories and gender to estimate their +specific income values. + +15.16% of total non-missing wage values were imputed using this method. + +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage14=D14_1+D14_2 + replace wage14=. if wage14==0 + + * First replace outliers by + winsor2 wage14, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat=. + replace salary_cat=1 if inrange(wage14_w, 1, 45000) + replace salary_cat=2 if wage14_w==45000 + replace salary_cat=3 if inrange(wage14_w, 45001, 90000) + replace salary_cat=4 if inrange(wage14_w, 90000, 180000) + replace salary_cat=5 if inrange(wage14_w, 180000, 360000) + replace salary_cat=6 if inrange(wage14_w, 360000, 500000) + replace salary_cat=7 if inrange(wage14_w, 500000, 700000) + replace salary_cat=8 if inrange(wage14_w, 700000, 3450000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage14_w[iw=weight], by(industrycat10 occup male urban salary_cat) + drop if mi(salary_cat) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage14_w wage_group_estimate + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat D15 + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat10 occup male urban D15 using "`salary_helper'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage14 if !mi(wage14)&mi(D15) + + * Now add the categorised means + replace wage_no_compen=wage_group_estimate if inrange(D15,1,8)&!mi(wage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" + +* + + +*<_unitwage_> + gen byte unitwage=D16 + recode unitwage (4=5) (5=7) (6=8) (7=10) + replace unitwage=. if lstatus!=1 | empstat==2 + 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=E39_1 + replace whours=. if lstatus!=1|E39_1==0 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths=. + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total=. + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + +/*<_contract_note_> + +There is no separate contract question in the questionnaire. +This contract variable was coded based on employment status question which asks +wether an employed respondent had a contract or not. + +*<_contract_note_>*/ + + gen byte contract = . + replace contract = (D8 == 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=. + replace healthins=1 if D9_6==1 + replace healthins=0 if D9_6==2 + replace healthins=. if lstatus!=1 + 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=. + replace socialsec=. if lstatus!=1 + 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=. + replace union=1 if D23==1 + replace union=0 if D23==2 + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=. + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=. + replace firmsize_u=. 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=E27 + recode empstat_2 (2 7=1) (5=4) (6=2) + replace empstat_2=. if lstatus!=1|E24!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2=E29 + recode ocusec_2 (3 4=2) + replace ocusec_2=. if lstatus!=1|E24!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=E26_21group + replace industry_orig_2=. if lstatus!=1|E24!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" +quietly +{ + replace industrycat_isic_2="A" if E26_21group==1 + replace industrycat_isic_2="B" if E26_21group==2 + replace industrycat_isic_2="C" if E26_21group==3 + replace industrycat_isic_2="D" if E26_21group==4 + replace industrycat_isic_2="E" if E26_21group==5 + replace industrycat_isic_2="F" if E26_21group==6 + replace industrycat_isic_2="G" if E26_21group==7 + replace industrycat_isic_2="H" if E26_21group==8 + replace industrycat_isic_2="I" if E26_21group==9 + replace industrycat_isic_2="J" if E26_21group==10 + replace industrycat_isic_2="K" if E26_21group==11 + replace industrycat_isic_2="L" if E26_21group==12 + replace industrycat_isic_2="M" if E26_21group==13 + replace industrycat_isic_2="N" if E26_21group==14 + replace industrycat_isic_2="O" if E26_21group==15 + replace industrycat_isic_2="P" if E26_21group==16 + replace industrycat_isic_2="Q" if E26_21group==17 + replace industrycat_isic_2="R" if E26_21group==18 + replace industrycat_isic_2="S" if E26_21group==19 + replace industrycat_isic_2="T" if E26_21group==20 + replace industrycat_isic_2="U" if E26_21group==21 +} + + replace industrycat_isic_2="" if industrycat_isic_2=="."|E24!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen industrycat10_2=E26_21group + recode industrycat10_2 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10_2=. if lstatus!=1|E24!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=E25_9group + replace occup_orig_2=. if lstatus!=1|E24!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|E24!=1 + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2=E25_9group + replace occup_skill_2=1 if E25_9group==9 + replace occup_skill_2=2 if inrange(E25_9group,4,8) + replace occup_skill_2=3 if inrange(E25_9group,1,3) + replace occup_skill_2=. if E25_9group==0|lstatus!=1|E24!=1 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen occup_2=E25_9group + replace occup_2=. if lstatus!=1|E24!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + + gen wage32=E32_1+E32_2 + replace wage32=. if wage32==0 + + * First replace outliers by + winsor2 wage32, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat2=. + replace salary_cat2=1 if inrange(wage32_w, 1, 45000) + replace salary_cat2=2 if wage32_w==45000 + replace salary_cat2=3 if inrange(wage32_w, 45001, 90000) + replace salary_cat2=4 if inrange(wage32_w, 90000, 180000) + replace salary_cat2=5 if inrange(wage32_w, 180000, 360000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage32_w[iw=weight], by(industrycat10_2 occup_2 male urban salary_cat2) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage32_w wage_group_estimate2 + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat2 E33 + tempfile salary_helper2 + save "`salary_helper2'" + + * Restore, merge in + restore + merge m:1 industrycat10_2 occup_2 male urban E33 using "`salary_helper2'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen_2=. + + * Fill it first with values that are accurate + replace wage_no_compen_2=wage32 if !mi(wage32)&mi(E33) + + * Now add the categorised means + replace wage_no_compen_2=wage_group_estimate2 if inrange(E33,1,5)&!mi(wage_group_estimate2) + + * Keep only for employed employees, label + replace wage_no_compen_2=. if E24!=1|empstat_2==2 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=E34 + recode unitwage_2 (4=5) (5=7) (6=8) (7=10) + replace unitwage_2=. if lstatus!=1|E24!=1 + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=E38_2 + replace whours_2=. if E38_2==0|E24!=1 + 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 byte firmsize_l_2=. + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte 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 primary & secondary jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others=. + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total=. + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total=. + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total=. + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + + +*<_potential_lf_year_> + gen byte potential_lf_year=. + replace potential_lf_year=. if age + + +*<_underemployment_year_> + gen byte underemployment_year=. + replace underemployment_year=. if age + + +*<_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 "Disable" 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 day 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="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + 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 "1 digit industry classification (Broad Economic Activities), 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 str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard 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 +* + + +*<_wage_no_compen_year_> + 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 byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte 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 day 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 "1 digit industry classification (Broad Economic Activities), 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_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard 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 +* + + +*<_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 byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte 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 primary & secondary 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=. + replace njobs=1 if lstatus==1&E24!=1 + replace njobs=2 if lstatus==1&E24==1 + replace njobs=. if lstatus!=1 + 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=. + 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'/`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/ARM/ARM_2016_LFS/ARM_2016_LFS_V01_M_V03_A_GLD/Programs/ARM_2016_LFS_V01_M_V03_A_GLD_ALL.do b/GLD/ARM/ARM_2016_LFS/ARM_2016_LFS_V01_M_V03_A_GLD/Programs/ARM_2016_LFS_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..ab7a2f04d --- /dev/null +++ b/GLD/ARM/ARM_2016_LFS/ARM_2016_LFS_V01_M_V03_A_GLD/Programs/ARM_2016_LFS_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,1846 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> ARM_2016_LFS_V01_M_V03_A_GLD_ALL.do +<_Application_> Stata SE 18 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2023-12-20 +------------------------------------------------------------------------- +<_Country_> Armenia (ARM) +<_Survey Title_> National Labour Force Survey +<_Survey Year_> 2016 +<_Study ID_> ARM_2016_LFS_v01_M +<_Data collection from (M/Y)_> [01/2016] +<_Data collection to (M/Y)_> [12/2016] +<_Source of dataset_> The Armenian 2016 to 2021 data is downloaded from + the website of Statistical Committee of the + Republic of Armenia:https://armstat.am/en/?nid=212 + The data is publicly available. +<_Sample size (HH)_> 7,788 +<_Sample size (IND)_> 28,516 +<_Sampling method_> A stratified two-stage probability sample design + with 14 domains as the primary strata and 18,000 + households as the SSU. +<_Geographic coverage_> All 11 regions/marzes. +<_Currency_> Armenian Dram +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 08 +<_OCCUP National_> NSCO +<_ISIC Version_> ISIC Rev.4 +<_INDUS National_> ISIC Rev.4 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: 2024-09-24 - Update vars educy, educat7 +* Date: 2024-10-09 - Include weight by quarter, correct contract variable + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "ARM" +local year "2016" +local survey "LFS" +local vermast "V01" +local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file + + use "`path_in_stata'/ARM_LFS_2016_raw.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="LFS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + 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="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 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=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=A6_Month + 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_> + tostring A1, gen(hid) format(%03.0f) + tostring A6_Month, gen(month) format(%03.0f) + egen hhid=concat(month hid) + label var hhid "Household id" +* + + +*<_pid_> + sort hhid B12 + bys hhid: gen memberid=_n + tostring memberid, gen(id_str) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight=Weights_Year + label var weight "Household sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + egen weight_q = rowtotal(Weights_1 Weights_2 Weights_3 Weights_4) + 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=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + decode A3, gen(marzname) + decode A5, gen(urbanstat) + gen strata=marzname+" "+urbanstat + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=A5 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + gen subnatid1=A3 + tostring subnatid1, replace + replace subnatid1=subnatid1+" - "+marzname + + * Unite names to entire series + replace subnatid1 = "5 - Gegharkunik" if subnatid1 == "5 - Gegharquniq" + replace subnatid1 = "6 - Lori" if subnatid1 == "6 - Lory" + replace subnatid1 = "7 - Kotayk" if subnatid1 == "7 - Kotayq" + replace subnatid1 = "9 - Syunik" if subnatid1 == "9 - Syuniq" + + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey=subnatid1+" "+urbanstat + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + bys hhid: egen hsize=max(memberid) + label var hsize "Household size" +* + + +*<_age_> + +/*<_age_note_> + +3 observations in the raw data set have negative (-1) age values. +They were coded as missing values in the harmonization. + +*<_age_note_>*/ + + gen age=Age + replace age=. if Age<0 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=B11 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + +/*<_relationharm_note_> + +3 household (12 observations) in the raw data set do not have household heads: +012217 +012247 +012355 + +During the harmonization, we did not assign household head to the household. +But users can assign household heads based on their relationship to the head and +other characteristics such as gender and age. + +*<_relationharm_note_>*/ + + gen byte relationharm=B12 + recode relationharm (6 9=3) (7 8=4) (10=5) (11=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 +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=B12 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=B16 + recode marital (1=2) (2=1) (3=5) + 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=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +================================================================================================*/ + +{ +*<_migrated_mod_age_> + gen migrated_mod_age=. + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time=. + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary=. + label de lblmigrated_binary 0 "No" 1 "Yes" + replace migrated_binary=. if age + +*<_migrated_years_> + gen migrated_years=. + replace migrated_years=. if migrated_binary!=1 + replace migrated_years=. if age + + +*<_migrated_from_urban_> + gen migrated_from_urban=. + replace migrated_from_urban=. if age + + +*<_migrated_from_cat_> + gen migrated_from_cat=. + replace migrated_from_cat=. if age + + +*<_migrated_from_code_> + gen migrated_from_code="" + replace migrated_from_code="" if age + + +*<_migrated_from_country_> + gen migrated_from_country="" + replace migrated_from_country="" if migrated_binary!=1 + replace migrated_from_country="" if age + + +*<_migrated_reason_> + gen migrated_reason=. + replace migrated_reason=. if migrated_binary!=1 + replace migrated_reason=. if age +} + + +/*%%============================================================================================= + 6: Education +================================================================================================*/ + + +{ +*<_ed_mod_age_> + gen byte ed_mod_age=6 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=. + replace school=. if age + + +*<_literacy_> + gen byte literacy=. + replace literacy=0 if B15==1 + replace literacy=1 if inrange(B15,2,9) + replace literacy=. if age + + +*<_educy_> + gen byte educy=. + replace educy = 0 if B15 == 1 | B15 == 2 + replace educy = 4 if B15 == 3 + replace educy = 9 if B15 == 4 + replace educy = 12 if B15 == 5 + replace educy = 11 if B15 == 6 + replace educy = 15 if B15 == 7 + replace educy = 16 if B15 == 8 + replace educy = 20 if B15 == 9 + replace educy=. if ageage & !mi(educy) & !mi(age) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7= B15 + recode educat7 (6=5) (7=6) (8/9=7) + replace educat7=. if age + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + replace educat5=. if age + + +*<_educat4_> + gen byte educat4=educat5 + replace educat4=. if age + + +*<_educat_orig_> + gen educat_orig=B15 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + label var educat_isced "ISCED standardised level of education" +* + + +*<_educat_isced_v_> + gen educat_isced_v="ISCED-2011" + label var educat_isced_v "Version of the ISCED used" +* + +*----------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_isced +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +replace educat_isced_v="." if ( age < ed_mod_age & !missing(age) ) +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=. + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + 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=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen vocational_field_orig=. + replace vocational_field_orig=. if vocational!=1 + 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_> + +/*<_minlaborage_note_> + +The age range for the labor section is 15-75. + +*<_minlaborage_note_>*/ + + gen byte minlaborage=15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + +/*<_lstatus_note> + +According to the national definition of Armenia, the economically inavtive population +includes + +1)full-time pupils and students +2)housekeepers +3)pensioners +4)other jobless peope including conscripts + +And the economically inavtive population also needs to be within the age range of +15 and 75. +*<_lstatus_note>*/ + + gen byte lstatus=. + replace lstatus=1 if G1==1|inrange(G3,1,5)|inrange(G4,1,2) + replace lstatus=2 if lstatus==.&inrange(Z57,1,2) + replace lstatus=3 if !mi(Z49_4group)&lstatus==. + replace lstatus=. if !inrange(age,15,75) + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or inrange(E45,1,3) & (Z57==2) +2)searching but not immediately available to work or Z57==1 & inlist(E45,4,6) + +*/ + + gen potential_lf=. + replace potential_lf=1 if [inrange(E45,1,3) & (Z57==2)] | [Z57==1 & inlist(E45,4,6)] + replace potential_lf=0 if [inrange(E45,1,3) & (Z57==1)] | [Z57==1 & inrange(E45,1,3)] + replace potential_lf=. if age75&!mi(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=E41 + replace underemployment=1 if inrange(E41,1,3) + replace underemployment=0 if E41==4 + replace underemployment=. if age75&!mi(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=Z49_4group + recode nlfreason (4=5) + replace nlfreason=. if age75&!mi(age)] + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=Z52 + recode unempldur_l (1=0) (2=3) (3=12) (4=24) (5=36) + replace unempldur_l=. if age75&!mi(age)] + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=Z52 + recode unempldur_u (1=3) (2=12) (3=24) (4=36) (5=.) + replace unempldur_u=. if age75&!mi(age)] + 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=D8 + recode empstat (2 7=1) (5=4) (6=2) (8=5) + replace empstat=. if lstatus!=1|age + + +*<_ocusec_> + gen byte ocusec=D11 + recode ocusec (3 4=2) + replace ocusec=. if lstatus!=1|age + + +*<_industry_orig_> + gen industry_orig=D6_21group + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" +quietly +{ + replace industrycat_isic="A" if D6_21group==1 + replace industrycat_isic="B" if D6_21group==2 + replace industrycat_isic="C" if D6_21group==3 + replace industrycat_isic="D" if D6_21group==4 + replace industrycat_isic="E" if D6_21group==5 + replace industrycat_isic="F" if D6_21group==6 + replace industrycat_isic="G" if D6_21group==7 + replace industrycat_isic="H" if D6_21group==8 + replace industrycat_isic="I" if D6_21group==9 + replace industrycat_isic="J" if D6_21group==10 + replace industrycat_isic="K" if D6_21group==11 + replace industrycat_isic="L" if D6_21group==12 + replace industrycat_isic="M" if D6_21group==13 + replace industrycat_isic="N" if D6_21group==14 + replace industrycat_isic="O" if D6_21group==15 + replace industrycat_isic="P" if D6_21group==16 + replace industrycat_isic="Q" if D6_21group==17 + replace industrycat_isic="R" if D6_21group==18 + replace industrycat_isic="S" if D6_21group==19 + replace industrycat_isic="T" if D6_21group==20 + replace industrycat_isic="U" if D6_21group==21 +} + + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10=D6_21group + recode industrycat10 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10=. if lstatus!=1 + 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 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), 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=D5_9group + replace occup_orig=. if lstatus!=1|[age>75&!mi(age)] + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco="" + replace occup_isco="" if lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=D5_9group + replace occup_skill=1 if D5_9group==9 + replace occup_skill=2 if inrange(D5_9group, 4, 8) + replace occup_skill=3 if inrange(D5_9group, 1, 3) + replace occup_skill=. if lstatus!=1 + 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" +* + + +*<_occup_> + gen occup=D5_9group + replace occup=. if lstatus!=1|[age>75&!mi(age)] + 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 +* + + +*<_wage_no_compen_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into to parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry, occupation, income categories and gender to estimate their +specific income values. + +15.73% of total non-missing wage values were imputed using this method. + +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage14=D14_1+D14_2 + replace wage14=. if wage14==0 + + * First replace outliers by + winsor2 wage14, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat=. + replace salary_cat=1 if inrange(wage14_w, 1, 55000) + replace salary_cat=2 if wage14_w==55000 + replace salary_cat=3 if inrange(wage14_w, 55001, 110000) + replace salary_cat=4 if inrange(wage14_w, 110001, 220000) + replace salary_cat=5 if inrange(wage14_w, 220001, 440000) + replace salary_cat=6 if inrange(wage14_w, 440001, 600000) + replace salary_cat=7 if inrange(wage14_w, 600001, 700000) + replace salary_cat=8 if inrange(wage14_w, 700000, 99999999) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage14_w[iw=weight], by(industrycat10 occup male urban salary_cat) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage14_w wage_group_estimate + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat D15 + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat10 occup male urban D15 using "`salary_helper'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage14 if !mi(wage14)&mi(D15) + + * Now add the categorised means + replace wage_no_compen=wage_group_estimate if inrange(D15,1,8)&!mi(wage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" + +* + + +*<_unitwage_> + gen byte unitwage=D16 + recode unitwage (4=5) (5=7) (6=8) (7=10) + replace unitwage=. if lstatus!=1 | empstat==2 + 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=E39_1 + replace whours=. if lstatus!=1|E39_1==0 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths=. + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total=. + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + +/*<_contract_note_> + +There is no separate contract question in the questionnaire. +This contract variable was coded based on employment status question which asks +wether an employed respondent had a contract or not. + +*<_contract_note_>*/ + + gen byte contract = . + replace contract = (D8 == 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=. + replace healthins=1 if D9_6==1 + replace healthins=0 if D9_6==2 + replace healthins=. if lstatus!=1 + 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=. + replace socialsec=. if lstatus!=1 + 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=. + replace union=1 if D23==1 + replace union=0 if D23==2 + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=D13a + recode firmsize_l (1=1) (2=5) (3=10) (4=20) (5=50) (6=100) (7=.) + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=D13a + recode firmsize_u (1=5) (2=9) (3=19) (4=49) (5=99) (6=.) + 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=E27 + recode empstat_2 (2 7=1) (5=4) (6=2) + replace empstat_2=. if lstatus!=1|E24!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2=E29 + recode ocusec_2 (3 4=2) + replace ocusec_2=. if lstatus!=1|E24!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=E26_21group + replace industry_orig_2=. if lstatus!=1|E24!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" +quietly +{ + replace industrycat_isic_2="A" if E26_21group==1 + replace industrycat_isic_2="B" if E26_21group==2 + replace industrycat_isic_2="C" if E26_21group==3 + replace industrycat_isic_2="D" if E26_21group==4 + replace industrycat_isic_2="E" if E26_21group==5 + replace industrycat_isic_2="F" if E26_21group==6 + replace industrycat_isic_2="G" if E26_21group==7 + replace industrycat_isic_2="H" if E26_21group==8 + replace industrycat_isic_2="I" if E26_21group==9 + replace industrycat_isic_2="J" if E26_21group==10 + replace industrycat_isic_2="K" if E26_21group==11 + replace industrycat_isic_2="L" if E26_21group==12 + replace industrycat_isic_2="M" if E26_21group==13 + replace industrycat_isic_2="N" if E26_21group==14 + replace industrycat_isic_2="O" if E26_21group==15 + replace industrycat_isic_2="P" if E26_21group==16 + replace industrycat_isic_2="Q" if E26_21group==17 + replace industrycat_isic_2="R" if E26_21group==18 + replace industrycat_isic_2="S" if E26_21group==19 + replace industrycat_isic_2="T" if E26_21group==20 + replace industrycat_isic_2="U" if E26_21group==21 +} + + replace industrycat_isic_2="" if industrycat_isic_2=="."|E24!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen industrycat10_2=E26_21group + recode industrycat10_2 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10_2=. if lstatus!=1|E24!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=E25_9group + replace occup_orig_2=. if lstatus!=1|E24!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|E24!=1 + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2=E25_9group + replace occup_skill_2=1 if E25_9group==9 + replace occup_skill_2=2 if inrange(E25_9group,4,8) + replace occup_skill_2=3 if inrange(E25_9group,1,3) + replace occup_skill_2=. if E25_9group==0|lstatus!=1|E24!=1 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen occup_2=E25_9group + replace occup_2=. if lstatus!=1|E24!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + + gen wage32=E32_1+E32_2 + replace wage32=. if wage32==0 + + * First replace outliers by + winsor2 wage32, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat2=. + replace salary_cat2=1 if inrange(wage32_w, 1, 55000) + replace salary_cat2=2 if wage32_w==55000 + replace salary_cat2=3 if inrange(wage32_w, 55001, 110000) + replace salary_cat2=4 if inrange(wage32_w, 110001, 220000) + replace salary_cat2=5 if inrange(wage32_w, 220001, 440000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage32_w[iw=weight], by(industrycat10_2 occup_2 male urban salary_cat2) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage32_w wage_group_estimate2 + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat2 E33 + tempfile salary_helper2 + save "`salary_helper2'" + + * Restore, merge in + restore + merge m:1 industrycat10_2 occup_2 male urban E33 using "`salary_helper2'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen_2=. + + * Fill it first with values that are accurate + replace wage_no_compen_2=wage32 if !mi(wage32)&mi(E33) + + * Now add the categorised means + replace wage_no_compen_2=wage_group_estimate2 if inrange(E33,1,5)&!mi(wage_group_estimate2) + + * Keep only for employed employees, label + replace wage_no_compen_2=. if E24!=1|empstat_2==2 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=E34 + recode unitwage_2 (4=5) (5=7) (6=8) (7=10) + replace unitwage_2=. if lstatus!=1|E24!=1 + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=E38_2 + replace whours_2=. if E38_2==0|E24!=1 + 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 byte firmsize_l_2=E30a + recode firmsize_l_2 (1=1) (2=5) (3=10) (4=20) (5=50) (6=100) (7=.) + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte firmsize_u_2=E30a + recode firmsize_u_2 (1=5) (2=9) (3=19) (4=49) (5=99) (6=.) + 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 primary & secondary jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others=. + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total=. + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total=. + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total=. + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + + +*<_potential_lf_year_> + gen byte potential_lf_year=. + replace potential_lf_year=. if age + + +*<_underemployment_year_> + gen byte underemployment_year=. + replace underemployment_year=. if age + + +*<_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 "Disable" 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 day 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="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + 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 "1 digit industry classification (Broad Economic Activities), 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 str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard 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 +* + + +*<_wage_no_compen_year_> + 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 byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte 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 day 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 "1 digit industry classification (Broad Economic Activities), 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_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard 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 +* + + +*<_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 byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte 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 primary & secondary 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=. + replace njobs=1 if lstatus==1&E24!=1 + replace njobs=2 if lstatus==1&E24==1 + replace njobs=. if lstatus!=1 + 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=. + 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'/`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/ARM/ARM_2017_LFS/ARM_2017_LFS_V01_M_V03_A_GLD/Programs/ARM_2017_LFS_V01_M_V03_A_GLD_ALL.do b/GLD/ARM/ARM_2017_LFS/ARM_2017_LFS_V01_M_V03_A_GLD/Programs/ARM_2017_LFS_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..ac8d49727 --- /dev/null +++ b/GLD/ARM/ARM_2017_LFS/ARM_2017_LFS_V01_M_V03_A_GLD/Programs/ARM_2017_LFS_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,1840 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> ARM_2017_LFS_V01_M_V03_A_GLD_ALL.do +<_Application_> Stata SE 18 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2023-12-20 +------------------------------------------------------------------------- +<_Country_> Armenia (ARM) +<_Survey Title_> National Labour Force Survey +<_Survey Year_> 2017 +<_Study ID_> ARM_2017_LFS_v01_M +<_Data collection from (M/Y)_> [01/2017] +<_Data collection to (M/Y)_> [12/2017] +<_Source of dataset_> The Armenian 2017 to 2021 data is downloaded from + the website of Statistical Committee of the + Republic of Armenia:https://armstat.am/en/?nid=212 + The data is publicly available. +<_Sample size (HH)_> 7,783 +<_Sample size (IND)_> 28,463 +<_Sampling method_> A stratified two-stage probability sample design + with 14 domains as the primary strata and 18,000 + households as the SSU. +<_Geographic coverage_> All 11 regions/marzes. +<_Currency_> Armenian Dram +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 08 +<_OCCUP National_> NSCO +<_ISIC Version_> ISIC Rev.4 +<_INDUS National_> ISIC Rev.4 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: 2024-09-24 - Update vars educy, educat7 +* Date: 2024-10-09 - Include weight by quarter, correct contract variable + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "ARM" +local year "2017" +local survey "LFS" +local vermast "V01" +local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file + +use "`path_in_stata'/ARM_LFS_2017_raw.dta", clear + + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="LFS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-13" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + 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="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 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=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=A6_Month + 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_> + tostring A1, gen(hid) format(%03.0f) + tostring A6_Month, gen(month) format(%03.0f) + egen hhid=concat(month hid) + label var hhid "Household id" +* + + +*<_pid_> + sort hhid B12 + bys hhid: gen memberid=_n + tostring memberid, gen(id_str) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight=Weights_Year + label var weight "Household sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + egen weight_q = rowtotal(Weight_1 Weight_2 Weight_3 Weight_4) + 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=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + decode A3, gen(marzname) + decode A5, gen(urbanstat) + gen strata=marzname+" "+urbanstat + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=A5 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + gen subnatid1=A3 + tostring subnatid1, replace + replace subnatid1=subnatid1+" - "+marzname + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey=subnatid1+" "+urbanstat + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + bys hhid: egen hsize=max(memberid) + label var hsize "Household size" +* + + +*<_age_> + +/*<_age_note_> + +3 observations in the raw data set have negative (-1) age values. +They were coded as missing values in the harmonization. + +*<_age_note_>*/ + + gen age=Age + replace age=. if Age<0 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=B11 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + +/*<_relationharm_note_> + +1 household (5 observations) in the raw data set does not have any household head: 002606 + +During the harmonization, we did not assign household head to the household. +But users can assign household heads based on their relationship to the head and +other characteristics such as gender and age. + +Household "009297" has two "First registered member", meaning it has two heads. +They are both female with close ages: one is 74 and the other is 76. We kept the +younger one as the householdhead and replaced the other one's relationharm to +"other relatives". + +*<_relationharm_note_>*/ + + gen byte relationharm=B12 + recode relationharm (6 9=3) (7 8=4) (10=5) (11=6) + replace relationharm=5 if pid=="009297-02" + + 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 +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=B12 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=B16 + recode marital (1=2) (2=1) (3=5) + 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=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +================================================================================================*/ + +{ +*<_migrated_mod_age_> + gen migrated_mod_age=. + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time=. + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary=. + label de lblmigrated_binary 0 "No" 1 "Yes" + replace migrated_binary=. if age + +*<_migrated_years_> + gen migrated_years=. + replace migrated_years=. if migrated_binary!=1 + replace migrated_years=. if age + + +*<_migrated_from_urban_> + gen migrated_from_urban=. + replace migrated_from_urban=. if age + + +*<_migrated_from_cat_> + gen migrated_from_cat=. + replace migrated_from_cat=. if age + + +*<_migrated_from_code_> + gen migrated_from_code="" + replace migrated_from_code="" if age + + +*<_migrated_from_country_> + gen migrated_from_country="" + replace migrated_from_country="" if migrated_binary!=1 + replace migrated_from_country="" if age + + +*<_migrated_reason_> + gen migrated_reason=. + replace migrated_reason=. if migrated_binary!=1 + replace migrated_reason=. if age +} + + +/*%%============================================================================================= + 6: Education +================================================================================================*/ + + +{ +*<_ed_mod_age_> + gen byte ed_mod_age=6 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=. + replace school=. if age + + +*<_literacy_> + gen byte literacy=. + replace literacy=0 if B15==1 + replace literacy=1 if inrange(B15,2,9) + replace literacy=. if age + + +*<_educy_> + gen byte educy=. + replace educy = 0 if B15 == 1 | B15 == 2 + replace educy = 4 if B15 == 3 + replace educy = 9 if B15 == 4 + replace educy = 12 if B15 == 5 + replace educy = 11 if B15 == 6 + replace educy = 15 if B15 == 7 + replace educy = 16 if B15 == 8 + replace educy = 20 if B15 == 9 + replace educy=. if ageage & !mi(educy) & !mi(age) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7= B15 + recode educat7 (6=5) (7=6) (8/9=7) + replace educat7=. if age + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + replace educat5=. if age + + +*<_educat4_> + gen byte educat4=educat5 + replace educat4=. if age + + +*<_educat_orig_> + gen educat_orig=B15 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + label var educat_isced "ISCED standardised level of education" +* + + +*<_educat_isced_v_> + gen educat_isced_v="ISCED-2011" + label var educat_isced_v "Version of the ISCED used" +* + +*----------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_isced +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +replace educat_isced_v="." if ( age < ed_mod_age & !missing(age) ) +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=. + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + 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=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen vocational_field_orig=. + replace vocational_field_orig=. if vocational!=1 + 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_> + +/*<_minlaborage_note_> + +The age range for the labor section is 15-75. + +*<_minlaborage_note_>*/ + + gen byte minlaborage=15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + +/*<_lstatus_note> + +According to the national definition of Armenia, the economically inavtive population +includes + +1)full-time pupils and students +2)housekeepers +3)pensioners +4)other jobless peope including conscripts + +And the economically inavtive population also needs to be within the age range of +15 and 75. +*<_lstatus_note>*/ + + gen byte lstatus=. + replace lstatus=1 if G1==1|inrange(G3,1,5)|inrange(G4,1,2) + replace lstatus=2 if lstatus==.&inrange(Z57,1,2) + replace lstatus=3 if !mi(Z49_4group)&lstatus==. + replace lstatus=. if !inrange(age,15,75) + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or inrange(E45,1,3) & (Z57==2) +2)searching but not immediately available to work or Z57==1 & inlist(E45,4,6) + +*/ + + gen potential_lf=. + replace potential_lf=1 if [inrange(E45,1,3) & (Z57==2)] | [Z57==1 & inlist(E45,4,6)] + replace potential_lf=0 if [inrange(E45,1,3) & (Z57==1)] | [Z57==1 & inrange(E45,1,3)] + replace potential_lf=. if age75&!mi(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=E41 + replace underemployment=1 if inrange(E41,1,3) + replace underemployment=0 if E41==4 + replace underemployment=. if age75&!mi(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=Z49_4group + recode nlfreason (4=5) + replace nlfreason=. if age75&!mi(age)] + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=Z52 + recode unempldur_l (1=0) (2=3) (3=12) (4=24) (5=36) + replace unempldur_l=. if age75&!mi(age)] + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=Z52 + recode unempldur_u (1=3) (2=12) (3=24) (4=36) (5=.) + replace unempldur_u=. if age75&!mi(age)] + 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=D8 + recode empstat (2 7=1) (5=4) (6=2) (8=5) + replace empstat=. if lstatus!=1|age + + +*<_ocusec_> + gen byte ocusec=D11 + recode ocusec (3 4=2) + replace ocusec=. if lstatus!=1|age + + +*<_industry_orig_> + gen industry_orig=D6_21group + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" +quietly +{ + replace industrycat_isic="A" if D6_21group==1 + replace industrycat_isic="B" if D6_21group==2 + replace industrycat_isic="C" if D6_21group==3 + replace industrycat_isic="D" if D6_21group==4 + replace industrycat_isic="E" if D6_21group==5 + replace industrycat_isic="F" if D6_21group==6 + replace industrycat_isic="G" if D6_21group==7 + replace industrycat_isic="H" if D6_21group==8 + replace industrycat_isic="I" if D6_21group==9 + replace industrycat_isic="J" if D6_21group==10 + replace industrycat_isic="K" if D6_21group==11 + replace industrycat_isic="L" if D6_21group==12 + replace industrycat_isic="M" if D6_21group==13 + replace industrycat_isic="N" if D6_21group==14 + replace industrycat_isic="O" if D6_21group==15 + replace industrycat_isic="P" if D6_21group==16 + replace industrycat_isic="Q" if D6_21group==17 + replace industrycat_isic="R" if D6_21group==18 + replace industrycat_isic="S" if D6_21group==19 + replace industrycat_isic="T" if D6_21group==20 + replace industrycat_isic="U" if D6_21group==21 +} + + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10=D6_21group + recode industrycat10 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10=. if lstatus!=1 + 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 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), 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=D5_9group + replace occup_orig=. if lstatus!=1|[age>75&!mi(age)] + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco="" + replace occup_isco="" if lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=D5_9group + replace occup_skill=1 if D5_9group==9 + replace occup_skill=2 if inrange(D5_9group, 4, 8) + replace occup_skill=3 if inrange(D5_9group, 1, 3) + replace occup_skill=. if lstatus!=1 + 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" +* + + +*<_occup_> + gen occup=D5_9group + replace occup=. if lstatus!=1|[age>75&!mi(age)] + 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 +* + + +*<_wage_no_compen_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into to parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry, occupation, income categories and gender to estimate their +specific income values. + +16.23% of total non-missing wage values were imputed using this method. + +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage14=D14_1+D14_2 + replace wage14=. if wage14==0 + + * First replace outliers by + winsor2 wage14, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat=. + replace salary_cat=1 if inrange(wage14_w, 1, 55000) + replace salary_cat=2 if wage14_w==55000 + replace salary_cat=3 if inrange(wage14_w, 55001, 110000) + replace salary_cat=4 if inrange(wage14_w, 110001, 220000) + replace salary_cat=5 if inrange(wage14_w, 220001, 440000) + replace salary_cat=6 if inrange(wage14_w, 440001, 600000) + replace salary_cat=7 if inrange(wage14_w, 600001, 700000) + replace salary_cat=8 if inrange(wage14_w, 700000, 99999999) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage14_w[iw=weight], by(industrycat10 occup male urban salary_cat) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage14_w wage_group_estimate + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat D15 + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat10 occup male urban D15 using "`salary_helper'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage14 if !mi(wage14)&mi(D15) + + * Now add the categorised means + replace wage_no_compen=wage_group_estimate if inrange(D15,1,8)&!mi(wage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" + +* + + +*<_unitwage_> + gen byte unitwage=D16 + recode unitwage (4=5) (5=7) (6=8) (7=10) + replace unitwage=. if lstatus!=1 | empstat==2 + 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=E39_1 + replace whours=. if lstatus!=1|E39_1==0 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths=. + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total=. + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + +/*<_contract_note_> + +There is no separate contract question in the questionnaire. +This contract variable was coded based on employment status question which asks +wether an employed respondent had a contract or not. + +*<_contract_note_>*/ + + gen byte contract = . + replace contract = (D8 == 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=. + replace healthins=1 if D9_6==1 + replace healthins=0 if D9_6==2 + replace healthins=. if lstatus!=1 + 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=. + replace socialsec=. if lstatus!=1 + 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=. + replace union=1 if D23==1 + replace union=0 if D23==2 + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=D13a + recode firmsize_l (1=1) (2=5) (3=10) (4=20) (5=50) (6=100) (7=.) + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=D13a + recode firmsize_u (1=5) (2=9) (3=19) (4=49) (5=99) (6=.) + 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=E27 + recode empstat_2 (2 7=1) (5=4) (6=2) + replace empstat_2=. if lstatus!=1|E24!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2=E29 + recode ocusec_2 (3 4=2) + replace ocusec_2=. if lstatus!=1|E24!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=E26_21group + replace industry_orig_2=. if lstatus!=1|E24!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" +quietly +{ + replace industrycat_isic_2="A" if E26_21group==1 + replace industrycat_isic_2="B" if E26_21group==2 + replace industrycat_isic_2="C" if E26_21group==3 + replace industrycat_isic_2="D" if E26_21group==4 + replace industrycat_isic_2="E" if E26_21group==5 + replace industrycat_isic_2="F" if E26_21group==6 + replace industrycat_isic_2="G" if E26_21group==7 + replace industrycat_isic_2="H" if E26_21group==8 + replace industrycat_isic_2="I" if E26_21group==9 + replace industrycat_isic_2="J" if E26_21group==10 + replace industrycat_isic_2="K" if E26_21group==11 + replace industrycat_isic_2="L" if E26_21group==12 + replace industrycat_isic_2="M" if E26_21group==13 + replace industrycat_isic_2="N" if E26_21group==14 + replace industrycat_isic_2="O" if E26_21group==15 + replace industrycat_isic_2="P" if E26_21group==16 + replace industrycat_isic_2="Q" if E26_21group==17 + replace industrycat_isic_2="R" if E26_21group==18 + replace industrycat_isic_2="S" if E26_21group==19 + replace industrycat_isic_2="T" if E26_21group==20 + replace industrycat_isic_2="U" if E26_21group==21 +} + + replace industrycat_isic_2="" if industrycat_isic_2=="."|E24!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen industrycat10_2=E26_21group + recode industrycat10_2 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10_2=. if lstatus!=1|E24!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=E25_9group + replace occup_orig_2=. if lstatus!=1|E24!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|E24!=1 + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2=E25_9group + replace occup_skill_2=1 if E25_9group==9 + replace occup_skill_2=2 if inrange(E25_9group,4,8) + replace occup_skill_2=3 if inrange(E25_9group,1,3) + replace occup_skill_2=. if E25_9group==0|lstatus!=1|E24!=1 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen occup_2=E25_9group + replace occup_2=. if lstatus!=1|E24!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + + gen wage32=E32_1+E32_2 + replace wage32=. if wage32==0 + + * First replace outliers by + winsor2 wage32, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat2=. + replace salary_cat2=1 if inrange(wage32_w, 1, 55000) + replace salary_cat2=3 if inrange(wage32_w, 55001, 110000) + replace salary_cat2=4 if inrange(wage32_w, 110001, 220000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage32_w[iw=weight], by(industrycat10_2 occup_2 male urban salary_cat2) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage32_w wage_group_estimate2 + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat2 E33 + tempfile salary_helper2 + save "`salary_helper2'" + + * Restore, merge in + restore + merge m:1 industrycat10_2 occup_2 male urban E33 using "`salary_helper2'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen_2=. + + * Fill it first with values that are accurate + replace wage_no_compen_2=wage32 if !mi(wage32)&mi(E33) + + * Now add the categorised means + replace wage_no_compen_2=wage_group_estimate2 if inrange(E33,1,5)&!mi(wage_group_estimate2) + + * Keep only for employed employees, label + replace wage_no_compen_2=. if E24!=1|empstat_2==2 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=E34 + recode unitwage_2 (4=5) (5=7) (6=8) (7=10) + replace unitwage_2=. if lstatus!=1|E24!=1 + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=E38_2 + replace whours_2=. if E38_2==0|E24!=1 + 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 byte firmsize_l_2=. + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte 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 primary & secondary jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others=. + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total=. + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total=. + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total=. + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + + +*<_potential_lf_year_> + gen byte potential_lf_year=. + replace potential_lf_year=. if age + + +*<_underemployment_year_> + gen byte underemployment_year=. + replace underemployment_year=. if age + + +*<_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 "Disable" 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 day 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="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + 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 "1 digit industry classification (Broad Economic Activities), 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 str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard 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 +* + + +*<_wage_no_compen_year_> + 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 byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte 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 day 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 "1 digit industry classification (Broad Economic Activities), 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_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard 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 +* + + +*<_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 byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte 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 primary & secondary 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=. + replace njobs=1 if lstatus==1&E24!=1 + replace njobs=2 if lstatus==1&E24==1 + replace njobs=. if lstatus!=1 + 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=. + 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'/`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/ARM/ARM_2018_LFS/ARM_2018_LFS_V01_M_V03_A_GLD/Programs/ARM_2018_LFS_V01_M_V03_A_GLD_ALL.do b/GLD/ARM/ARM_2018_LFS/ARM_2018_LFS_V01_M_V03_A_GLD/Programs/ARM_2018_LFS_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..27fae4b6f --- /dev/null +++ b/GLD/ARM/ARM_2018_LFS/ARM_2018_LFS_V01_M_V03_A_GLD/Programs/ARM_2018_LFS_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,1796 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> ARM_2018_LFS_V01_M_V03_A_GLD_ALL.do +<_Application_> Stata SE 18 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2023-12-20 +------------------------------------------------------------------------- +<_Country_> Armenia (ARM) +<_Survey Title_> National Labour Force Survey +<_Survey Year_> 2018 +<_Study ID_> ARM_2018_LFS_v01_M +<_Data collection from (M/Y)_> [01/2018] +<_Data collection to (M/Y)_> [12/2018] +<_Source of dataset_> The Armenian 2018 to 2021 data is downloaded from + the website of Statistical Committee of the + Republic of Armenia:https://armstat.am/en/?nid=212 + The data is publicly available. +<_Sample size (HH)_> 7,788 +<_Sample size (IND)_> 28,296 +<_Sampling method_> A stratified two-stage probability sample design + with 14 domains as the primary strata and 18,000 + households as the SSU. +<_Geographic coverage_> All 11 regions/marzes. +<_Currency_> Armenian Dram +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 19 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 08 +<_OCCUP National_> NSCO +<_ISIC Version_> ISIC Rev.4 +<_INDUS National_> ISIC Rev.4 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: 2024-09-24 - Update vars educy, educat7, educat_isced +* Date: 2024-10-10 - Include weight by quarter, old weight variable, correct contract variable, drop migration + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "ARM" +local year "2018" +local survey "LFS" +local vermast "V01" +local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file + + use "`path_in_stata'/ARM_LFS_2018_raw.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="LFS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-19" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + 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="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 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=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=A6_Month + 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_> + tostring A1, gen(hid) format(%03.0f) + tostring A6_Month, gen(month) format(%03.0f) + egen hhid=concat(month hid) + label var hhid "Household id" +* + + +*<_pid_> + sort hhid B4 + bys hhid: gen memberid=_n + tostring memberid, gen(id_str) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = WeightsCalib_Year + label var weight "Household sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + egen weight_q = rowtotal(WeightsCalib_1 WeightsCalib_2 WeightsCalib_3 WeightsCalib_4) + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_weight_old_series_> + gen weight_old_series = Weights_Year + label var weight_old_series "Household sampling weight - Old 2014-2017 series weight" +* + + +*<_weight_m_old_series_> + gen weight_m_old_series = . + label var weight_m_old_series "Survey sampling weight to obtain national estimates for each month - Old 2014-2017 series weight" +* + + +*<_weight_q_old_series_> + egen weight_q_old_series = rowtotal(Weights_1 Weights_2 Weights_3 Weights_4) + label var weight_q_old_series "Survey sampling weight to obtain national estimates for each quarter - Old 2014-2017 series weight" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + decode A3, gen(marzname) + decode A5, gen(urbanstat) + gen strata=marzname+" "+urbanstat + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=A5 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + gen subnatid1=A3 + tostring subnatid1, replace + replace subnatid1=subnatid1+" - "+marzname + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey=subnatid1+" "+urbanstat + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + bys hhid: egen hsize=max(memberid) + label var hsize "Household size" +* + + +*<_age_> + +/*<_age_note_> + +3 observations in the raw data set have negative (-1) age values. +They were coded as missing values in the harmonization. + +*<_age_note_>*/ + + gen age=Age + replace age=. if Age<0 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=B3 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + gen byte relationharm=B4 + recode relationharm (6 9=3) (7 8=4) (10=5) (11=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 +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=B4 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=B11 + recode marital (1=2) (2=1) (3=5) + 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=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + 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_> + gen byte ed_mod_age=6 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=B9 + recode school (2=0) (3/5=.) + replace school=. if age + + +*<_literacy_> + gen byte literacy=. + replace literacy=0 if B7==1 + replace literacy=1 if inrange(B7,2,11) + replace literacy=. if age + + +*<_educy_> + gen byte educy=. + replace educy = 0 if B7 == 1 | B7 == 2 + replace educy = 4 if B7 == 3 + replace educy = 9 if B7 == 4 + replace educy = 12 if B7 == 5 + replace educy = 11 if B7 == 6 + replace educy = 15 if B7 == 7 + replace educy = 16 if B7 == 8 + replace educy = 18 if B7 == 9 | B7 == 10 + replace educy = 20 if B7 == 11 + replace educy=. if ageage & !mi(educy) & !mi(age) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7= B7 + recode educat7 (6=5) (7=6) (8/11=7) + replace educat7=. if age + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + replace educat5=. if age + + +*<_educat4_> + gen byte educat4=educat5 + replace educat4=. if age + + +*<_educat_orig_> + gen educat_orig=B7 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + label var educat_isced "ISCED standardised level of education" +* + + +*<_educat_isced_v_> + gen educat_isced_v="ISCED-2011" + label var educat_isced_v "Version of the ISCED used" +* + +*----------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_isced +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +replace educat_isced_v="." if ( age < ed_mod_age & !missing(age) ) +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=. + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + 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=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen vocational_field_orig=. + replace vocational_field_orig=. if vocational!=1 + 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_> + +/*<_minlaborage_note_> + +The age range for the labor section is 15-75. + +*<_minlaborage_note_>*/ + + gen byte minlaborage=15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + +/*<_lstatus_note> + +The economically inavtive population also needs to be within the age range of +15 and 75. + +*<_lstatus_note>*/ + + gen byte lstatus=. + replace lstatus=1 if D1==1|inrange(D3,1,5)|D4==1|D5==1 + replace lstatus=2 if lstatus==.&inrange(J9,1,3) + replace lstatus=3 if !mi(J1_4group)&lstatus==. + replace lstatus=. if !inrange(age,15,75) + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or (J16==1)&J9==4 +2)searching but not immediately available to work or inrange(J9,1,3)&J16==2 + +*/ + + gen potential_lf=. + replace potential_lf=1 if [(J16==1)&J9==4] | [inrange(J9,1,3)&J16==2] + replace potential_lf=0 if [(J16==1)&inrange(J9,1,3)] | [inrange(J9,1,3)&J16==1] + replace potential_lf=. if age75&!mi(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=G4 + replace underemployment=1 if inrange(G4,1,3) + replace underemployment=0 if G4==4 + replace underemployment=. if age75&!mi(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=J1_4group + recode nlfreason (4=5) + replace nlfreason=. if age75&!mi(age)] + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=J4 + recode unempldur_l (1=0) (2=3) (3=6) (4=9) (5=12) (6=24) (7=36) + replace unempldur_l=. if age75&!mi(age)] + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=J4 + recode unempldur_u (1=3) (2=6) (3=9) (4=12) (5=24) (6=36) (7=.) + replace unempldur_u=. if age75&!mi(age)] + 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=E7 + recode empstat (2=1) (5=2) + replace empstat=. if lstatus!=1|age + + +*<_ocusec_> + gen byte ocusec=E10 + recode ocusec (3 4=2) + replace ocusec=. if lstatus!=1|age + + +*<_industry_orig_> + gen industry_orig=E4_21group + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" +quietly +{ + replace industrycat_isic="A" if E4_21group==1 + replace industrycat_isic="B" if E4_21group==2 + replace industrycat_isic="C" if E4_21group==3 + replace industrycat_isic="D" if E4_21group==4 + replace industrycat_isic="E" if E4_21group==5 + replace industrycat_isic="F" if E4_21group==6 + replace industrycat_isic="G" if E4_21group==7 + replace industrycat_isic="H" if E4_21group==8 + replace industrycat_isic="I" if E4_21group==9 + replace industrycat_isic="J" if E4_21group==10 + replace industrycat_isic="K" if E4_21group==11 + replace industrycat_isic="L" if E4_21group==12 + replace industrycat_isic="M" if E4_21group==13 + replace industrycat_isic="N" if E4_21group==14 + replace industrycat_isic="O" if E4_21group==15 + replace industrycat_isic="P" if E4_21group==16 + replace industrycat_isic="Q" if E4_21group==17 + replace industrycat_isic="R" if E4_21group==18 + replace industrycat_isic="S" if E4_21group==19 + replace industrycat_isic="T" if E4_21group==20 + replace industrycat_isic="U" if E4_21group==21 +} + + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10=E4_21group + recode industrycat10 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10=. if lstatus!=1 + 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 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), 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=E2_9group + replace occup_orig=. if lstatus!=1|[age>75&!mi(age)] + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco="" + replace occup_isco="" if lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=E2_9group + replace occup_skill=1 if E2_9group==9 + replace occup_skill=2 if inrange(E2_9group, 4, 8) + replace occup_skill=3 if inrange(E2_9group, 1, 3) + replace occup_skill=. if lstatus!=1 + 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" +* + + +*<_occup_> + gen occup=E2_9group + replace occup=. if lstatus!=1|[age>75&!mi(age)] + 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 +* + + +*<_wage_no_compen_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into to parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry, occupation, income categories and gender to estimate their +specific income values. + +20.71% of total non-missing wage values were imputed using this method. +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage14=E14_1+E14_2 + replace wage14=. if wage14==0 + + * First replace outliers by + winsor2 wage14, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat=. + replace salary_cat=1 if inrange(wage14_w, 1, 55000) + replace salary_cat=2 if wage14_w==55000 + replace salary_cat=3 if inrange(wage14_w, 55001, 110000) + replace salary_cat=4 if inrange(wage14_w, 110001, 220000) + replace salary_cat=5 if inrange(wage14_w, 220001, 440000) + replace salary_cat=6 if inrange(wage14_w, 440001, 600000) + replace salary_cat=7 if inrange(wage14_w, 600001, 700000) + replace salary_cat=8 if inrange(wage14_w, 700000, 99999999) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage14_w[iw=weight], by(industrycat10 occup male urban salary_cat) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage14_w wage_group_estimate + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat E15 + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat10 occup male urban E15 using "`salary_helper'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage14 if !mi(wage14)&mi(E15) + + * Now add the categorised means + replace wage_no_compen=wage_group_estimate if inrange(E15,1,8)&!mi(wage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=E16 + recode unitwage (4=5) (5=7) (6=8) (7=10) + replace unitwage=. if lstatus!=1 | empstat==2 + 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 = G2_1 + replace whours=. if lstatus!=1|G2_1==0 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths=. + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total=. + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + +/*<_contract_note_> + +There is no separate contract question in the questionnaire. +This contract variable was coded based on employment status question which asks +wether an employed respondent had a contract or not. + +*<_contract_note_>*/ + + gen byte contract = . + replace contract = (E7 == 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=. + replace healthins=1 if E8_f==1 + replace healthins=0 if E8_f==2 + replace healthins=. if lstatus!=1 + 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=. + replace socialsec=. if lstatus!=1 + 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=. + replace union=1 if E27==1 + replace union=0 if E27==2 + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=E13 + recode firmsize_l (1=1) (2=5) (3=10) (4=20) (5=50) (6=100) (7=.) + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=E13 + recode firmsize_u (1=5) (2=9) (3=19) (4=49) (5=99) (6=.) + 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=F4 + recode empstat_2 (2=1) (5=2) + replace empstat_2=. if lstatus!=1|F1!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2=F6 + recode ocusec_2 (3 4=2) + replace ocusec_2=. if lstatus!=1|F1!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=F3_21group + replace industry_orig_2=. if lstatus!=1|F1!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" +quietly +{ + replace industrycat_isic_2="A" if F3_21group==1 + replace industrycat_isic_2="B" if F3_21group==2 + replace industrycat_isic_2="C" if F3_21group==3 + replace industrycat_isic_2="D" if F3_21group==4 + replace industrycat_isic_2="E" if F3_21group==5 + replace industrycat_isic_2="F" if F3_21group==6 + replace industrycat_isic_2="G" if F3_21group==7 + replace industrycat_isic_2="H" if F3_21group==8 + replace industrycat_isic_2="I" if F3_21group==9 + replace industrycat_isic_2="J" if F3_21group==10 + replace industrycat_isic_2="K" if F3_21group==11 + replace industrycat_isic_2="L" if F3_21group==12 + replace industrycat_isic_2="M" if F3_21group==13 + replace industrycat_isic_2="N" if F3_21group==14 + replace industrycat_isic_2="O" if F3_21group==15 + replace industrycat_isic_2="P" if F3_21group==16 + replace industrycat_isic_2="Q" if F3_21group==17 + replace industrycat_isic_2="R" if F3_21group==18 + replace industrycat_isic_2="S" if F3_21group==19 + replace industrycat_isic_2="T" if F3_21group==20 + replace industrycat_isic_2="U" if F3_21group==21 +} + + replace industrycat_isic_2="" if industrycat_isic_2=="."|F1!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen industrycat10_2=F3_21group + recode industrycat10_2 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10_2=. if lstatus!=1|F1!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=F2_9group + replace occup_orig_2=. if lstatus!=1|F1!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|F1!=1 + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2=F2_9group + replace occup_skill_2=1 if F2_9group==9 + replace occup_skill_2=2 if inrange(F2_9group,4,8) + replace occup_skill_2=3 if inrange(F2_9group,1,3) + replace occup_skill_2=. if F2_9group==0|lstatus!=1|F1!=1 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen occup_2=F2_9group + replace occup_2=. if lstatus!=1|F1!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + +/*<_wage_no_compen_2_note_> + +The questionnaire actually has questions about income of the second job, just as the +main job. However, the data set does not have the variables. + +*<_wage_no_compen_2_note_>*/ + gen wage_no_compen_2=. + replace wage_no_compen_2=. if F1!=1|empstat_2==2 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + replace unitwage_2=. if lstatus!=1|F1!=1 + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=G2_2 + replace whours_2=. if G2_2==0|F1!=1 + 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 byte firmsize_l_2=. + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte 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 primary & secondary jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others=. + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total=. + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total=. + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total=. + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + + +*<_potential_lf_year_> + gen byte potential_lf_year=. + replace potential_lf_year=. if age + + +*<_underemployment_year_> + gen byte underemployment_year=. + replace underemployment_year=. if age + + +*<_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 "Disable" 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 day 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="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + 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 "1 digit industry classification (Broad Economic Activities), 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 str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard 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 +* + + +*<_wage_no_compen_year_> + 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 byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte 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 day 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 "1 digit industry classification (Broad Economic Activities), 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_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard 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 +* + + +*<_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 byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte 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 primary & secondary 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=. + replace njobs=1 if lstatus==1&F1!=1 + replace njobs=2 if lstatus==1&F1==1 + replace njobs=. if lstatus!=1 + 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=. + 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 weight_old_series weight_m_old_series weight_q_old_series psu 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 weight_old_series weight_m_old_series weight_q_old_series psu 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'/`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/ARM/ARM_2019_LFS/ARM_2019_LFS_V01_M_V03_A_GLD/Programs/ARM_2019_LFS_V01_M_V03_A_GLD_ALL.do b/GLD/ARM/ARM_2019_LFS/ARM_2019_LFS_V01_M_V03_A_GLD/Programs/ARM_2019_LFS_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..baa9dfe55 --- /dev/null +++ b/GLD/ARM/ARM_2019_LFS/ARM_2019_LFS_V01_M_V03_A_GLD/Programs/ARM_2019_LFS_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,1807 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> ARM_2019_LFS_V01_M_V03_A_GLD_ALL.do +<_Application_> Stata SE 18 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2024-1-05 +------------------------------------------------------------------------- +<_Country_> Armenia (ARM) +<_Survey Title_> National Labour Force Survey +<_Survey Year_> 2019 +<_Study ID_> ARM_2019_LFS_v01_M +<_Data collection from (M/Y)_> [01/2019] +<_Data collection to (M/Y)_> [12/2019] +<_Source of dataset_> The Armenian 2019 to 2021 data is downloaded from + the website of Statistical Committee of the + Republic of Armenia:https://armstat.am/en/?nid=212 + The data is publicly available. +<_Sample size (HH)_> 7,768 +<_Sample size (IND)_> 27,854 +<_Sampling method_> A stratified two-stage probability sample design + with 14 domains as the primary strata and 18,000 + households as the SSU. +<_Geographic coverage_> All 11 regions/marzes. +<_Currency_> Armenian Dram +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 19 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 08 +<_OCCUP National_> NSCO +<_ISIC Version_> ISIC Rev.4 +<_INDUS National_> ISIC Rev.4 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: 2024-09-24 - Update vars educy, educat7, educat_isced +* Date: 2024-10-10 - Include weight by quarter, old weight variable, correct contract variable, drop migration + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "ARM" +local year "2019" +local survey "LFS" +local vermast "V01" +local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file + +use "`path_in_stata'/ARM_LFS_2019_raw.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="LFS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-19" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + 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="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 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=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=A6_Month + 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_> + tostring A1, gen(hid) format(%03.0f) + tostring A6_Month, gen(month) format(%03.0f) + egen hhid=concat(month hid) + label var hhid "Household id" +* + + +*<_pid_> + sort hhid B4 + bys hhid: gen memberid=_n + tostring memberid, gen(id_str) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = WeightsCalib_year + label var weight "Household sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + egen weight_q = rowtotal(WeightsCalib_1 WeightsCalib_2 WeightsCalib_3 WeightsCalib_4) + label var weight_q "Survey sampling weight to obtain national estimates for each quarter" +* + + +*<_weight_old_series_> + gen weight_old_series = Weights_year + label var weight_old_series "Household sampling weight - Old 2014-2017 series weight" +* + + +*<_weight_m_old_series_> + gen weight_m_old_series = . + label var weight_m_old_series "Survey sampling weight to obtain national estimates for each month - Old 2014-2017 series weight" +* + + +*<_weight_q_old_series_> + egen weight_q_old_series = rowtotal(Weights_1 Weights_2 Weights_3 Weights_4) + label var weight_q_old_series "Survey sampling weight to obtain national estimates for each quarter - Old 2014-2017 series weight" +* + + +*<_psu_> + gen psu=. + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + decode A3, gen(marzname) + decode A5, gen(urbanstat) + gen strata=marzname+" "+urbanstat + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=A5 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + gen subnatid1=A3 + tostring subnatid1, replace + replace subnatid1=subnatid1+" - "+marzname + + * Unite names to entire series + replace subnatid1 = "7 - Kotayk" if subnatid1 == "7 - kotayk" + replace subnatid1 = "10 - Vayoc Dzor" if subnatid1 == "10 - Vayots dzor" + + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey=subnatid1+" "+urbanstat + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + bys hhid: egen hsize=max(memberid) + label var hsize "Household size" +* + + +*<_age_> + gen age=Age + replace age=. if Age<0 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=B3 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + +/*<_relationharm_note_> + +21 households (70 observations) in the raw data set do not have household heads. +Their household IDs are: + +001125 001258 001645 002341 002371 +002389 002391 003182 003346 003368 +003476 004351 005046 005355 006637 +007039 007188 007295 007570 009403 +012496 + +During the harmonization, we did not assign household heads to these households. +But users can assign household heads based on their relationship to the head and +other characteristics such as gender and age. + +*<_relationharm_note_>*/ + + gen byte relationharm=B4 + recode relationharm (6 9=3) (7 8=4) (10=5) (11=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 +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=B4 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=B11 + recode marital (1=2) (2=1) (3=5) + 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=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + 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_> + gen byte ed_mod_age=6 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=B9 + recode school (2=0) (3/5=.) + replace school=. if age + + +*<_literacy_> + gen byte literacy=. + replace literacy=0 if B7==1 + replace literacy=1 if inrange(B7,2,11) + replace literacy=. if age + + +*<_educy_> + gen byte educy=. + replace educy = 0 if B7 == 1 | B7 == 2 + replace educy = 4 if B7 == 3 + replace educy = 9 if B7 == 4 + replace educy = 12 if B7 == 5 + replace educy = 11 if B7 == 6 + replace educy = 15 if B7 == 7 + replace educy = 16 if B7 == 8 + replace educy = 18 if B7 == 9 | B7 == 10 + replace educy = 20 if B7 == 11 + replace educy=. if ageage & !mi(educy) & !mi(age) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7= B7 + recode educat7 (6=5) (7=6) (8/11=7) + replace educat7=. if age + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + replace educat5=. if age + + +*<_educat4_> + gen byte educat4=educat5 + replace educat4=. if age + + +*<_educat_orig_> + gen educat_orig=B7 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + label var educat_isced "ISCED standardised level of education" +* + + +*<_educat_isced_v_> + gen educat_isced_v="ISCED-2011" + label var educat_isced_v "Version of the ISCED used" +* + +*----------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_isced +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +replace educat_isced_v="." if ( age < ed_mod_age & !missing(age) ) +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=. + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + 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=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen vocational_field_orig=. + replace vocational_field_orig=. if vocational!=1 + 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_> + +/*<_minlaborage_note_> + +The age range for the labor section is 15-75. + +*<_minlaborage_note_>*/ + + gen byte minlaborage=15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + +/*<_lstatus_note> + +The economically inavtive population also needs to be within the age range of +15 and 75. + +*<_lstatus_note>*/ + + gen byte lstatus=. + replace lstatus=1 if D1==1|inrange(D3,1,5)|D4==1|D5==1 + replace lstatus=2 if lstatus==.&inrange(J9,1,3) + replace lstatus=3 if !mi(J1_4group)&lstatus==. + replace lstatus=. if !inrange(age,15,75) + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or (J16==1)&J9==4 +2)searching but not immediately available to work or inrange(J9,1,3)&J16==2 + +*/ + + gen potential_lf=. + replace potential_lf=1 if [(J16==1)&J9==4] | [inrange(J9,1,3)&J16==2] + replace potential_lf=0 if [(J16==1)&inrange(J9,1,3)] | [inrange(J9,1,3)&J16==1] + replace potential_lf=. if age75&!mi(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=G4 + replace underemployment=1 if inrange(G4,1,3) + replace underemployment=0 if G4==4 + replace underemployment=. if age75&!mi(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=J1_4group + recode nlfreason (4=5) + replace nlfreason=. if age75&!mi(age)] + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=J4 + recode unempldur_l (1=0) (2=3) (3=6) (4=9) (5=12) (6=24) (7=36) + replace unempldur_l=. if age75&!mi(age)] + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=J4 + recode unempldur_u (1=3) (2=6) (3=9) (4=12) (5=24) (6=36) (7=.) + replace unempldur_u=. if age75&!mi(age)] + 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=E7 + recode empstat (2=1) (5=2) (7=5) + replace empstat=. if lstatus!=1|age + + +*<_ocusec_> + gen byte ocusec=E10 + recode ocusec (3 4=2) + replace ocusec=. if lstatus!=1|age + + +*<_industry_orig_> + gen industry_orig=E4_21group + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" +quietly +{ + replace industrycat_isic="A" if E4_21group==1 + replace industrycat_isic="B" if E4_21group==2 + replace industrycat_isic="C" if E4_21group==3 + replace industrycat_isic="D" if E4_21group==4 + replace industrycat_isic="E" if E4_21group==5 + replace industrycat_isic="F" if E4_21group==6 + replace industrycat_isic="G" if E4_21group==7 + replace industrycat_isic="H" if E4_21group==8 + replace industrycat_isic="I" if E4_21group==9 + replace industrycat_isic="J" if E4_21group==10 + replace industrycat_isic="K" if E4_21group==11 + replace industrycat_isic="L" if E4_21group==12 + replace industrycat_isic="M" if E4_21group==13 + replace industrycat_isic="N" if E4_21group==14 + replace industrycat_isic="O" if E4_21group==15 + replace industrycat_isic="P" if E4_21group==16 + replace industrycat_isic="Q" if E4_21group==17 + replace industrycat_isic="R" if E4_21group==18 + replace industrycat_isic="S" if E4_21group==19 + replace industrycat_isic="T" if E4_21group==20 + replace industrycat_isic="U" if E4_21group==21 +} + + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10=E4_21group + recode industrycat10 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10=. if lstatus!=1 + 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 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), 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=E2_9group + replace occup_orig=. if lstatus!=1|[age>75&!mi(age)] + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco="" + replace occup_isco="" if lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=E2_9group + replace occup_skill=1 if E2_9group==9 + replace occup_skill=2 if inrange(E2_9group, 4, 8) + replace occup_skill=3 if inrange(E2_9group, 1, 3) + replace occup_skill=. if lstatus!=1 + 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" +* + + +*<_occup_> + gen occup=E2_9group + replace occup=. if lstatus!=1|[age>75&!mi(age)] + 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 +* + + +*<_wage_no_compen_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into to parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry, occupation, income categories and gender to estimate their +specific income values. + +17.33% of total non-missing wage values were imputed using this method. +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage14=E14_1+E14_2 + replace wage14=. if wage14==0 + + * First replace outliers by + winsor2 wage14, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat=. + replace salary_cat=1 if inrange(wage14_w, 1, 55000) + replace salary_cat=2 if wage14_w==55000 + replace salary_cat=3 if inrange(wage14_w, 55001, 110000) + replace salary_cat=4 if inrange(wage14_w, 110001, 220000) + replace salary_cat=5 if inrange(wage14_w, 220001, 440000) + replace salary_cat=6 if inrange(wage14_w, 440001, 600000) + replace salary_cat=7 if inrange(wage14_w, 600001, 700000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage14_w[iw=weight], by(industrycat10 occup male urban salary_cat) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage14_w wage_group_estimate + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat E15 + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat10 occup male urban E15 using "`salary_helper'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage14 if !mi(wage14)&mi(E15) + + * Now add the categorised means + replace wage_no_compen=wage_group_estimate if inrange(E15,1,8)&!mi(wage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=E16 + recode unitwage (4=5) (5=7) (6=8) (7=10) + replace unitwage=. if lstatus!=1 | empstat==2 + 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=G2_1 + replace whours=. if lstatus!=1|G2_1==0 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths=. + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total=. + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + +/*<_contract_note_> + +There is no separate contract question in the questionnaire. +This contract variable was coded based on employment status question which asks +wether an employed respondent had a contract or not. + +*<_contract_note_>*/ + + gen byte contract = . + replace contract = (E7 == 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=. + replace healthins=1 if E8_f==1 + replace healthins=0 if E8_f==2 + replace healthins=. if lstatus!=1 + 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=. + replace socialsec=. if lstatus!=1 + 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=. + replace union=1 if E27==1 + replace union=0 if E27==2 + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=E13 + recode firmsize_l (1=1) (2=5) (3=10) (4=20) (5=50) (6=100) (7=.) + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=E13 + recode firmsize_u (1=5) (2=9) (3=19) (4=49) (5=99) (6=.) + 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=F4 + recode empstat_2 (2=1) (5=2) + replace empstat_2=. if lstatus!=1|F1!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2=F6 + recode ocusec_2 (3 4=2) + replace ocusec_2=. if lstatus!=1|F1!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=F3_21group + replace industry_orig_2=. if lstatus!=1|F1!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" +quietly +{ + replace industrycat_isic_2="A" if F3_21group==1 + replace industrycat_isic_2="B" if F3_21group==2 + replace industrycat_isic_2="C" if F3_21group==3 + replace industrycat_isic_2="D" if F3_21group==4 + replace industrycat_isic_2="E" if F3_21group==5 + replace industrycat_isic_2="F" if F3_21group==6 + replace industrycat_isic_2="G" if F3_21group==7 + replace industrycat_isic_2="H" if F3_21group==8 + replace industrycat_isic_2="I" if F3_21group==9 + replace industrycat_isic_2="J" if F3_21group==10 + replace industrycat_isic_2="K" if F3_21group==11 + replace industrycat_isic_2="L" if F3_21group==12 + replace industrycat_isic_2="M" if F3_21group==13 + replace industrycat_isic_2="N" if F3_21group==14 + replace industrycat_isic_2="O" if F3_21group==15 + replace industrycat_isic_2="P" if F3_21group==16 + replace industrycat_isic_2="Q" if F3_21group==17 + replace industrycat_isic_2="R" if F3_21group==18 + replace industrycat_isic_2="S" if F3_21group==19 + replace industrycat_isic_2="T" if F3_21group==20 + replace industrycat_isic_2="U" if F3_21group==21 +} + + replace industrycat_isic_2="" if industrycat_isic_2=="."|F1!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen industrycat10_2=F3_21group + recode industrycat10_2 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10_2=. if lstatus!=1|F1!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=F2_9group + replace occup_orig_2=. if lstatus!=1|F1!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|F1!=1 + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2=F2_9group + replace occup_skill_2=1 if F2_9group==9 + replace occup_skill_2=2 if inrange(F2_9group,4,8) + replace occup_skill_2=3 if inrange(F2_9group,1,3) + replace occup_skill_2=. if F2_9group==0|lstatus!=1|F1!=1 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen occup_2=F2_9group + replace occup_2=. if lstatus!=1|F1!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + +/*<_wage_no_compen_2_note_> + +The questionnaire actually has questions about income of the second job, just as the +main job. However, the data set does not have the variables. + +*<_wage_no_compen_2_note_>*/ + gen wage_no_compen_2=. + replace wage_no_compen_2=. if F1!=1|empstat_2==2 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + replace unitwage_2=. if lstatus!=1|F1!=1 + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=G2_2 + replace whours_2=. if G2_2==0|F1!=1 + 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 byte firmsize_l_2=. + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte 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 primary & secondary jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others=. + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total=. + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total=. + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total=. + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + + +*<_potential_lf_year_> + gen byte potential_lf_year=. + replace potential_lf_year=. if age + + +*<_underemployment_year_> + gen byte underemployment_year=. + replace underemployment_year=. if age + + +*<_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 "Disable" 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 day 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="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + 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 "1 digit industry classification (Broad Economic Activities), 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 str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard 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 +* + + +*<_wage_no_compen_year_> + 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 byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte 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 day 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 "1 digit industry classification (Broad Economic Activities), 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_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard 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 +* + + +*<_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 byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte 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 primary & secondary 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=. + replace njobs=1 if lstatus==1&F1!=1 + replace njobs=2 if lstatus==1&F1==1 + replace njobs=. if lstatus!=1 + 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=. + 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 weight_old_series weight_m_old_series weight_q_old_series psu 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 weight_old_series weight_m_old_series weight_q_old_series psu 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'/`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/ARM/ARM_2020_LFS/ARM_2020_LFS_V01_M_V03_A_GLD/Programs/ARM_2020_LFS_V01_M_V03_A_GLD_ALL.do b/GLD/ARM/ARM_2020_LFS/ARM_2020_LFS_V01_M_V03_A_GLD/Programs/ARM_2020_LFS_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..9c1b79975 --- /dev/null +++ b/GLD/ARM/ARM_2020_LFS/ARM_2020_LFS_V01_M_V03_A_GLD/Programs/ARM_2020_LFS_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,1785 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> ARM_2020_LFS_V01_M_V03_A_GLD_ALL.do +<_Application_> Stata SE 18 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2024-1-10 +------------------------------------------------------------------------- +<_Country_> Armenia (ARM) +<_Survey Title_> National Labour Force Survey +<_Survey Year_> 2020 +<_Study ID_> ARM_2020_LFS_v01_M +<_Data collection from (M/Y)_> [01/2020] +<_Data collection to (M/Y)_> [12/2020] +<_Source of dataset_> The Armenian 2020 to 2021 data is downloaded from + the website of Statistical Committee of the + Republic of Armenia:https://armstat.am/en/?nid=212 + The data is publicly available. +<_Sample size (HH)_> 7,781 +<_Sample size (IND)_> 27,986 +<_Sampling method_> A stratified two-stage probability sample design + with 14 domains as the primary strata and 18,000 + households as the SSU. +<_Geographic coverage_> All 11 regions/marzes. +<_Currency_> Armenian Dram +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 19 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 08 +<_OCCUP National_> NSCO +<_ISIC Version_> ISIC Rev.4 +<_INDUS National_> ISIC Rev.4 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: 2024-09-24 - Update vars educy, educat7, educat_isced +* Date: 2024-10-10 - Include weight by quarter, old weight variable, correct contract variable, drop migration + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "ARM" +local year "2020" +local survey "LFS" +local vermast "V01" +local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file + +use "`path_in_stata'/ARM_LFS_2020_raw.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="LFS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-19" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + 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="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 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=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=A6_Month + 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_> + tostring A1, gen(hid) format(%03.0f) + tostring A6_Month, gen(month) format(%03.0f) + egen hhid=concat(month hid) + label var hhid "Household id" +* + + +*<_pid_> + sort hhid B4 + bys hhid: gen memberid=_n + tostring memberid, gen(id_str) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = WeightsCalib_year + label var weight "Household sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + egen weight_q = rowtotal(WeightsCalib_1 WeightsCalib_2 WeightsCalib_3 WeightsCalib_4) + 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=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + decode A3, gen(marzname) + decode A5, gen(urbanstat) + gen strata=marzname+" "+urbanstat + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=A5 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + gen subnatid1=A3 + tostring subnatid1, replace + replace subnatid1=subnatid1+" - "+marzname + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey=subnatid1+" "+urbanstat + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + bys hhid: egen hsize=max(memberid) + label var hsize "Household size" +* + + +*<_age_> + gen age=Age + replace age=. if Age<0 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=B3 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + +/*<_relationharm_note_> + +6 households (24 observations) in the raw data set do not have household heads. +Their household IDs are: + +003430 004285 005503 +006281 006305 012044 + +During the harmonization, we did not assign household heads to these households. +But users can assign household heads based on their relationship to the head and +other characteristics such as gender and age. + +*<_relationharm_note_>*/ + + gen byte relationharm=B4 + recode relationharm (6 9=3) (7 8=4) (10=5) (11=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 +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=B4 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=B11 + recode marital (1=2) (2=1) (3=5) + 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=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + 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_> + gen byte ed_mod_age=6 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=B9 + recode school (2=0) (3/5=.) + replace school=. if age + + +*<_literacy_> + gen byte literacy=. + replace literacy=0 if B7==1 + replace literacy=1 if inrange(B7,2,11) + replace literacy=. if age + + +*<_educy_> + gen byte educy=. + replace educy = 0 if B7 == 1 | B7 == 2 + replace educy = 4 if B7 == 3 + replace educy = 9 if B7 == 4 + replace educy = 12 if B7 == 5 + replace educy = 11 if B7 == 6 + replace educy = 15 if B7 == 7 + replace educy = 16 if B7 == 8 + replace educy = 18 if B7 == 9 | B7 == 10 + replace educy = 20 if B7 == 11 + replace educy=. if ageage & !mi(educy) & !mi(age) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7= B7 + recode educat7 (6=5) (7=6) (8/11=7) + replace educat7=. if age + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + replace educat5=. if age + + +*<_educat4_> + gen byte educat4=educat5 + replace educat4=. if age + + +*<_educat_orig_> + gen educat_orig=B7 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + label var educat_isced "ISCED standardised level of education" +* + + +*<_educat_isced_v_> + gen educat_isced_v="ISCED-2011" + label var educat_isced_v "Version of the ISCED used" +* + +*----------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_isced +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +replace educat_isced_v="." if ( age < ed_mod_age & !missing(age) ) +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=. + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + 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=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen vocational_field_orig=. + replace vocational_field_orig=. if vocational!=1 + 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_> + +/*<_minlaborage_note_> + +The age range for the labor section is 15-75. + +*<_minlaborage_note_>*/ + + gen byte minlaborage=15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + +/*<_lstatus_note> + +The economically inavtive population also needs to be within the age range of +15 and 75. + +*<_lstatus_note>*/ + + gen byte lstatus=. + replace lstatus=1 if D1==1|inrange(D3,1,5)|D4==1|D5==1 + replace lstatus=2 if lstatus==.&inrange(J9,1,3) + replace lstatus=3 if !mi(J1_6group)&lstatus==. + replace lstatus=. if !inrange(age,15,75) + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or (J16==1)&J9==4 +2)searching but not immediately available to work or inrange(J9,1,3)&J16==2 + +*/ + + gen potential_lf=. + replace potential_lf=1 if [(J16==1)&J9==4] | [inrange(J9,1,3)&J16==2] + replace potential_lf=0 if [(J16==1)&inrange(J9,1,3)] | [inrange(J9,1,3)&J16==1] + replace potential_lf=. if age75&!mi(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=G4 + replace underemployment=1 if inrange(G4,1,3) + replace underemployment=0 if G4==4 + replace underemployment=. if age75&!mi(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=J1_6group + recode nlfreason (4/6=5) + replace nlfreason=. if age75&!mi(age)] + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=J4 + recode unempldur_l (1=0) (2=3) (3=6) (4=9) (5=12) (6=24) (7=36) + replace unempldur_l=. if age75&!mi(age)] + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=J4 + recode unempldur_u (1=3) (2=6) (3=9) (4=12) (5=24) (6=36) (7 10=.) + replace unempldur_u=. if age75&!mi(age)] + 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=E7 + recode empstat (2 6=1) (5=2) + replace empstat=. if lstatus!=1|age + + +*<_ocusec_> + gen byte ocusec=E10 + recode ocusec (3 4=2) + replace ocusec=. if lstatus!=1|age + + +*<_industry_orig_> + gen industry_orig=E4_21group + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" +quietly +{ + replace industrycat_isic="A" if E4_21group==1 + replace industrycat_isic="B" if E4_21group==2 + replace industrycat_isic="C" if E4_21group==3 + replace industrycat_isic="D" if E4_21group==4 + replace industrycat_isic="E" if E4_21group==5 + replace industrycat_isic="F" if E4_21group==6 + replace industrycat_isic="G" if E4_21group==7 + replace industrycat_isic="H" if E4_21group==8 + replace industrycat_isic="I" if E4_21group==9 + replace industrycat_isic="J" if E4_21group==10 + replace industrycat_isic="K" if E4_21group==11 + replace industrycat_isic="L" if E4_21group==12 + replace industrycat_isic="M" if E4_21group==13 + replace industrycat_isic="N" if E4_21group==14 + replace industrycat_isic="O" if E4_21group==15 + replace industrycat_isic="P" if E4_21group==16 + replace industrycat_isic="Q" if E4_21group==17 + replace industrycat_isic="R" if E4_21group==18 + replace industrycat_isic="S" if E4_21group==19 + replace industrycat_isic="T" if E4_21group==20 + replace industrycat_isic="U" if E4_21group==21 +} + + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10=E4_21group + recode industrycat10 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10=. if lstatus!=1 + 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 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), 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=E2_9group + replace occup_orig=. if lstatus!=1|[age>75&!mi(age)] + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco="" + replace occup_isco="" if lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=E2_9group + replace occup_skill=1 if E2_9group==9 + replace occup_skill=2 if inrange(E2_9group, 4, 8) + replace occup_skill=3 if inrange(E2_9group, 1, 3) + replace occup_skill=. if lstatus!=1 + 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" +* + + +*<_occup_> + gen occup=E2_9group + replace occup=. if lstatus!=1|[age>75&!mi(age)] + 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 +* + + +*<_wage_no_compen_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into to parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry, occupation, income categories and gender to estimate their +specific income values. + +18.04% of total non-missing wage values were imputed using this method. +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage14=E14_1+E14_2 + replace wage14=. if wage14==0 + + * First replace outliers by + winsor2 wage14, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat=. + replace salary_cat=1 if inrange(wage14_w, 1, 55000) + replace salary_cat=2 if wage14_w==55000 + replace salary_cat=3 if inrange(wage14_w, 55001, 110000) + replace salary_cat=4 if inrange(wage14_w, 110001, 220000) + replace salary_cat=5 if inrange(wage14_w, 220001, 440000) + replace salary_cat=6 if inrange(wage14_w, 440001, 600000) + replace salary_cat=7 if inrange(wage14_w, 600001, 700000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage14_w[iw=weight], by(industrycat10 occup male urban salary_cat) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage14_w wage_group_estimate + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat E15 + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat10 occup male urban E15 using "`salary_helper'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage14 if !mi(wage14)&mi(E15) + + * Now add the categorised means + replace wage_no_compen=wage_group_estimate if inrange(E15,1,8)&!mi(wage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=E16 + recode unitwage (4=5) (5=7) (6=8) (7=10) + replace unitwage=. if lstatus!=1 | empstat==2 + 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=G2_1 + replace whours=. if lstatus!=1|G2_1==0 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths=. + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total=. + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + +/*<_contract_note_> + +There is no separate contract question in the questionnaire. +This contract variable was coded based on employment status question which asks +wether an employed respondent had a contract or not. + +*<_contract_note_>*/ + + gen byte contract = . + replace contract = (E7 == 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=. + replace healthins=1 if E8_f==1 + replace healthins=0 if E8_f==2 + replace healthins=. if lstatus!=1 + 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=. + replace socialsec=. if lstatus!=1 + 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=. + replace union=1 if E27==1 + replace union=0 if E27==2 + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=E13 + recode firmsize_l (1=1) (2=5) (3=10) (4=20) (5=50) (6=100) (7=.) + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=E13 + recode firmsize_u (1=5) (2=9) (3=19) (4=49) (5=99) (6=.) + 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=F4 + recode empstat_2 (2=1) (5=2) + replace empstat_2=. if lstatus!=1|F1!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2=F6 + recode ocusec_2 (3 4=2) + replace ocusec_2=. if lstatus!=1|F1!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=F3_21group + replace industry_orig_2=. if lstatus!=1|F1!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" +quietly +{ + replace industrycat_isic_2="A" if F3_21group==1 + replace industrycat_isic_2="B" if F3_21group==2 + replace industrycat_isic_2="C" if F3_21group==3 + replace industrycat_isic_2="D" if F3_21group==4 + replace industrycat_isic_2="E" if F3_21group==5 + replace industrycat_isic_2="F" if F3_21group==6 + replace industrycat_isic_2="G" if F3_21group==7 + replace industrycat_isic_2="H" if F3_21group==8 + replace industrycat_isic_2="I" if F3_21group==9 + replace industrycat_isic_2="J" if F3_21group==10 + replace industrycat_isic_2="K" if F3_21group==11 + replace industrycat_isic_2="L" if F3_21group==12 + replace industrycat_isic_2="M" if F3_21group==13 + replace industrycat_isic_2="N" if F3_21group==14 + replace industrycat_isic_2="O" if F3_21group==15 + replace industrycat_isic_2="P" if F3_21group==16 + replace industrycat_isic_2="Q" if F3_21group==17 + replace industrycat_isic_2="R" if F3_21group==18 + replace industrycat_isic_2="S" if F3_21group==19 + replace industrycat_isic_2="T" if F3_21group==20 + replace industrycat_isic_2="U" if F3_21group==21 +} + + replace industrycat_isic_2="" if industrycat_isic_2=="."|F1!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen industrycat10_2=F3_21group + recode industrycat10_2 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10_2=. if lstatus!=1|F1!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=F2_9group + replace occup_orig_2=. if lstatus!=1|F1!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|F1!=1 + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2=F2_9group + replace occup_skill_2=1 if F2_9group==9 + replace occup_skill_2=2 if inrange(F2_9group,4,8) + replace occup_skill_2=3 if inrange(F2_9group,1,3) + replace occup_skill_2=. if F2_9group==0|lstatus!=1|F1!=1 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen occup_2=F2_9group + replace occup_2=. if lstatus!=1|F1!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + +/*<_wage_no_compen_2_note_> + +The questionnaire actually has questions about income of the second job, just as the +main job. However, the data set does not have the variables. + +*<_wage_no_compen_2_note_>*/ + gen wage_no_compen_2=. + replace wage_no_compen_2=. if F1!=1|empstat_2==2 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + replace unitwage_2=. if lstatus!=1|F1!=1 + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=G2_2 + replace whours_2=. if G2_2==0|F1!=1 + 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 byte firmsize_l_2=. + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte 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 primary & secondary jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_others_> + gen t_wage_others=. + label var t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* + + +*----------8.5: 7 day reference total summary------------------------------* + + +*<_t_hours_total_> + gen t_hours_total=. + label var t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + + +*<_t_wage_nocompen_total_> + gen t_wage_nocompen_total=. + label var t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + + +*<_t_wage_total_> + gen t_wage_total=. + label var t_wage_total "Annualized total wage for all jobs 7 day recall" +* + + +*----------8.6: 12 month reference overall------------------------------* + +{ +*<_lstatus_year_> + gen byte lstatus_year=. + replace lstatus_year=. if age + + +*<_potential_lf_year_> + gen byte potential_lf_year=. + replace potential_lf_year=. if age + + +*<_underemployment_year_> + gen byte underemployment_year=. + replace underemployment_year=. if age + + +*<_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 "Disable" 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 day 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="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + 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 "1 digit industry classification (Broad Economic Activities), 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 str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard 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 +* + + +*<_wage_no_compen_year_> + 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 byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte 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 day 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 "1 digit industry classification (Broad Economic Activities), 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_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard 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 +* + + +*<_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 byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte 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 primary & secondary 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=. + replace njobs=1 if lstatus==1&F1!=1 + replace njobs=2 if lstatus==1&F1==1 + replace njobs=. if lstatus!=1 + 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=. + 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 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 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'/`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/ARM/ARM_2021_LFS/ARM_2021_LFS_V01_M_V03_A_GLD/Programs/ARM_2021_LFS_V01_M_V03_A_GLD_ALL.do b/GLD/ARM/ARM_2021_LFS/ARM_2021_LFS_V01_M_V03_A_GLD/Programs/ARM_2021_LFS_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..59a968b26 --- /dev/null +++ b/GLD/ARM/ARM_2021_LFS/ARM_2021_LFS_V01_M_V03_A_GLD/Programs/ARM_2021_LFS_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,1795 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> ARM_2021_LFS_V01_M_V03_A_GLD_ALL.do +<_Application_> Stata SE 18 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2024-1-10 +------------------------------------------------------------------------- +<_Country_> Armenia (ARM) +<_Survey Title_> National Labour Force Survey +<_Survey Year_> 2021 +<_Study ID_> ARM_2021_LFS_v01_M +<_Data collection from (M/Y)_> [01/2021] +<_Data collection to (M/Y)_> [12/2021] +<_Source of dataset_> The Armenian 2021 to 2021 data is downloaded from + the website of Statistical Committee of the + Republic of Armenia:https://armstat.am/en/?nid=212 + The data is publicly available. +<_Sample size (HH)_> 7,776 +<_Sample size (IND)_> 26,923 +<_Sampling method_> A stratified two-stage probability sample design + with 14 domains as the primary strata and 18,000 + households as the SSU. +<_Geographic coverage_> All 11 regions/marzes. +<_Currency_> Armenian Dram +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 19 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 08 +<_OCCUP National_> NSCO +<_ISIC Version_> ISIC Rev.4 +<_INDUS National_> ISIC Rev.4 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: 2024-09-24 - Update vars educy, educat7, educat_isced +* Date: 2024-10-10 - Include weight by quarter, old weight variable, correct contract variable, drop migration + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "ARM" +local year "2021" +local survey "LFS" +local vermast "V01" +local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file + +use "`path_in_stata'/ARM_LFS_2021_raw.dta", clear +rename (E2_9groups_ISCO_88 _v1 F2_9groups_ISCO_88 _v2) (E2_9group E4_21group F2_9group F3_21group) + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="LFS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-19" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + 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="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 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=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=A6_Month + 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_> + tostring A1, gen(hid) format(%03.0f) + tostring A6_Month, gen(month) format(%03.0f) + egen hhid=concat(month hid) + label var hhid "Household id" +* + + +*<_pid_> + sort hhid B4 + bys hhid: gen memberid=_n + tostring memberid, gen(id_str) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = WeightsCalib_year + label var weight "Household sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + egen weight_q = rowtotal(WeightsCalib_1 WeightsCalib_2 WeightsCalib_3 WeightsCalib_4) + 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=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + decode A3, gen(marzname) + decode A5, gen(urbanstat) + gen strata=marzname + " " + urbanstat + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=A5 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + gen subnatid1=A3 + tostring subnatid1, replace + replace subnatid1=subnatid1+" - "+marzname + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey=subnatid1+" "+urbanstat + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + bys hhid: egen hsize=max(memberid) + label var hsize "Household size" +* + + +*<_age_> + +/*<_age_note_> + +Because the raw data in 2021 and 2022 do not have each observation's actual age, +and instead, they only have age in age groups. Here we coded age using the mean of +each age group to proceed with other variables and our quality checks. Therefore, +the age variable only represents the age group the observation is in. + +*<_age_note_>*/ + + gen age=. + replace age=(Age_16groups-1)*5+2 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=B3 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + +/*<_relationharm_note_> + +7 households (27 observations) in the raw data set do not have household heads. +Their household IDs are: + +003331 004606 007502 +009139 009481 012302 +012648 + +During the harmonization, we did not assign household heads to these households. +But users can assign household heads based on their relationship to the head and +other characteristics such as gender and age. + +*<_relationharm_note_>*/ + + gen byte relationharm=B4 + recode relationharm (6 9=3) (7 8=4) (10=5) (11=6) + replace relationharm=5 if pid=="009002-02" + 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 +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=B4 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=B11 + recode marital (1=2) (2=1) (3=5) + 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=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + 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_> + gen byte ed_mod_age=6 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=B9 + recode school (2=0) (3/5=.) + replace school=. if !inrange(Age_16groups,2,16) + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=0 if B7==1 + replace literacy=1 if inrange(B7,2,11) + replace literacy=. if !inrange(Age_16groups,2,16) + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + replace educy = 0 if B7 == 1 | B7 == 2 + replace educy = 4 if B7 == 3 + replace educy = 9 if B7 == 4 + replace educy = 12 if B7 == 5 + replace educy = 11 if B7 == 6 + replace educy = 15 if B7 == 7 + replace educy = 16 if B7 == 8 + replace educy = 18 if B7 == 9 | B7 == 10 + replace educy = 20 if B7 == 11 + replace educy=. if ageage & !mi(educy) & !mi(age) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7= B7 + recode educat7 (6=5) (7=6) (8/11=7) + replace educat7=. if age + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + replace educat5=. if !inrange(Age_16groups,2,16) + 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=educat5 + replace educat4=. if !inrange(Age_16groups,2,16) + recode educat4 (3=2) (4=3) (5=4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig=B7 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + label var educat_isced "ISCED standardised level of education" +* + + +*<_educat_isced_v_> + gen educat_isced_v="ISCED-2011" + label var educat_isced_v "Version of the ISCED used" +* + +*----------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_isced +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +replace educat_isced_v="." if ( age < ed_mod_age & !missing(age) ) +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=. + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + 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=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen vocational_field_orig=. + replace vocational_field_orig=. if vocational!=1 + 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_> + +/*<_minlaborage_note_> + +The age range for the labor section is 15-75. + +*<_minlaborage_note_>*/ + + gen byte minlaborage=15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + +/*<_lstatus_note> + +The economically inavtive population also needs to be within the age range of +15 and 75. + +*<_lstatus_note>*/ + + gen byte lstatus=. + replace lstatus=1 if D1==1|inrange(D3,1,5)|D4==1|D5==1 + replace lstatus=2 if lstatus==.&inrange(J9,1,3) + replace lstatus=3 if !mi(J1_4groups)&lstatus==. + replace lstatus=. if !inrange(Age_16groups,4,16) + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or (J16==1)&J9==4 +2)searching but not immediately available to work or inrange(J9,1,3)&J16==2 + +*/ + + gen potential_lf=. + replace potential_lf=1 if [(J16==1)&J9==4] | [inrange(J9,1,3)&J16==2] + replace potential_lf=0 if [(J16==1)&inrange(J9,1,3)] | [inrange(J9,1,3)&J16==1] + replace potential_lf=. if !inrange(Age_16groups,4,16) + 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=G4 + replace underemployment=1 if inrange(G4,1,3) + replace underemployment=0 if G4==4 + replace underemployment=. if !inrange(Age_16groups,4,16) + 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=J1_4group + recode nlfreason (4=5) + replace nlfreason=. if !inrange(Age_16groups,4,16) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=J4 + recode unempldur_l (1=0) (2=3) (3=6) (4=9) (5=12) (6=24) (7=36) + replace unempldur_l=. if !inrange(Age_16groups,4,16) + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=J4 + recode unempldur_u (1=3) (2=6) (3=9) (4=12) (5=24) (6=36) (7 10=.) + replace unempldur_u=. if !inrange(Age_16groups,4,16) + 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=E7 + recode empstat (2 6=1) (5=2) + replace empstat=. if lstatus!=1|!inrange(Age_16groups,4,16) + 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=E10 + recode ocusec (3 4=2) + replace ocusec=. if lstatus!=1|!inrange(Age_16groups,4,16) + 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=E4_21group + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" +quietly +{ + replace industrycat_isic="A" if E4_21group==1 + replace industrycat_isic="B" if E4_21group==2 + replace industrycat_isic="C" if E4_21group==3 + replace industrycat_isic="D" if E4_21group==4 + replace industrycat_isic="E" if E4_21group==5 + replace industrycat_isic="F" if E4_21group==6 + replace industrycat_isic="G" if E4_21group==7 + replace industrycat_isic="H" if E4_21group==8 + replace industrycat_isic="I" if E4_21group==9 + replace industrycat_isic="J" if E4_21group==10 + replace industrycat_isic="K" if E4_21group==11 + replace industrycat_isic="L" if E4_21group==12 + replace industrycat_isic="M" if E4_21group==13 + replace industrycat_isic="N" if E4_21group==14 + replace industrycat_isic="O" if E4_21group==15 + replace industrycat_isic="P" if E4_21group==16 + replace industrycat_isic="Q" if E4_21group==17 + replace industrycat_isic="R" if E4_21group==18 + replace industrycat_isic="S" if E4_21group==19 + replace industrycat_isic="T" if E4_21group==20 + replace industrycat_isic="U" if E4_21group==21 +} + + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10=E4_21group + recode industrycat10 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10=. if lstatus!=1 + 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 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), 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=E2_9group + replace occup_orig=. if lstatus!=1|!inrange(Age_16groups,4,16) + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco="" + replace occup_isco="" if lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=E2_9group + replace occup_skill=1 if E2_9group==9 + replace occup_skill=2 if inrange(E2_9group, 4, 8) + replace occup_skill=3 if inrange(E2_9group, 1, 3) + replace occup_skill=. if lstatus!=1 + 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" +* + + +*<_occup_> + gen occup=E2_9group + replace occup=. if lstatus!=1|!inrange(Age_16groups,4,16) + 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 +* + + +*<_wage_no_compen_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into to parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry, occupation, income categories and gender to estimate their +specific income values. + +21.86% of total non-missing wage values were imputed using this method. +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage14=E14_1+E14_2 + replace wage14=. if wage14==0 + + * First replace outliers by + winsor2 wage14, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat=. + replace salary_cat=1 if inrange(wage14_w, 1, 55000) + replace salary_cat=2 if wage14_w==55000 + replace salary_cat=3 if inrange(wage14_w, 55001, 110000) + replace salary_cat=4 if inrange(wage14_w, 110001, 220000) + replace salary_cat=5 if inrange(wage14_w, 220001, 440000) + replace salary_cat=6 if inrange(wage14_w, 440001, 600000) + replace salary_cat=7 if inrange(wage14_w, 600001, 700000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage14_w[iw=weight], by(industrycat10 occup male urban salary_cat) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage14_w wage_group_estimate + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat E15 + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat10 occup male urban E15 using "`salary_helper'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage14 if !mi(wage14)&mi(E15) + + * Now add the categorised means + replace wage_no_compen=wage_group_estimate if inrange(E15,1,8)&!mi(wage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=E16 + recode unitwage (4=5) (5=7) (6=8) (7=10) + replace unitwage=. if lstatus!=1 | empstat==2 + 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=G2_1 + replace whours=. if lstatus!=1|G2_1==0 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths=. + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total=. + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + +/*<_contract_note_> + +There is no separate contract question in the questionnaire. +This contract variable was coded based on employment status question which asks +wether an employed respondent had a contract or not. + +*<_contract_note_>*/ + + gen byte contract = . + replace contract = (E7 == 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=. + replace healthins=1 if E8_f==1 + replace healthins=0 if E8_f==2 + replace healthins=. if lstatus!=1 + 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=. + replace socialsec=. if lstatus!=1 + 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=. + replace union=1 if E27==1 + replace union=0 if E27==2 + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=E13 + recode firmsize_l (1=1) (2=5) (3=10) (4=20) (5=50) (6=100) (7=.) + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=E13 + recode firmsize_u (1=5) (2=9) (3=19) (4=49) (5=99) (6=.) + 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=F4 + recode empstat_2 (2=1) (5=2) + replace empstat_2=. if lstatus!=1|F1!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2=F6 + recode ocusec_2 (3 4=2) + replace ocusec_2=. if lstatus!=1|F1!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=F3_21group + replace industry_orig_2=. if lstatus!=1|F1!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" +quietly +{ + replace industrycat_isic_2="A" if F3_21group==1 + replace industrycat_isic_2="B" if F3_21group==2 + replace industrycat_isic_2="C" if F3_21group==3 + replace industrycat_isic_2="D" if F3_21group==4 + replace industrycat_isic_2="E" if F3_21group==5 + replace industrycat_isic_2="F" if F3_21group==6 + replace industrycat_isic_2="G" if F3_21group==7 + replace industrycat_isic_2="H" if F3_21group==8 + replace industrycat_isic_2="I" if F3_21group==9 + replace industrycat_isic_2="J" if F3_21group==10 + replace industrycat_isic_2="K" if F3_21group==11 + replace industrycat_isic_2="L" if F3_21group==12 + replace industrycat_isic_2="M" if F3_21group==13 + replace industrycat_isic_2="N" if F3_21group==14 + replace industrycat_isic_2="O" if F3_21group==15 + replace industrycat_isic_2="P" if F3_21group==16 + replace industrycat_isic_2="Q" if F3_21group==17 + replace industrycat_isic_2="R" if F3_21group==18 + replace industrycat_isic_2="S" if F3_21group==19 + replace industrycat_isic_2="T" if F3_21group==20 + replace industrycat_isic_2="U" if F3_21group==21 +} + + replace industrycat_isic_2="" if industrycat_isic_2=="."|F1!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen industrycat10_2=F3_21group + recode industrycat10_2 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10_2=. if lstatus!=1|F1!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=F2_9group + replace occup_orig_2=. if lstatus!=1|F1!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|F1!=1 + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2=F2_9group + replace occup_skill_2=1 if F2_9group==9 + replace occup_skill_2=2 if inrange(F2_9group,4,8) + replace occup_skill_2=3 if inrange(F2_9group,1,3) + replace occup_skill_2=. if F2_9group==0|lstatus!=1|F1!=1 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen occup_2=F2_9group + replace occup_2=. if lstatus!=1|F1!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + +/*<_wage_no_compen_2_note_> + +The questionnaire actually has questions about income of the second job, just as the +main job. However, the data set does not have the variables. + +*<_wage_no_compen_2_note_>*/ + gen wage_no_compen_2=. + replace wage_no_compen_2=. if F1!=1|empstat_2==2 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + replace unitwage_2=. if lstatus!=1|F1!=1 + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=G2_2 + replace whours_2=. if G2_2==0|F1!=1 + 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 byte firmsize_l_2=. + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte 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 primary & secondary 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 !inrange(Age_16groups,4,16) + 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 !inrange(Age_16groups,4,16) + 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 !inrange(Age_16groups,4,16)&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 "Disable" 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 day 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="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + 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 "1 digit industry classification (Broad Economic Activities), 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 str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard 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 +* + + +*<_wage_no_compen_year_> + 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 byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte 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 day 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 "1 digit industry classification (Broad Economic Activities), 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_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard 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 +* + + +*<_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 byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte 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 primary & secondary 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=. + replace njobs=1 if lstatus==1&F1!=1 + replace njobs=2 if lstatus==1&F1==1 + replace njobs=. if lstatus!=1 + 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=. + 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 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 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'/`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/ARM/ARM_2022_LFS/ARM_2022_LFS_V01_M_V03_A_GLD/Programs/ARM_2022_LFS_V01_M_V03_A_GLD_ALL.do b/GLD/ARM/ARM_2022_LFS/ARM_2022_LFS_V01_M_V03_A_GLD/Programs/ARM_2022_LFS_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..07afae473 --- /dev/null +++ b/GLD/ARM/ARM_2022_LFS/ARM_2022_LFS_V01_M_V03_A_GLD/Programs/ARM_2022_LFS_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,1794 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> ARM_2022_LFS_V01_M_V03_A_GLD_ALL.do +<_Application_> Stata SE 18 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2024-1-16 +------------------------------------------------------------------------- +<_Country_> Armenia (ARM) +<_Survey Title_> National Labour Force Survey +<_Survey Year_> 2022 +<_Study ID_> ARM_2022_LFS_v01_M +<_Data collection from (M/Y)_> [01/2022] +<_Data collection to (M/Y)_> [12/2022] +<_Source of dataset_> The Armenian 2022 to 2022 data is downloaded from + the website of Statistical Committee of the + Republic of Armenia:https://armstat.am/en/?nid=212 + The data is publicly available. +<_Sample size (HH)_> 7,760 +<_Sample size (IND)_> 27,218 +<_Sampling method_> A stratified two-stage probability sample design + with 14 domains as the primary strata and 18,000 + households as the SSU. +<_Geographic coverage_> All 11 regions/marzes. +<_Currency_> Armenian Dram +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 19 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 08 +<_OCCUP National_> NSCO +<_ISIC Version_> ISIC Rev.4 +<_INDUS National_> ISIC Rev.4 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: 2024-09-24 - Update vars educy, educat7, educat_isced +* Date: 2024-10-10 - Include weight by quarter, old weight variable, correct contract variable, drop migration + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "ARM" +local year "2022" +local survey "LFS" +local vermast "V01" +local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3: Database assembly------------------------------* + +* All steps necessary to merge datasets (if several) to have all elements needed to produce +* harmonized output in a single file + +use "`path_in_stata'/ARM_LFS_2022_raw.dta", clear +rename (_v1 _v2) (E4_21group F3_21group) + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="LFS" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-19" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + 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="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 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=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=A6_Month + 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_> + tostring A1, gen(hid) format(%03.0f) + tostring A6_Month, gen(month) format(%03.0f) + egen hhid=concat(month hid) + label var hhid "Household id" +* + + +*<_pid_> + sort hhid B4 + bys hhid: gen memberid=_n + tostring memberid, gen(id_str) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = WeightsCalib_year + label var weight "Household sampling weight" +* + + +*<_weight_m_> + gen weight_m = . + label var weight_m "Survey sampling weight to obtain national estimates for each month" +* + + +*<_weight_q_> + egen weight_q = rowtotal(WeightsCalib_1 WeightsCalib_2 WeightsCalib_3 WeightsCalib_4) + 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=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + decode A3, gen(marzname) + decode A5, gen(urbanstat) + gen strata=marzname+" "+urbanstat + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=A5 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + gen subnatid1=A3 + tostring subnatid1, replace + replace subnatid1=subnatid1+" - "+marzname + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey=subnatid1+" "+urbanstat + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + bys hhid: egen hsize=max(memberid) + label var hsize "Household size" +* + + +*<_age_> + +/*<_age_note_> + +Because the raw data in 2021 and 2022 do not have each observation's actual age, +and instead, they only have age in age groups. Here we coded age using the mean of +each age group to proceed with other variables and our quality checks. Therefore, +the age variable only represents the age group the observation is in. + +*<_age_note_>*/ + + gen age=. + replace age=(Age_16groups-1)*5+2 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=B3 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + +/*<_relationharm_note_> + +11 households (27 observations) in the raw data set do not have household heads. +Their household IDs are: + +002302 003209 004284 004374 005174 +006051 006649 011184 011479 011481 +012402 + +During the harmonization, we did not assign household heads to these households. +But users can assign household heads based on their relationship to the head and +other characteristics such as gender and age. + +*<_relationharm_note_>*/ + + gen byte relationharm=B4 + recode relationharm (6 9=3) (7 8=4) (10=5) (11=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 +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=B4 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=B11 + recode marital (1=2) (2=1) (3=5) + 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=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +==============================================================================================%%*/ + + +{ + +*<_migrated_mod_age_> + gen migrated_mod_age = . + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time = . + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary = . + label de lblmigrated_binary 0 "No" 1 "Yes" + label values migrated_binary lblmigrated_binary + label var migrated_binary "Individual has migrated" +* + + +*<_migrated_years_> + gen migrated_years = . + 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_> + gen byte ed_mod_age=6 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=B9 + recode school (2=0) (3/5=.) + replace school=. if !inrange(Age_16groups,2,16) + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy=. + replace literacy=0 if B7==1 + replace literacy=1 if inrange(B7,2,11) + replace literacy=. if !inrange(Age_16groups,2,16) + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + gen byte educy=. + replace educy = 0 if B7 == 1 | B7 == 2 + replace educy = 4 if B7 == 3 + replace educy = 9 if B7 == 4 + replace educy = 12 if B7 == 5 + replace educy = 11 if B7 == 6 + replace educy = 15 if B7 == 7 + replace educy = 16 if B7 == 8 + replace educy = 18 if B7 == 9 | B7 == 10 + replace educy = 20 if B7 == 11 + replace educy=. if ageage & !mi(educy) & !mi(age) + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7= B7 + recode educat7 (6=5) (7=6) (8/11=7) + replace educat7=. if age + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + replace educat5=. if !inrange(Age_16groups,2,16) + 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=educat5 + replace educat4=. if !inrange(Age_16groups,2,16) + recode educat4 (3=2) (4=3) (5=4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig=B7 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + label var educat_isced "ISCED standardised level of education" +* + + +*<_educat_isced_v_> + gen educat_isced_v="ISCED-2011" + label var educat_isced_v "Version of the ISCED used" +* + +*----------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_isced +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +replace educat_isced_v="." if ( age < ed_mod_age & !missing(age) ) +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=. + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + 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=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + gen vocational_field_orig=. + replace vocational_field_orig=. if vocational!=1 + 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_> + +/*<_minlaborage_note_> + +The age range for the labor section is 15-75. + +*<_minlaborage_note_>*/ + + gen byte minlaborage=15 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + +/*<_lstatus_note> + +The economically inavtive population also needs to be within the age range of +15 and 75. + +*<_lstatus_note>*/ + + gen byte lstatus=. + replace lstatus=1 if D1==1|inrange(D3,1,5)|D4==1|D5==1 + replace lstatus=2 if lstatus==.&inrange(J9,1,3) + replace lstatus=3 if !mi(J1_4group)&lstatus==. + replace lstatus=. if !inrange(Age_16groups,4,16) + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or (J16==1)&J9==4 +2)searching but not immediately available to work or inrange(J9,1,3)&J16==2 + +*/ + + gen potential_lf=. + replace potential_lf=1 if [(J16==1)&J9==4] | [inrange(J9,1,3)&J16==2] + replace potential_lf=0 if [(J16==1)&inrange(J9,1,3)] | [inrange(J9,1,3)&J16==1] + replace potential_lf=. if !inrange(Age_16groups,4,16) + 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=G4 + replace underemployment=1 if inrange(G4,1,3) + replace underemployment=0 if G4==4 + replace underemployment=. if !inrange(Age_16groups,4,16) + 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=J1_4group + recode nlfreason (4=5) + replace nlfreason=. if !inrange(Age_16groups,4,16) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + gen byte unempldur_l=J4 + recode unempldur_l (1=0) (2=3) (3=6) (4=9) (5=12) (6=24) (7=36) + replace unempldur_l=. if !inrange(Age_16groups,4,16) + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=J4 + recode unempldur_u (1=3) (2=6) (3=9) (4=12) (5=24) (6=36) (7=.) + replace unempldur_u=. if !inrange(Age_16groups,4,16) + 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=E7 + recode empstat (2 6=1) (5=2) + replace empstat=. if lstatus!=1|!inrange(Age_16groups,4,16) + 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=E10 + recode ocusec (3 4=2) + replace ocusec=. if lstatus!=1|!inrange(Age_16groups,4,16) + 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=E4_21group + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" +quietly +{ + replace industrycat_isic="A" if E4_21group==1 + replace industrycat_isic="B" if E4_21group==2 + replace industrycat_isic="C" if E4_21group==3 + replace industrycat_isic="D" if E4_21group==4 + replace industrycat_isic="E" if E4_21group==5 + replace industrycat_isic="F" if E4_21group==6 + replace industrycat_isic="G" if E4_21group==7 + replace industrycat_isic="H" if E4_21group==8 + replace industrycat_isic="I" if E4_21group==9 + replace industrycat_isic="J" if E4_21group==10 + replace industrycat_isic="K" if E4_21group==11 + replace industrycat_isic="L" if E4_21group==12 + replace industrycat_isic="M" if E4_21group==13 + replace industrycat_isic="N" if E4_21group==14 + replace industrycat_isic="O" if E4_21group==15 + replace industrycat_isic="P" if E4_21group==16 + replace industrycat_isic="Q" if E4_21group==17 + replace industrycat_isic="R" if E4_21group==18 + replace industrycat_isic="S" if E4_21group==19 + replace industrycat_isic="T" if E4_21group==20 + replace industrycat_isic="U" if E4_21group==21 +} + + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10=E4_21group + recode industrycat10 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10=. if lstatus!=1 + 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 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), 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=E2_9group + replace occup_orig=. if lstatus!=1|!inrange(Age_16groups,4,16) + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco="" + replace occup_isco="" if lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=E2_9group + replace occup_skill=1 if E2_9group==9 + replace occup_skill=2 if inrange(E2_9group, 4, 8) + replace occup_skill=3 if inrange(E2_9group, 1, 3) + replace occup_skill=. if lstatus!=1 + 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" +* + + +*<_occup_> + gen occup=E2_9group + replace occup=. if lstatus!=1|!inrange(Age_16groups,4,16) + 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 +* + + +*<_wage_no_compen_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into to parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry, occupation, income categories and gender to estimate their +specific income values. + +26.35% of total non-missing wage values were imputed using this method. +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage14=E14_1+E14_2 + replace wage14=. if wage14==0 + + * First replace outliers by + winsor2 wage14, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_cat=. + replace salary_cat=1 if inrange(wage14_w, 1, 55000) + replace salary_cat=2 if wage14_w==55000 + replace salary_cat=3 if inrange(wage14_w, 55001, 110000) + replace salary_cat=4 if inrange(wage14_w, 110001, 220000) + replace salary_cat=5 if inrange(wage14_w, 220001, 440000) + replace salary_cat=6 if inrange(wage14_w, 440001, 600000) + replace salary_cat=7 if inrange(wage14_w, 600001, 700000) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage14_w[iw=weight], by(industrycat10 occup male urban salary_cat) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage14_w wage_group_estimate + + * Rename salary_cat to D15 since this is what we want the info to latch on to + rename salary_cat E15 + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat10 occup male urban E15 using "`salary_helper'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage14 if !mi(wage14)&mi(E15) + + * Now add the categorised means + replace wage_no_compen=wage_group_estimate if inrange(E15,1,8)&!mi(wage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=E16 + recode unitwage (4=5) (5=7) (6=8) (7=10) + replace unitwage=. if lstatus!=1 | empstat==2 + 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=G2_1 + replace whours=. if lstatus!=1|G2_1==0 + label var whours "Hours of work in last week primary job 7 day recall" +* + + +*<_wmonths_> + gen wmonths=. + label var wmonths "Months of work in past 12 months primary job 7 day recall" +* + + +*<_wage_total_> + gen wage_total=. + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + +/*<_contract_note_> + +There is no separate contract question in the questionnaire. +This contract variable was coded based on employment status question which asks +wether an employed respondent had a contract or not. + +*<_contract_note_>*/ + + gen byte contract = . + replace contract = (E7 == 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=. + replace healthins=1 if E8_f==1 + replace healthins=0 if E8_f==2 + replace healthins=. if lstatus!=1 + 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=. + replace socialsec=. if lstatus!=1 + 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=. + replace union=1 if E27==1 + replace union=0 if E27==2 + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=E13 + recode firmsize_l (1=1) (2=5) (3=10) (4=20) (5=50) (6=100) (7=.) + replace firmsize_l=. if lstatus!=1 + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u=E13 + recode firmsize_u (1=5) (2=9) (3=19) (4=49) (5=99) (6=.) + 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=F4 + recode empstat_2 (2=1) (5=2) + replace empstat_2=. if lstatus!=1|F1!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2=F6 + recode ocusec_2 (3 4=2) + replace ocusec_2=. if lstatus!=1|F1!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=F3_21group + replace industry_orig_2=. if lstatus!=1|F1!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" +quietly +{ + replace industrycat_isic_2="A" if F3_21group==1 + replace industrycat_isic_2="B" if F3_21group==2 + replace industrycat_isic_2="C" if F3_21group==3 + replace industrycat_isic_2="D" if F3_21group==4 + replace industrycat_isic_2="E" if F3_21group==5 + replace industrycat_isic_2="F" if F3_21group==6 + replace industrycat_isic_2="G" if F3_21group==7 + replace industrycat_isic_2="H" if F3_21group==8 + replace industrycat_isic_2="I" if F3_21group==9 + replace industrycat_isic_2="J" if F3_21group==10 + replace industrycat_isic_2="K" if F3_21group==11 + replace industrycat_isic_2="L" if F3_21group==12 + replace industrycat_isic_2="M" if F3_21group==13 + replace industrycat_isic_2="N" if F3_21group==14 + replace industrycat_isic_2="O" if F3_21group==15 + replace industrycat_isic_2="P" if F3_21group==16 + replace industrycat_isic_2="Q" if F3_21group==17 + replace industrycat_isic_2="R" if F3_21group==18 + replace industrycat_isic_2="S" if F3_21group==19 + replace industrycat_isic_2="T" if F3_21group==20 + replace industrycat_isic_2="U" if F3_21group==21 +} + + replace industrycat_isic_2="" if industrycat_isic_2=="."|F1!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen industrycat10_2=F3_21group + recode industrycat10_2 (5=4) (6=5) (7 9=6) (8 10=7) (11/14=8) (15=9) (16/21=10) + replace industrycat10_2=. if lstatus!=1|F1!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=F2_9group + replace occup_orig_2=. if lstatus!=1|F1!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|F1!=1 + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2=F2_9group + replace occup_skill_2=1 if F2_9group==9 + replace occup_skill_2=2 if inrange(F2_9group,4,8) + replace occup_skill_2=3 if inrange(F2_9group,1,3) + replace occup_skill_2=. if F2_9group==0|lstatus!=1|F1!=1 + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen occup_2=F2_9group + replace occup_2=. if lstatus!=1|F1!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + +/*<_wage_no_compen_2_note_> + +The questionnaire actually has questions about income of the second job, just as the +main job. However, the data set does not have the variables. + +*<_wage_no_compen_2_note_>*/ + gen wage_no_compen_2=. + replace wage_no_compen_2=. if F1!=1|empstat_2==2 + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + replace unitwage_2=. if lstatus!=1|F1!=1 + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=G2_2 + replace whours_2=. if G2_2==0|F1!=1 + 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 byte firmsize_l_2=. + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte 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 primary & secondary 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 !inrange(Age_16groups,4,16) + 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 !inrange(Age_16groups,4,16) + 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 !inrange(Age_16groups,4,16) + 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 "Disable" 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 day 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="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + 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 "1 digit industry classification (Broad Economic Activities), 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 str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard 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 +* + + +*<_wage_no_compen_year_> + 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 byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte 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 day 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 "1 digit industry classification (Broad Economic Activities), 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_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard 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 +* + + +*<_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 byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte 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 primary & secondary 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=. + replace njobs=1 if lstatus==1&F1!=1 + replace njobs=2 if lstatus==1&F1==1 + replace njobs=. if lstatus!=1 + 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=. + 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 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 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'/`level_2_harm'_ALL.dta", replace + +*