From df0d07d5a8aac16c1375a745e9d999a3e6597df9 Mon Sep 17 00:00:00 2001 From: Sizhen Fang <76606701+sizhenf@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:24:51 -0400 Subject: [PATCH 1/2] update subnatidsurvey --- .../IDN_1989_SAKERNAS_V01_M_V06_A_GLD_ALL.do | 1680 +++++++++++++++++ .../IDN_1990_SAKERNAS_V01_M_V06_A_GLD_ALL.do | 1659 ++++++++++++++++ .../IDN_1991_SAKERNAS_V01_M_V06_A_GLD_ALL.do | 1655 ++++++++++++++++ 3 files changed, 4994 insertions(+) create mode 100644 GLD/IDN/IDN_1989_SAKERNAS/IDN_1989_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1989_SAKERNAS_V01_M_V06_A_GLD_ALL.do create mode 100644 GLD/IDN/IDN_1990_SAKERNAS/IDN_1990_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1990_SAKERNAS_V01_M_V06_A_GLD_ALL.do create mode 100644 GLD/IDN/IDN_1991_SAKERNAS/IDN_1991_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1991_SAKERNAS_V01_M_V06_A_GLD_ALL.do diff --git a/GLD/IDN/IDN_1989_SAKERNAS/IDN_1989_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1989_SAKERNAS_V01_M_V06_A_GLD_ALL.do b/GLD/IDN/IDN_1989_SAKERNAS/IDN_1989_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1989_SAKERNAS_V01_M_V06_A_GLD_ALL.do new file mode 100644 index 000000000..bd83e35de --- /dev/null +++ b/GLD/IDN/IDN_1989_SAKERNAS/IDN_1989_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1989_SAKERNAS_V01_M_V06_A_GLD_ALL.do @@ -0,0 +1,1680 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1989_Sakernas_v01_M_v04_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-07-25 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1989 +<_Study ID_> IDN_1989_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> N/A +<_Sample size (IND)_> 283,278 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> N/A +<_OCCUP National_> N/A +<_ISIC Version_> N/A +<_INDUS National_> N/A +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1989_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2023-01-12] File: [IDN_1989_Sakernas_v01_M_v03_A_GLD.do] - [Change directories; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_1989_Sakernas_v01_M_v04_A_GLD.do] - [Recode "industry_orig"; change "Z" drive to "Y" drive] +* Date: [2023-04-04] File: [IDN_1989_Sakernas_v01_M_v05_A_GLD.do] - [Set "wage_no_compen" to missing for unpaid workers and zero values] +* Date: [2026-03-12] File: [IDN_1989_Sakernas_V01_M_V06_A_GLD.do] - [Revise "subnatidsurvey"] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1989" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V06" + +* 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'\sakernas89.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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_> + rename year Year + gen int year = 1989 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1989 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// province = province +// kab = district/city +// rural = urban/rural +// codesamp = sample code number +// sampseq = household sample sequential number +// hhseq = serial number of households + +But year 1989 was decided unable to recreate unique household IDs. + +<_hhid_note_>*/ + + +*<_hhid_> + *sort province kab rural codesamp sampseq hhseq + *egen hhid = group(province kab rural codesamp sampseq hhseq) + gen hhid = . + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 283,276 100.00 100.00 + 1 | 4 0.00 100.00 +------------+----------------------------------- + Total | 283,280 100.00 + + +<_pid_note_>*/ + + +*<_pid_> + duplicates drop + gen pid = string(_n,"%06.0f") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = infl + label var weight "Survey sampling weight" +* + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + tostring quarter, gen(wave) format(%02.0f) + replace wave = "Q" + substr(wave, 2, 1) + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen byte urban = rural + recode urban 0=1 1=0 + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1_copy = province + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 54 "54 - TIMUR TIMOR" 53 "53 - NUSA TENGGARA TIMUR" 54 "54 - TIMUR TIMOR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + + Because SAKERNAS 1989 does not have the district name variable as other years, yet it has the same districts surveyed in 2013. Therefore, I used districts' names and codes in 2013 to codify subnatid2 in 1996. + + But note that 26 district codes only appear in 1989 (no district labels) not in 2013: +1171 +3218 3219 3220 3273 +5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 +6271 +7319 7320 7321 7371 +8184 8208 8209 +These districts' names were left missing. + +Province 54 - East Timor became indipendent from Indonesia in 2002. All districts in province 54 do not have names as in no year do these districts have name labels. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = kab + tostring code_kab, format (%02.0f) replace + gen code_prop = province + tostring code_prop, format (%02.0f) replace + gen subnatid2_code = code_prop + code_kab + rename subnatid2_code b1p02 + merge n:1 b1p02 using "`path_in_stata'\district_list_2013.dta" + drop if _merge==2 + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen byte subnatid3 = . + label de lblsubnatid3 1 "1 - Name" + label values subnatid3 lblsubnatid3 + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey = subnatid1 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen byte hsize = n_hhmem + label var hsize "Household size" +* + + +/*<_age_> + +Note that because the variable of age is called "age" in the raw dataset, +here I did not create a new variable. + +<_age_>*/ + + +*<_age_> + *gen age = Q14AGE + label var age "Individual age" +* + + +*<_male_> + destring sex, replace + gen male = sex + 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 = . + 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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = relationharm + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = . + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var eye_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var eye_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var eye_dsablty "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +/*<_school_> + +Note that variable "school" refers to be currently attending school; but the only +variable viable for "school" is "inschool", which indicates the primary activity +during the previous week. + +<_school_>*/ + + +*<_school_> + gen byte school = inschool + replace school = . if age + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +Original code list of variable "educa" in the dataset: + +1.Not/never been in school +2.Not finished primary school yet +3.Primary school +4.Junior high school +5.Vocational Jr. school +6.Senior high school +7.Vocational high school +8.Diploma I/II +9.Academy/Diploma III +0.University + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +*/ + + +*<_educy_> + gen byte educy = . + replace educy = . if age + + +*<_educat7_> + destring educa, replace + gen byte educat7 = educa + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = educa + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = educa + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (activity=="1")" or + "worked at least for 1 hour in the past one week(work1hr=="1")" or + "has a job/business but temporarily did not work during the past one week(absent=="1")"; +unemployed:"who do not have a job/business (absent=="2") & seeking a job (seeking==1)" +non-labor force: "who do not have a job/business (absent=="2")" & not seeking a job (seeking==2). + +Labor force participation: 55.04% + +<_lstatus_note_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if activity=="1" | work1hr=="1" | absent=="1" + replace lstatus = 2 if absent=="2" & seeking==1 + replace lstatus = 3 if absent=="2" & seeking==2 + replace lstatus = . if age < minlaborage + replace lstatus = 2 if seeking==1 & lstatus==. + replace lstatus = 3 if seeking==2 & lstatus==. + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> + +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (wantwork==1 & subopt==0) +2)searching but not immediately available to work (subopt==1 & wantwork==0) + +Note that the raw dataset seems to assume people who are looking for jobs are also +willing to accept jobs and people who are not looking for jobs are not. But also +note that 7,771 observations looking for jobs do not follow this rule. They may be +errors and the reason for this is not known. + +In this case, no observations fit the requirement and will be assigned any non-missing values. + + Want to | LOOKING FOR OR WANT + accept a | WORK + job | 0 1 | Total +-----------+----------------------+---------- + | 0 7,771 | 7,771 + 1 | 0 52,465 | 52,465 + 2 | 223,038 0 | 223,038 + 9 | 6 0 | 6 +-----------+----------------------+---------- + Total | 223,044 60,236 | 283,280 + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if (wantwork=="1" & subopt==0) | (subopt==1 & wantwork=="2") + replace potential_lf = 0 if (wantwork=="1" & subopt==1) | (subopt==0 & wantwork=="0") + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason = . + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +Period of job seeking, or variable "b4p16" is not a range in the raw dataset. +The unit is month but it is a specific value. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + destring seek_c, replace + gen byte unempldur_l = seek_c + replace unempldur_l = . if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = seek_c + replace unempldur_u = . if lstatus!=2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + destring status, replace + gen byte empstat = status if inrange(status, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + replace empstat = . if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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_note_> + +The original code list of industry has 18 categories from 00 to 17. But the +coding in the dataset is not correct. Some of the categories are named in the +format of two digits, like 00 to 09 whereas the others are in one-digit format. + +<_industry_orig_note_>*/ + + +*<_industry_orig_> + gen industry_orig = industry + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + tostring industrycat_isic, replace format(%04.0f) + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industry2 = industry + destring industry2, replace + format industry2 %02.0f if inlist(substr(industry,1,1), "0") + gen byte industrycat10 = industry2 + recode industrycat10 (01/04=1) (05=2) (06/09=3) (10=4) (11=5) (12=6) (13=7) (14=8) (15=9) (00 16 17=10) + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4 "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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_occup_> + gen occup = . + replace occup = . if lstatus!=1 + 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_note_> + +Two variables in the raw dataset are the same --- "wagewk_c" and "wagewk"; the +former is a string variable while the other one is a numeric variable. + +Note that these two variables reflect average weekly wage instead of the last payment. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = wagewk + replace wage_no_compen=. if lstatus!=1 | empstat==2 | wage_no_compen==0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 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 = hrsmain + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_> + gen byte contract = . + 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 = . 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 = . + 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 = . + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2 = . + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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_note_> + +According to the original variable "b4r19", we only know whether a given respondent +had a work or not in the last year. We do not know among those who did not have +a work, who were actively seeking a job. Therefore, we cannot decide who are unemployed +nor who are non-labor force. + +Same reason for leaving "potential_lf_year" missing. + +<_lstatus_year_note_>*/ + + +*<_lstatus_year_> + gen byte lstatus_year = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year =. + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/IDN/IDN_1990_SAKERNAS/IDN_1990_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1990_SAKERNAS_V01_M_V06_A_GLD_ALL.do b/GLD/IDN/IDN_1990_SAKERNAS/IDN_1990_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1990_SAKERNAS_V01_M_V06_A_GLD_ALL.do new file mode 100644 index 000000000..0c9cbf924 --- /dev/null +++ b/GLD/IDN/IDN_1990_SAKERNAS/IDN_1990_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1990_SAKERNAS_V01_M_V06_A_GLD_ALL.do @@ -0,0 +1,1659 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1990_Sakernas_v01_M_v05_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-07-25 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1990 +<_Study ID_> IDN_1990_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Central Bureau of Statistics (BPS), Indonesia + Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 81,814 +<_Sample size (IND)_> 291,095 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> N/A +<_OCCUP National_> N/A +<_ISIC Version_> N/A +<_INDUS National_> N/A +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1990_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2023-01-12] File: [IDN_1990_Sakernas_v01_M_v03_A_GLD.do] - [Change directories; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_1990_Sakernas_v01_M_v04_A_GLD.do] - [Recode "industry_orig"; change "Z" drive to "Y" drive] +* Date: [2023-04-04] File: [IDN_1990_Sakernas_v01_M_v05_A_GLD.do] - [Set "wage_no_compen" to missing for unpaid workers and zero values] +* Date: [2026-03-12] File: [IDN_1990_Sakernas_V01_M_V05_A_GLD.do] - [update subnatidsurvey] + + + +* Date: [2023-04-04] File: [IDN_1990_Sakernas_v01_M_v05_A_GLD.do] - [Set "wage_no_compen" to missing for unpaid workers and zero values] + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1990" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V06" + +* 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'\sakernas90.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = 1990 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "v01" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "v02" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1990 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// prop = province +// kab = district/city +// koped = urban/rural +// nks = sample code number +// nous = household sample sequential number +// nour = serial number of households + +<_hhid_note_>*/ + + +*<_hhid_> + sort prop kab koped nks nous nour + egen hhid = group(prop kab koped nks nous nour) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 291,095 100.00 100.00 +------------+----------------------------------- + Total | 291,095 100.00 + +<_pid_note_>*/ + + +*<_pid_> + duplicates drop + gen pid = string(_n,"%06.0f") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = inflate + label var weight "Survey sampling weight" +* + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + tostring kuart, gen(wave) format(%02.0f) + replace wave = "Q" + substr(wave, 2, 1) + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen byte urban = koped + recode urban (2=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1_copy = prop + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 54 "54 - TIMUR TIMOR" 53 "53 - NUSA TENGGARA TIMUR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + + Because SAKERNAS 1990 does not have the district name variable as other years, yet it has the same districts surveyed in 2013. Therefore, I used districts' names and codes in 2013 to codify subnatid2 in 1996. + + But note that 26 district codes only appear in 1990 (no district labels) not in 2013: +1171 1472 +3218 3219 3220 3273 +5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 +6271 +7319 7320 7321 7371 +8208 8209 +These districts' names were left missing. + +Province 54 - East Timor became indipendent from Indonesia in 2002. All districts in province 54 do not have names as in no year do these districts have name labels. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = kab + tostring code_kab, format (%02.0f) replace + gen code_prop = prop + tostring code_prop, format (%02.0f) replace + gen subnatid2_code = code_prop + code_kab + rename subnatid2_code b1p02 + merge n:1 b1p02 using "`path_in_stata'\district_list_2013.dta" + drop if _merge==2 + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen byte subnatid3 = . + label de lblsubnatid3 1 "1 - Name" + label values subnatid3 lblsubnatid3 + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey = subnatid1 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen byte hsize = jart + label var hsize "Household size" +* + + +*<_age_> + gen age = b4p2 + label var age "Individual age" +* + + +*<_male_> + gen male = b4p1 + 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 = . + 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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = relationharm + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = . + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var eye_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var eye_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var eye_dsablty "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +/*<_school_note_c> + +Note that variable "school" refers to be currently attending school; but the only +variable viable for "school" is "b4p4", which indicates the primary activity +during the previous week. Because we are not sure whether people have other primary +activities are attending school or not, there is no category zero. + +<_school_note_>*/ + + +*<_school_> + gen byte school = . + replace school = 1 if b4p4 == 2 + replace school = . if age + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +Original code list of variable "b4p3" in the dataset: + +1.Not/never been in school +2.Not finished primary school yet +3.Primary school +4.Junior high school +5.Vocational Jr. school +6.Senior high school +7.Vocational high school +8.Diploma I/II +9.Academy/Diploma III +0.Diploma IV/Bachelor/Postgraduate + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +*/ + + +*<_educy_> + gen byte educy = . + replace educy = . if age + + +*<_educat7_> + gen byte educat7 = b4p3 + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4p3 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4p3 + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4p4==1)" or + "worked at least for 1 hour last week (b4p5==1)" or + "has a job/business but temporarily didn't work (b4p6==1)"; +unemployed: "who do not have a job/business (b4p6==2)" & seeking a job (b4p13==1); +non-labor force: "who do not have a job/business (b4p6==2)" & not seeking a job (b4p13=!1). + +Labor force participation: 55.37% + +<_lstatus_note_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if b4p4==1 | b4p5==1 | b4p6==1 + replace lstatus = 2 if b4p6==2 & b4p13==1 + replace lstatus = 3 if b4p6==2 & b4p13==2 + replace lstatus = . if age < minlaborage + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4p13==1 & b4p14==2) +2)searching but not immediately available to work (b4p14==1 & b4p13==2) + +Note that there are observations who want to accept a job (seen as being available) +but not seeking for a job, which is different from year 1989. But no observation +satisfies the second requirement. + +. tab b4p13 b4p14, m + + Seeking | Want to accept a job + for a job | Yes No 9 . | Total +-----------+--------------------------------------------+---------- + Yes | 0 0 0 7,949 | 7,949 + No | 55,680 227,464 2 0 | 283,146 +-----------+--------------------------------------------+---------- + Total | 55,680 227,464 2 7,949 | 291,095 + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if [ b4p13==1 & b4p14==2 ] | [ b4p14==1 & b4p13==2] + replace potential_lf = 0 if [ b4p13==1 & b4p14==1 ] | [ b4p14==2 & b4p13==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason = . + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +Period of job seeking, or variable "b4p16" is not a range in the raw dataset. +The unit is month but it is a specific value. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + gen byte unempldur_l = b4p16 + replace unempldur_l = . if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4p16 + 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 = b4p10 if inrange(b4p10, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + replace empstat = . if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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_note_> + +The original code list of industry has 18 categories from 00 to 17. But the +coding in the dataset is not correct. Some of the categories are named in the +format of two digits, like 00 to 09 whereas the others are in one-digit format. + +So for the variable "industry_orig", I corrected the very original codes and +use the two-digit format. + +<_industry_orig_note_>*/ + + +*<_industry_orig_> + gen industry_orig = b4p9 + tostring industry_orig, replace + replace industry_orig = "" if industry_orig=="." + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + tostring industrycat_isic, replace format(%04.0f) + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = b4p9 + recode industrycat10 (1/4=1) (5=2) (6/9=3) (10=4) (11=5) (12=6) (13=7) (14=8) (15=9) (16 0 17=10) + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4 "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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_occup_> + gen occup = . + replace occup = . if lstatus!=1 + 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_note_> + +The raw dataset has two wage-related variables --- b4p11mg, average weekly net salary +and b4p11bl, average monthly net salary; both refer to the wage received from the main job. + +Note that these two variables reflect AVERAGE wage instead of LAST payment. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = b4p11bl + replace wage_no_compen=. if lstatus!=1 | empstat==2 | wage_no_compen==0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + 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 = b4p12jj + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_> + gen byte contract = . + 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 = . 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 = . + 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 = . + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2 = . + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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_note_> + +According to the original variable "b4r19", we only know whether a given respondent +had a work or not in the last year. We do not know among those who did not have +a work, who were actively seeking a job. Therefore, we cannot decide who are unemployed +nor who are non-labor force. + +Same reason for leaving "potential_lf_year" missing. + +<_lstatus_year_note_>*/ + + +*<_lstatus_year_> + gen byte lstatus_year = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year =. + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/IDN/IDN_1991_SAKERNAS/IDN_1991_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1991_SAKERNAS_V01_M_V06_A_GLD_ALL.do b/GLD/IDN/IDN_1991_SAKERNAS/IDN_1991_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1991_SAKERNAS_V01_M_V06_A_GLD_ALL.do new file mode 100644 index 000000000..95d63bb36 --- /dev/null +++ b/GLD/IDN/IDN_1991_SAKERNAS/IDN_1991_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1991_SAKERNAS_V01_M_V06_A_GLD_ALL.do @@ -0,0 +1,1655 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1991_Sakernas_v01_M_v05_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-07-25 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1991 +<_Study ID_> IDN_1991_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 81,595 +<_Sample size (IND)_> 282,542 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> N/A +<_OCCUP National_> N/A +<_ISIC Version_> N/A +<_INDUS National_> N/A +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1991_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2023-01-12] File: [IDN_1991_Sakernas_v01_M_v03_A_GLD.do] - [Change directories; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_1991_Sakernas_v01_M_v04_A_GLD.do] - [Recode "industry_orig"; change "Z" drive to "Y" drive] +* Date: [2023-04-04] File: [IDN_1991_Sakernas_v01_M_v05_A_GLD.do] - [Set "wage_no_compen" to missing for unpaid workers and zero values] +* Date: [2026-3-12] File: [IDN_1991_Sakernas_v01_M_v06_A_GLD.do] - [Change subnatid to string, revise subatidsurvey] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1991" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V06" + +* 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'\sakernas91.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = 1991 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1991 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// prop = province +// kab = district/city +// koped = urban/rural +// nks = sample code number +// nous = household sample sequential number +// nour = serial number of households + +<_hhid_note_>*/ + + +*<_hhid_> + sort prop kab koped nks nous nour + egen hhid = group(prop kab koped nks nous nour) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 282,334 100.00 100.00 +------------+----------------------------------- + Total | 282,334 100.00 + +<_pid_note_>*/ + + +*<_pid_> + duplicates drop + gen pid = string(_n,"%06.0f") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = inflate + label var weight "Survey sampling weight" +* + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + tostring kuart, gen(wave) format(%02.0f) + replace wave = "Q" + substr(wave, 2, 1) + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +/*<_urban_note_> + +Variable "koped" in the raw dataset is urban/rural variable but somehow this variable +is wrongly coded --- it has 10 categories and does not have any value labels. +Therefore, we do not know about the urban/rural status. + +<_urban_note_>*/ + + +*<_urban_> + gen byte urban = . + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1_copy = prop + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 54 "54 - TIMUR TIMOR" 53 "53 - NUSA TENGGARA TIMUR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + +Both province and district only have codes without name labels. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = kab + tostring code_kab, format (%02.0f) replace + gen code_prop = prop + tostring code_prop, format (%02.0f) replace + gen subnatid2 = code_prop + code_kab + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen byte subnatid3 = . + label de lblsubnatid3 1 "1 - Name" + label values subnatid3 lblsubnatid3 + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey = subnatid1 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen byte hsize = jart + label var hsize "Household size" +* + + +*<_age_> + gen age = b4p2 + label var age "Individual age" +* + + +*<_male_> + gen male = b4p1 + 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 = . + 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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = relationharm + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = . + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var eye_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var eye_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var eye_dsablty "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +/*<_school_> + +Note that variable "school" refers to be currently attending school; but the only +variable viable for "school" is "b4p4", which indicates the primary activity +during the previous week. Because we are not sure whether people have other primary +activities are attending school or not, there is no category zero. + +<_school_>*/ + + +*<_school_> + gen byte school = . + replace school = 1 if b4p4 == 2 + replace school = . if age + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +Original code list of variable "b4p3" in the dataset: + +1.Not/never been in school +2.Not finished primary school yet +3.Primary school +4.Junior high school +5.Vocational Jr. school +6.Senior high school +7.Vocational high school +8.Diploma I/II +9.Academy/Diploma III +0.Diploma IV/Bachelor/Postgraduate + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +*/ + + +*<_educy_> + gen byte educy = . + replace educy = . if age + + +*<_educat7_> + gen byte educat7 = b4p3 + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4p3 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4p3 + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4p4==1)" or + "worked at least for 1 hour last week (b4p5==1)" or + "has a job/business but temporarily didn't work (b4p6==1)"; +unemployed: "who do not have a job/business (b4p6==2)" & seeking a job (b4p13==1); +non-labor force: "who do not have a job/business (b4p6==2)" & not seeking a job (b4p13=!1). + +Labor force participation: 55.64% + +<_lstatus_note_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if b4p4==1 | b4p5==1 | b4p6==1 + replace lstatus = 2 if b4p6==2 & b4p13==1 + replace lstatus = 3 if b4p6==2 & b4p13==2 + replace lstatus = . if age < minlaborage + replace lstatus = 2 if b4p13==1 & lstatus==. + replace lstatus = 3 if b4p13==2 & lstatus==. + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4p13==1 & b4p14==2) +2)searching but not immediately available to work (b4p14==1 & b4p13==2) + +Note that there are observations who want to accept a job (seen as being available) +but not seeking for a job, which is different from year 1989. But no observation +satisfies the second requirement. + +. tab b4p13 b4p14, m + + Seeking | Want to accept a job + for a job | Yes No 9 . | Total +-----------+--------------------------------------------+---------- + Yes | 0 0 0 7,483 | 7,483 + No | 53,837 221,013 1 0 | 274,851 +-----------+--------------------------------------------+---------- + Total | 53,837 221,013 1 7,483 | 282,334 + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if [ b4p13==1 & b4p14==2 ] | [ b4p14==1 & b4p13==2] + replace potential_lf = 0 if [ b4p13==1 & b4p14==1 ] | [ b4p14==2 & b4p13==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason = . + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +Period of job seeking, or variable "b4p16" is not a range in the raw dataset. +The unit is month but it is a specific value. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + gen byte unempldur_l = b4p16 + replace unempldur_l = . if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4p16 + 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 = b4p10 if inrange(b4p10, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + replace empstat = . if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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_note_> + +The original code list of industry has 18 categories from 00 to 17. But the +coding in the dataset is not correct. Some of the categories are named in the +format of two digits, like 00 to 09 whereas the others are in one-digit format. + +So for the variable "industry_orig", I corrected the very original codes and +use the two-digit format. + +<_industry_orig_note_>*/ + + +*<_industry_orig_> + gen industry_orig = b4p9 + tostring industry_orig, replace + replace industry_orig = "" if industry_orig=="." + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + tostring industrycat_isic, replace format(%04.0f) + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = b4p9 + recode industrycat10 (01/04=1) (05=2) (06/09=3) (10=4) (11=5) (12=6) (13=7) (14=8) (15=9) (16 00 17=10) + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4 "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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_occup_> + gen occup = . + replace occup = . if lstatus!=1 + 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_note_> + +The raw dataset has two wage-related variables --- b4p11mg, average weekly net salary +and b4p11bl, average monthly net salary; both refer to the wage received from the main job. + +Note that these two variables reflect AVERAGE wage instead of LAST payment. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = b4p11bl + replace wage_no_compen=. if lstatus!=1 | empstat==2 | wage_no_compen==0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + + +*<_unitwage_> + gen byte unitwage = 5 + 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 = b4p12jj + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_> + gen byte contract = . + 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 = . 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 = . + 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 = . + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2 = . + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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_note_> + +According to the original variable "b4r19", we only know whether a given respondent +had a work or not in the last year. We do not know among those who did not have +a work, who were actively seeking a job. Therefore, we cannot decide who are unemployed +nor who are non-labor force. + +Same reason for leaving "potential_lf_year" missing. + +<_lstatus_year_note_>*/ + + +*<_lstatus_year_> + gen byte lstatus_year = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year =. + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* From 6a0ddff2dbe1c62e3fa214c807e08ac401a34e01 Mon Sep 17 00:00:00 2001 From: Sizhen Fang <76606701+sizhenf@users.noreply.github.com> Date: Fri, 20 Mar 2026 16:42:59 -0400 Subject: [PATCH 2/2] update subnatidsurvey --- .../IDN_1992_SAKERNAS_V01_M_V06_A_GLD_ALL.do | 1660 +++++++++++++++ .../IDN_1993_SAKERNAS_V01_M_V06_A_GLD_ALL.do | 1656 +++++++++++++++ .../IDN_1994_SAKERNAS_V01_M_V08_A_GLD_ALL.do | 1709 ++++++++++++++++ .../IDN_1996_SAKERNAS_V01_M_V08_A_GLD_ALL.do | 1782 +++++++++++++++++ .../IDN_1997_SAKERNAS_V01_M_V08_A_GLD_ALL.do | 1756 ++++++++++++++++ .../IDN_1998_SAKERNAS_V01_M_V08_A_GLD_ALL.do | 1754 ++++++++++++++++ .../IDN_1999_SAKERNAS_V01_M_V08_A_GLD_ALL.do | 1716 ++++++++++++++++ .../IDN_2000_SAKERNAS_V01_M_V07_A_GLD_ALL.do | 1708 ++++++++++++++++ 8 files changed, 13741 insertions(+) create mode 100644 GLD/IDN/IDN_1992_SAKERNAS/IDN_1992_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1992_SAKERNAS_V01_M_V06_A_GLD_ALL.do create mode 100644 GLD/IDN/IDN_1993_SAKERNAS/IDN_1993_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1993_SAKERNAS_V01_M_V06_A_GLD_ALL.do create mode 100644 GLD/IDN/IDN_1994_SAKERNAS/IDN_1994_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1994_SAKERNAS_V01_M_V08_A_GLD_ALL.do create mode 100644 GLD/IDN/IDN_1996_SAKERNAS/IDN_1996_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1996_SAKERNAS_V01_M_V08_A_GLD_ALL.do create mode 100644 GLD/IDN/IDN_1997_SAKERNAS/IDN_1997_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1997_SAKERNAS_V01_M_V08_A_GLD_ALL.do create mode 100644 GLD/IDN/IDN_1998_SAKERNAS/IDN_1998_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1998_SAKERNAS_V01_M_V08_A_GLD_ALL.do create mode 100644 GLD/IDN/IDN_1999_SAKERNAS/IDN_1999_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1999_SAKERNAS_V01_M_V08_A_GLD_ALL.do create mode 100644 GLD/IDN/IDN_2000_SAKERNAS/IDN_2000_SAKERNAS_V01_M_V07_A_GLD/Programs/IDN_2000_SAKERNAS_V01_M_V07_A_GLD_ALL.do diff --git a/GLD/IDN/IDN_1992_SAKERNAS/IDN_1992_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1992_SAKERNAS_V01_M_V06_A_GLD_ALL.do b/GLD/IDN/IDN_1992_SAKERNAS/IDN_1992_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1992_SAKERNAS_V01_M_V06_A_GLD_ALL.do new file mode 100644 index 000000000..a2c3487c3 --- /dev/null +++ b/GLD/IDN/IDN_1992_SAKERNAS/IDN_1992_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1992_SAKERNAS_V01_M_V06_A_GLD_ALL.do @@ -0,0 +1,1660 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1992_Sakernas_v01_M_v05_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-07-25 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1992 +<_Study ID_> IDN_1992_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 72,756 +<_Sample size (IND)_> 282,542 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> N/A +<_OCCUP National_> N/A +<_ISIC Version_> N/A +<_INDUS National_> N/A +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1992_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2023-01-12] File: [IDN_1992_Sakernas_v01_M_v03_A_GLD.do] - [Change directories; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_1992_Sakernas_v01_M_v04_A_GLD.do] - [Recode "industry_orig"; change "Z" drive to "Y" drive] +* Date: [2023-04-05] File: [IDN_1992_Sakernas_v01_M_v05_A_GLD.do] - [Set "wage_no_compen" to missing for unpaid workers and zero values] +* Date: [2026-03-12] File: [IDN_1992_Sakernas_V01_M_V06_A_GLD.do] - [Revise "subnatidsurvey"] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1992" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V06" + +* 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'\sakernas92.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = 1992 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1992 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// prop = province +// kab = district/city +// koped = urban/rural +// nks = sample code number +// nour = household sample sequential number + +<_hhid_note_>*/ + + +*<_hhid_> + sort prop kab koped nks nour + egen hhid = group(prop kab koped nks nour) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 282,542 100.00 100.00 +------------+----------------------------------- + Total | 282,542 100.00 + +<_pid_note_>*/ + + +*<_pid_> + duplicates drop + gen pid = string(_n,"%06.0f") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = inflate + label var weight "Survey sampling weight" +* + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + tostring kuart, gen(wave) format(%02.0f) + replace wave = "Q" + substr(wave, 2, 1) + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen byte urban = koped + recode urban (2=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1_copy = prop + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 54 "54 - TIMUR TIMOR" 53 "53 - NUSA TENGGARA TIMUR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + + Because SAKERNAS 1992 does not have the district name variable as other years, yet it has the same districts surveyed in 2013. Therefore, I used districts' names and codes in 2013 to codify subnatid2 in 1996. + + But note that 26 district codes only appear in 1992 (no district labels) not in 2013: +1171 1472 +3218 3219 3220 3273 +5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 +6271 +7319 7320 7321 7371 +8208 8209 +These districts' names were left missing. + +Province 54 - East Timor became indipendent from Indonesia in 2002. All districts in province 54 do not have names as in no year do these districts have name labels. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = kab + tostring code_kab, format (%02.0f) replace + gen code_prop = prop + tostring code_prop, format (%02.0f) replace + gen subnatid2_code = code_prop + code_kab + rename subnatid2_code b1p02 + merge n:1 b1p02 using "`path_in_stata'\district_list_2013.dta" + drop if _merge==2 + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen byte subnatid3 = . + label de lblsubnatid3 1 "1 - Name" + label values subnatid3 lblsubnatid3 + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey = subnatid1 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen byte hsize = jart + label var hsize "Household size" +* + + +*<_age_> + gen age = b4p2 + label var age "Individual age" +* + + +*<_male_> + gen male = b4p1 + 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 = . + 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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = relationharm + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = . + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var eye_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var eye_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var eye_dsablty "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +/*<_school_note_> + +Note that variable "school" refers to be currently attending school; but the only +variable viable for "school" is "b4p4", which indicates the primary activity +during the previous week. Because we are not sure whether people have other primary +activities are attending school or not, there is no category zero. + +<_school_note_>*/ + + +*<_school_> + gen byte school = . + replace school = 1 if b4p4 == 2 + replace school=. if age + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +Original code list of variable "b4p3" in the dataset: + +1.Not/never been in school +2.Not finished primary school yet +3.Primary school +4.Junior high school +5.Vocational Jr. school +6.Senior high school +7.Vocational high school +8.Diploma I/II +9.Academy/Diploma III +0.Diploma IV/Bachelor/Postgraduate + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +*/ + + +*<_educy_> + gen byte educy = . + replace educy = . if age + + +*<_educat7_> + gen byte educat7 = b4p3 + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4p3 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4p3 + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4p4==1)" or + "worked at least for 1 hour last week (b4p5==1)" or + "has a job/business but temporarily didn't work (b4p6==1)"; +unemployed: "who do not have a job/business (b4p6==2)" & seeking a job (b4p13==1); +non-labor force: "who do not have a job/business (b4p6==2)" & not seeking a job (b4p13=!1). + +Labor force participation: 56.22% + +<_lstatus_note_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if b4p4==1 | b4p5==1 | b4p6==1 + replace lstatus = 2 if b4p6==2 & b4p13==1 + replace lstatus = 3 if b4p6==2 & b4p13==2 + replace lstatus = 2 if b4p13==1 & lstatus==. + replace lstatus = 3 if b4p13==2 & lstatus==. + replace lstatus = . if age < minlaborage + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4p13==1 & b4p14==2) +2)searching but not immediately available to work (b4p14==1 & b4p13==2) + +Note that there are observations who want to accept a job (seen as being available) +but not seeking for a job, which is different from year 1989. But no observation +satisfies the second requirement. + +. tab b4p13 b4p14, m + + Seeking | Want to accept a job + for a job | Yes No 9 . | Total +-----------+--------------------------------------------+---------- + Yes | 0 0 0 7,898 | 7,898 + No | 54,277 220,364 3 0 | 274,644 +-----------+--------------------------------------------+---------- + Total | 54,277 220,364 3 7,898 | 282,542 + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if [ b4p13==1 & b4p14==2 ] | [ b4p14==1 & b4p13==2] + replace potential_lf = 0 if [ b4p13==1 & b4p14==1 ] | [ b4p14==2 & b4p13==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason = . + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +Period of job seeking, or variable "b4p16" is not a range in the raw dataset. +The unit is month but it is a specific value. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + gen byte unempldur_l = b4p16 + replace unempldur_l = . if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4p16 + 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 = b4p10 if inrange(b4p10, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + replace empstat = . if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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_note_> + +The original code list of industry has 18 categories from 00 to 17. But the +coding in the dataset is not correct. Some of the categories are named in the +format of two digits, like 00 to 09 whereas the others are in one-digit format. + +So for the variable "industry_orig", I corrected the very original codes and +use the two-digit format. + +<_industry_orig_note_>*/ + + +*<_industry_orig_> + gen industry_orig = b4p9 + tostring industry_orig, replace + replace industry_orig = "" if industry_orig=="." + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + tostring industrycat_isic, replace format(%04.0f) + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = b4p9 + recode industrycat10 (01/04=1) (05=2) (06/09=3) (10=4) (11=5) (12=6) (13=7) (14=8) (15=9) (16 00 17=10) + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4 "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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_occup_> + gen occup = . + replace occup = . if lstatus!=1 + 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_note_> + +The raw dataset has two wage-related variables --- b4p11mg, average weekly net salary +and b4p11b1, average monthly net salary; both refer to the wage received from the main job. + +Note that these two variables reflect AVERAGE wage instead of LAST payment. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = b4p11b1 + replace wage_no_compen=. if lstatus!=1 | empstat==2 | wage_no_compen==0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + 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 = b4p8jj + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_> + gen byte contract = . + 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 = . 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 = . + 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 = . + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2 = . + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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_note_> + +According to the original variable "b4r19", we only know whether a given respondent +had a work or not in the last year. We do not know among those who did not have +a work, who were actively seeking a job. Therefore, we cannot decide who are unemployed +nor who are non-labor force. + +Same reason for leaving "potential_lf_year" missing. + +<_lstatus_year_note_>*/ + + +*<_lstatus_year_> + gen byte lstatus_year = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year =. + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/IDN/IDN_1993_SAKERNAS/IDN_1993_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1993_SAKERNAS_V01_M_V06_A_GLD_ALL.do b/GLD/IDN/IDN_1993_SAKERNAS/IDN_1993_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1993_SAKERNAS_V01_M_V06_A_GLD_ALL.do new file mode 100644 index 000000000..11b8ed2af --- /dev/null +++ b/GLD/IDN/IDN_1993_SAKERNAS/IDN_1993_SAKERNAS_V01_M_V06_A_GLD/Programs/IDN_1993_SAKERNAS_V01_M_V06_A_GLD_ALL.do @@ -0,0 +1,1656 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1993_Sakernas_v01_M_v05_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-07-25 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1993 +<_Study ID_> IDN_1993_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 81,618 +<_Sample size (IND)_> 279,784 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> N/A +<_OCCUP National_> N/A +<_ISIC Version_> N/A +<_INDUS National_> N/A +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1993_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2023-01-12] File: [IDN_1993_Sakernas_v01_M_v03_A_GLD.do] - [Change directories; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_1993_Sakernas_v01_M_v04_A_GLD.do] - [Recode "industry_orig"; change "Z" drive to "Y" drive] +* Date: [2023-04-05] File: [IDN_1993_Sakernas_v01_M_v05_A_GLD.do] - [Set "wage_no_compen" to missing for unpaid workers and zero values] +* Date: [2026-3-12] File: [IDN_1993_Sakernas_v01_M_v06_A_GLD.do] - [Change subnatid to string, revise subnatidsurvey] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1993" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V06" + +* 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'\sakernas93.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = 1993 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1993 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// prop = province +// kab = district/city +// koped = urban/rural +// nks = sample code number +// nous = household sample sequential number +// nour = serial number of households + +<_hhid_note_>*/ + + +*<_hhid_> + sort prop kab koped nks nous nour + egen hhid = group(prop kab koped nks nous nour) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 279,784 100.00 100.00 +------------+----------------------------------- + Total | 279,784 100.00 + +<_pid_note_>*/ + + +*<_pid_> + duplicates drop + gen pid = string(_n,"%06.0f") + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = inflate + label var weight "Survey sampling weight" +* + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + tostring kuart, gen(wave) format(%02.0f) + replace wave = "Q" + substr(wave, 2, 1) + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +/*<_urban_note_> + +Variable "koped" in the raw dataset is urban/rural variable but somehow this variable +is wrongly coded --- it has 10 categories and does not have any value labels. +Therefore, we do not know about the urban/rural status. + +<_urban_note_>*/ + + +*<_urban_> + gen byte urban = . + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1_copy = prop + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 54 "54 - TIMUR TIMOR" 53 "53 - NUSA TENGGARA TIMUR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + +Both province and district only have codes without name labels. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = kab + tostring code_kab, format (%02.0f) replace + gen code_prop = prop + tostring code_prop, format (%02.0f) replace + gen subnatid2 = code_prop + code_kab + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen byte subnatid3 = . + label de lblsubnatid3 1 "1 - Name" + label values subnatid3 lblsubnatid3 + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey = subnatid1 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen byte hsize = jart + label var hsize "Household size" +* + + +*<_age_> + gen age = b4p2 + label var age "Individual age" +* + + +*<_male_> + gen male = b4p1 + 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 = . + 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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = relationharm + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = . + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var eye_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var eye_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var eye_dsablty "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +/*<_school_note_> + +Note that variable "school" refers to be currently attending school; but the only +variable viable for "school" is "b4p4", which indicates the primary activity +during the previous week. Because we are not sure whether people have other primary +activities are attending school or not, there is no category zero. + +<_school_note_>*/ + + +*<_school_> + gen byte school = . + replace school = 1 if b4p4 == 2 + replace school = . if age + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +Original code list of variable "b4p3" in the dataset: + +1.Not/never been in school +2.Not finished primary school yet +3.Primary school +4.Junior high school +5.Vocational Jr. school +6.Senior high school +7.Vocational high school +8.Diploma I/II +9.Academy/Diploma III +0.Diploma IV/Bachelor/Postgraduate + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +*/ + + +*<_educy_> + gen byte educy = . + replace educy = . if age + + +*<_educat7_> + gen byte educat7 = b4p3 + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4p3 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4p3 + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4p4==1)" or + "worked at least for 1 hour last week (b4p5==1)" or + "has a job/business but temporarily didn't work (b4p6==1)"; +unemployed: "who do not have a job/business (b4p6==2)" & seeking a job (b4p13==1); +non-labor force: "who do not have a job/business (b4p6==2)" & not seeking a job (b4p13=!1). + +Labor force participation: 55.80% + +<_lstatus_note_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if b4p4==1 | b4p5==1 | b4p6==1 + replace lstatus = 2 if b4p6==2 & b4p13==1 + replace lstatus = 3 if b4p6==2 & b4p13==2 + replace lstatus = 2 if b4p13==1 & lstatus==. + replace lstatus = 3 if b4p13==2 & lstatus==. + replace lstatus = . if age < minlaborage + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4p13==1 & b4p14==2) +2)searching but not immediately available to work (b4p14==1 & b4p13==2) + +Note that there are observations who want to accept a job (seen as being available) +but not seeking for a job, which is different from year 1989. But no observation +satisfies the second requirement. + +. tab b4p13 b4p14, m + + Seeking | Want to accept a job + for a job | Yes No . | Total +-----------+---------------------------------+---------- + Yes | 0 0 7,601 | 7,601 + No | 55,328 216,855 0 | 272,183 +-----------+---------------------------------+---------- + Total | 55,328 216,855 7,601 | 279,784 + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if [ b4p13==1 & b4p14==2 ] | [ b4p14==1 & b4p13==2] + replace potential_lf = 0 if [ b4p13==1 & b4p14==1 ] | [ b4p14==2 & b4p13==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason = . + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +Period of job seeking, or variable "b4p16" is not a range in the raw dataset. +The unit is month but it is a specific value. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + gen byte unempldur_l = b4p16 + replace unempldur_l = . if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4p16 + 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 = b4p10 if inrange(b4p10, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + replace empstat = . if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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_note_> + +The original code list of industry has 18 categories from 00 to 17. But the +coding in the dataset is not correct. Some of the categories are named in the +format of two digits, like 00 to 09 whereas the others are in one-digit format. + +So for the variable "industry_orig", I corrected the very original codes and +use the two-digit format. + +<_industry_orig_note_>*/ + + +*<_industry_orig_> + gen industry_orig = b4p9 + tostring industry_orig, replace + replace industry_orig = "" if industry_orig=="." + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + tostring industrycat_isic, replace format(%04.0f) + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = b4p9 + recode industrycat10 (01/04=1) (05=2) (06/09=3) (10=4) (11=5) (12=6) (13=7) (14=8) (15=9) (16 00 17=10) + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4 "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 = . + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_occup_> + gen occup = . + replace occup = . if lstatus!=1 + 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_note_> + +The raw dataset has two wage-related variables --- b4p11mg, average weekly net salary +and b4p11bl, average monthly net salary; both refer to the wage received from the main job. + +Note that these two variables reflect AVERAGE wage instead of LAST payment. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = b4p11bl + replace wage_no_compen=. if lstatus!=1 | empstat==2 | wage_no_compen==0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + + +*<_unitwage_> + gen byte unitwage = 5 + 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 = b4p12jj + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_> + gen byte contract = . + 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 = . 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 = . + 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 = . + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2 = . + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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_> + +According to the original variable "b4r19", we only know whether a given respondent +had a work or not in the last year. We do not know among those who did not have +a work, who were actively seeking a job. Therefore, we cannot decide who are unemployed +nor who are non-labor force. + +Same reason for leaving "potential_lf_year" missing. + +<_lstatus_year_>*/ + + +*<_lstatus_year_> + gen byte lstatus_year = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year =. + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/IDN/IDN_1994_SAKERNAS/IDN_1994_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1994_SAKERNAS_V01_M_V08_A_GLD_ALL.do b/GLD/IDN/IDN_1994_SAKERNAS/IDN_1994_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1994_SAKERNAS_V01_M_V08_A_GLD_ALL.do new file mode 100644 index 000000000..d0691503e --- /dev/null +++ b/GLD/IDN/IDN_1994_SAKERNAS/IDN_1994_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1994_SAKERNAS_V01_M_V08_A_GLD_ALL.do @@ -0,0 +1,1709 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1994_Sakernas_v01_M_v07_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-07-25 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1994 +<_Study ID_> IDN_1994_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 72,457 +<_Sample size (IND)_> 245,207 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 1968 +<_OCCUP National_> KBJI 1982 +<_ISIC Version_> N/A +<_INDUS National_> KBLI 1990 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1994_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2022-08-24] File: [IDN_1994_Sakernas_v01_M_v03_A_GLD.do] - [Recode "occup_skill" and "occup"; change path to the intermediate file] +* Date: [2022-11-07] File: [IDN_1994_Sakernas_v01_M_v04_A_GLD.do] - [Added occup based on KBJI1982 two digits and KBJI2002 one digit] +* Date: [2023-01-12] File: [IDN_1994_Sakernas_v01_M_v05_A_GLD.do] - [Change directories; revised lstatus: seeking work question used was changed from b4p15 to b4p14; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_1994_Sakernas_v01_M_v06_A_GLD.do] - [Recode "industry_orig" & "occup_orig"; change "Z" drive to "Y" drive; set "wage_no_compen" to missing for unpaid workers and zero values.] +* Date: [2023-04-04] File: [IDN_1994_Sakernas_v01_M_v07_A_GLD.do] - [Updated "occup" and helper data file; set "wage_no_compen" to missing for unpaid workers and zero values] +* Date: [2026-03-12] File: [IDN_1994_Sakernas_v01_M_v08_A_GLD.do] - [Revise "subnatidsurvey"] + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1994" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V08" + +* 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'\sakernas94.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = "isco_1968" + 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 = 1994 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1994 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// prop = province +// kab = district/city +// daerah = urban/rural +// nokode = sample code number +// nosamp = household sample sequential number + +<_hhid_note_>*/ + + +*<_hhid_> + sort prop kab daerah nokode nosamp + egen hhid = group(prop kab daerah nokode nosamp) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 245,207 100.00 100.00 +------------+----------------------------------- + Total | 245,207 100.00 + +<_pid_note_>*/ + + +*<_pid_> + duplicates drop + gen pid = string(_n,"%06.0f") + label var pid "Individual ID" +* + + +*<_weight_> + *gen weight = . + label var weight "Survey sampling weight" +* + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen byte urban = daerah + recode urban (2=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen subnatid1_copy = prop + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 54 "54 - TIMUR TIMOR" 53 "53 - NUSA TENGGARA TIMUR" 54 "54 - TIMUR TIMOR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + + Because SAKERNAS 1994 does not have the district name variable as other years, yet it has the same districts surveyed in 2013. Therefore, I used districts' names and codes in 2013 to codify subnatid2 in 1994. + + But note that 27 district codes only appear in 1994 (no district labels) not in 2013: +.25 +1171 1472 +3218 3219 3220 3273 +5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 +6271 +7319 7320 7321 7371 +8208 8209 +These districts' names were left missing. + +Province 54 - East Timor became indipendent from Indonesia in 2002. All districts in province 54 do not have names as in no year do these districts have name labels. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = kab + tostring code_kab, format (%02.0f) replace + gen code_prop = prop + tostring code_prop, format (%02.0f) replace + gen subnatid2_code = code_prop + code_kab + rename subnatid2_code b1p02 + merge n:1 b1p02 using "`path_in_stata'\district_list_2013.dta" + drop if _merge==2 + drop _merge + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen byte subnatid3 = . + label de lblsubnatid3 1 "1 - Name" + label values subnatid3 lblsubnatid3 + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey = subnatid1 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen byte hsize = jart + label var hsize "Household size" +* + + +*<_age_> + gen age = b4p2 + label var age "Individual age" +* + + +*<_male_> + gen male = b4p1 + 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 = . + 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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = relationharm + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = . + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var eye_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var eye_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var eye_dsablty "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +/*<_school_note_> + +Note that variable "school" refers to be currently attending school; but the only +variable viable for "school" is "b4p4", which indicates the primary activity +during the previous week. Because we are not sure whether people have other primary +activities are attending school or not, there is no category zero. + +<_school_note_>*/ + + +*<_school_> + gen byte school = . + replace school = 1 if b4p4 == 2 + replace school=. if age + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +Original code list of variable "b4p3" in the dataset: + +1.Not/never been in school +2.Not finished primary school yet +3.Primary school +4.Junior high school +5.Vocational Jr. school +6.Senior high school +7.Vocational high school +8.Diploma I/II +9.Academy/Diploma III +0.Diploma IV/Bachelor/Postgraduate + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +*/ + + +*<_educy_> + gen byte educy = . + replace educy = . if age + + +*<_educat7_> + gen byte educat7 = b4p3 + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4p3 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4p3 + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4p4==1)" or + "worked at least for 1 hour last week (b4p5==1)" or + "has a job/business but temporarily didn't work (b4p6==1)"; +unemployed: "who do not have a job/business (b4p6==2)" & seeking a job (b4p14==1); +non-labor force: "who do not have a job/business (b4p6==2)" & not seeking a job (b4p14=!1). + +Labor force participation: 60.17% + +<_lstatus_note_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if b4p4==1 | b4p5==1 | b4p6==1 + replace lstatus = 2 if b4p6==2 & b4p14==1 + replace lstatus = 3 if b4p6==2 & b4p14==2 + replace lstatus = . if age < minlaborage + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4p15==1 & b4p14==2) +2)searching but not immediately available to work (b4p14==1 & b4p15==2) + +Note that there are observations who want to accept a job (seen as being available) +but not seeking for a job, which is different from year 1989. But no observation +satisfies the second requirement. + +In this case, 55,680 observations fit the requirement and will be assigned any non-missing values. + +. tab b4p15 b4p14, m + + Want to | + accept a | Seeking for a job + job | Yes No . | Total +-----------+---------------------------------+---------- + Yes | 0 50,096 0 | 50,096 + No | 0 184,159 0 | 184,159 + . | 10,950 0 2 | 10,952 +-----------+---------------------------------+---------- + Total | 10,950 234,255 2 | 245,207 + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if [ b4p15==1 & b4p14==2 ] | [ b4p14==1 & b4p15==2] + replace potential_lf = 0 if [ b4p15==1 & b4p14==1 ] | [ b4p14==2 & b4p15==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason = . + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +Period of job seeking, or variable "b4p17" is not a range in the raw dataset. +The unit is month but it is a specific value. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + gen byte unempldur_l = b4p17 + replace unempldur_l = . if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4p17 + 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 = b4p11 if inrange(b4p11, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + replace empstat = . if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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_note_> + +The original code list of industry has 18 categories from 00 to 17. But the +coding in the dataset is not correct. Some of the categories are named in the +format of two digits, like 00 to 09 whereas the others are in one-digit format. + +So for the variable "industry_orig", I corrected the very original codes and +use the two-digit format. + +<_industry_orig_note_>*/ + + +*<_industry_orig_> + gen industry_orig = b4p9 + tostring industry_orig, replace + replace industry_orig = "" if industry_orig=="." + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + tostring industrycat_isic, replace format(%04.0f) + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = b4p9 + recode industrycat10 (01/04=1) (05=2) (06/09=3) (10=4) (11=5) (12=6) (13=7) (14=8) (15=9) (16 00 17=10) + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4 "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 = b4p10 + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = b4p10 + recode occup_isco (55=5) + replace occup_isco = occup_isco*100 + tostring occup_isco, replace format(%04.0f) + replace occup_isco = "" if occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + +* Make occup var to match in merge, depends on the year we are looking at + gen kji1982_2d = b4p10 + +* Merge with 2 digit mapping + merge m:1 kji1982_2d educat7 using "`path_in_stata'\kji_corresp_2d.dta", keep(match master) nogen + +* Quick check, which codes where not matched + tab kji1982_2d if missing(option_1) + +* Set seed so process is reproducible +* Kapuas river, Indonesia's longest stands at 1143 KM (https://en.wikipedia.org/wiki/Kapuas_River) + set seed 1143 + +* Generate uniform random variable, the logic is, it will lie between 0 and 1 and fall +* within the cumulation category with the probability from the 2011 to 2015 data + gen helper_occup = uniform() + +* Assing fix cases + gen occup = . + replace occup = option_1 if !missing(kji1982_2d) & probs_1 == 1 + +* Assigng binary cases based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup <= probs_1 + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup > probs_1 + +* Assign three way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_3) + +* Assign four way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_3) + replace occup = option_4 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_4) + replace occup = 10 if occup==0 + replace occup=. if lstatus!=1 + label var occup "1 digit occupational classification, primary job 7 day recall" + la de lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians and associate professionals" 4 "Clerical support workers" 5 "Service and market sales workers" 6 "Skilled agricultural, forestry and fishery workers" 7 "Craft and related trades workers" 8 "Plant and machine operators, and assemblers" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill=occup + recode occup_skill (1/3=3) (4/8=2) (9=1) (0=.) + replace occup_skill = . if lstatus!=1 + label define lbl_occup_skill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lbl_occup_skill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +/*<_wage_no_compen_note_> + +The raw dataset has two wage-related variables --- b4p12mg, average weekly net salary +and b4p12bl, average monthly net salary; both refer to the wage received from the main job. + +Note that these two variables reflect AVERAGE wage instead of LAST payment. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = b4p12bl + replace wage_no_compen=. if lstatus!=1 | empstat==2 | wage_no_compen==0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + 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 = b4p13jj + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_> + gen byte contract = . + 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 = . 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 = . + 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 = . + label var empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + label var ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 lblocusec +* + + +*<_industry_orig_2_> + gen industry_orig_2 = . + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = . + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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_note_> + +According to the original variable "b4r19", we only know whether a given respondent +had a work or not in the last year. We do not know among those who did not have +a work, who were actively seeking a job. Therefore, we cannot decide who are unemployed +nor who are non-labor force. + +Same reason for leaving "potential_lf_year" missing. + +<_lstatus_year_note_>*/ + + +*<_lstatus_year_> + gen byte lstatus_year = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year =. + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/IDN/IDN_1996_SAKERNAS/IDN_1996_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1996_SAKERNAS_V01_M_V08_A_GLD_ALL.do b/GLD/IDN/IDN_1996_SAKERNAS/IDN_1996_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1996_SAKERNAS_V01_M_V08_A_GLD_ALL.do new file mode 100644 index 000000000..f98830081 --- /dev/null +++ b/GLD/IDN/IDN_1996_SAKERNAS/IDN_1996_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1996_SAKERNAS_V01_M_V08_A_GLD_ALL.do @@ -0,0 +1,1782 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1996_Sakernas_v01_M_v07_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-07-30 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1996 +<_Study ID_> IDN_1996_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 73,629 +<_Sample size (IND)_> 247,190 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 1968 +<_OCCUP National_> KBJI 1982 +<_ISIC Version_> N/A +<_INDUS National_> KBLI 1990 +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1996_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2022-08-24] File: [IDN_1996_Sakernas_v01_M_v03_A_GLD.do] - [Recode "occup_skill" and "occup"; change path to the intermediate file] +* Date: [2022-11-07] File: [IDN_1996_Sakernas_v01_M_v04_A_GLD.do] - [Added occup based on KBJI1982 two digits and KBJI2002 one digit] +* Date: [2023-01-12] File: [IDN_1996_Sakernas_v01_M_v05_A_GLD.do] - [Change directories; revised lstatus: seeking work question used was changed from b4p15 to b4p14; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_1996_Sakernas_v01_M_v06_A_GLD.do] - [Recode "industry_orig" & "occup_orig"; change "Z" drive to "Y" drive] +* Date: [2023-04-05] File: [IDN_1996_Sakernas_v01_M_v07_A_GLD.do] - [Updated "occup" and helper data file; set employed and unemployed observations'nlfreason to missing; set "wage_no_compen" to missing for unpaid workers and zero values.] +* Date: [2026-03-12] File: [IDN_1996_Sakernas_V01_M_V08_A_GLD.do] - [Revise "subnatidsurvey"] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1996" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V08" + +* 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'\sakernas96.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = "isco_1968" + 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 = 1996 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1996 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Note that 136,655 observations' or 40,356 households' number of household member do +not match the original household size variable "b1r12". + + bys hhid: egen hhsize=count(pid) + gen gap=hhsize-b1r12 + codebook hhid if gap!=0 + codebook pid if gap!=0 + gen unmatch=cond(gap!=0, 1, 0) + tab unmatch + + gen hhsize_larger=cond(gap>0, 1, 0) + replace hhsize_larger=. if gap==0 + tab hhsize_larger, m + + unmatch | Freq. Percent Cum. +------------+----------------------------------- + 0 | 110,544 44.72 44.72 + 1 | 136,655 55.28 100.00 +------------+----------------------------------- + Total | 247,199 100.00 + +hhsize_larg | + er | Freq. Percent Cum. +------------+----------------------------------- + 0 | 135,464 54.80 54.80 + 1 | 1,191 0.48 55.28 + . | 110,544 44.72 100.00 +------------+----------------------------------- + Total | 247,199 100.00 + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// b1r1 = province +// b1r2 = district/city +// b1r3 = sub-district +// b1r4 = village/kelurahan +// b1r5 = village/kelurahan classification +(urban/rural) +// b1r7 = sample code number +// b1r10 = household sample sequential number + +<_hhid__note_>*/ + + +*<_hhid_> + duplicates drop + sort b1r1-b1r10 + egen hhid = group(b1r1-b1r10) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 247,181 99.99 99.99 + 1 | 18 0.01 100.00 +------------+----------------------------------- + Total | 247,199 100.00 + +9 observations were dropped. + +<_pid__note_>*/ + + +*<_pid_> + gen pid = string(_n,"%06.0f") + tostring pid, replace + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = wgt96 + label var weight "Survey sampling weight" +* + + +/*<_psu_note_> + +We do know that the primary sampling unit of Sakernas is census block and the +census block number is in the questionnaire. However this information is not +provided due to it is part of the confidential information withheld by the NSO. + +<_psu_note_>*/ + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen byte urban = b1r5 + recode urban (2=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +/*<_subnatid1_note_> + +The original province variable "b1r1" does not have value label for category 54. +The name of category 54 is from year 1995. The province codelist is the same for +year 1995 and 1996 and East Timor is the only province missing among the 27 +provinces. + +Province 54 - Timur Timor became independent from Indonesia in 2002. + +<_subnatid1_note_>*/ + + +*<_subnatid1_> + gen subnatid1_copy = b1r1 + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 53 "53 - NUSA TENGGARA TIMUR" 54 "54 - TIMUR TIMOR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + + Because SAKERNAS 1996 does not have the district name variable as other years, yet it has the same districts surveyed in 2013. Therefore, I used districts' names and codes in 2013 to codify subnatid2 in 1996. + + But note that 27 district codes only appear in 1996 (no district labels) not in 2013: +1171 1472 +3218 3219 3220 3273 +5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 +6271 +7271 7319 7320 7321 7371 +8208 8209 +These districts' names were left missing. + +Province 54 - East Timor became indipendent from Indonesia in 2002. All districts in province 54 do not have names as in no year do these districts have name labels. + + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = b1r2 + tostring code_kab, format (%02.0f) replace + gen code_prop = b1r1 + tostring code_prop, format (%02.0f) replace + gen subnatid2_code = code_prop + code_kab + drop b1r2 + rename subnatid2_code b1r2 + merge n:1 b1r2 using "`path_in_stata'\district_list_2013.dta" + drop if _merge==2 + drop _merge + 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 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen byte hsize = b1r12 + label var hsize "Household size" +* + + +*<_age_> + gen age = b3k5 + label var age "Individual age" +* + + +*<_male_> + gen male = b3k4 + 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 = b3k3 + recode relationharm (4 7=5) (5=3) (8 9=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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = b3k3 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = b3k6 + recode marital (1=2) (2=1) (3=4) (4=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 = . + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var eye_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var eye_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var eye_dsablty "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_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" +* + + +*<_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_note> + +Education module is only asked to those 10 and older. + + */ + + +*<_ed_mod_age_> + gen byte ed_mod_age = 10 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen byte school = b3k7 + recode school (1 3=0) (2=1) + replace school = . if age + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +Original code list of variable "b4r2" in the dataset: + +1.No/never in school +2.No/not yet finish Primary School +3.Primary School +4.Public Junior High School +5.Vocational Junior High School +6.Public Senior High School +7.Vocational Senior High School +8.Diploma I/II +9.Academy/Diploma III +0.Diploma IV/Bachelor/Postgraduate + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing and so were educat7, educat5, +and educat4. + +*/ + + +*<_educy_> + gen byte educy = . + replace educy = . if age + + +*<_educat7_> + gen byte educat7 = b4r2 + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4r2 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4r2 + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4r3==1)" or + "worked at least for 1 hour last week (b4r4==1)" or + "has a job/business but temporarily didn't work (b4r5==1)"; +unemployed: "who do not have a job/business (b4r5==2)" & seeking a job (b4r14==1); +non-labor force: "who do not have a job/business (b4r5==2)" & not seeking a job (b4r14=!1). + +Labor force participation: 56.21% + +<_lstatus_note_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if b4r3==1 | b4r4==1 | b4r5==1 + replace lstatus = 2 if b4r4==2 & b4r14==1 + replace lstatus = 3 if b4r4==2 & b4r14==2 + replace lstatus = . if age < minlaborage + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4r16==1 & b4r14==2) or +2)searching but not immediately available to work (b4r14==1 & b4r16==2) + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if [ b4r16==1 & b4r14==2 ] | [b4r14==1 & b4r16==2] + replace potential_lf = 0 if [ b4r14==1 & b4r16==1 ] | [b4r14==2 & b4r16==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +/*<_nlfreason_note_> + +The original variable "b4r15 " has 5 non-missing categories: + 1 Did not need work + 2 Futile + 3 Attending school + 4 Housekeeping + 5 Others + +<_nlfreason_note_>*/ + + +*<_nlfreason_> + gen byte nlfreason = b4r15 + recode nlfreason (3=1) (4=2) (1/2=5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +The original variable "b4r18" is the period of seeking job. Therefore, the lower +and upper bound of unemploymenmt duration are the same. They are in fact the length +of unemployment period. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + gen byte unempldur_l = b4r18 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4r18 + 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 = b4r10 if inrange(b4r10, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + replace empstat = . if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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_note_> + +Variable "b4r8" has the KJI 1982 codes which is the national occupational +classifications. + +Variable "b4r9" has 48 unique values and seems to also follow the KJI 1982 +industrial classifications. +<_industry_orig_note_>*/ + + +*<_industry_orig_> + gen industry_orig = b4r9 + tostring industry_orig, replace + replace industry_orig = "" if industry_orig=="." + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10 = floor(b4r9/10) + replace industrycat10=10 if inrange(b4r9,92,99) + replace industrycat10=10 if industrycat10==0 + 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" + replace industrycat10 = . if lstatus!=1 + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4 "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 = b4r8 + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = b4r8 + recode occup_isco (55=5) + replace occup_isco = occup_isco*100 + tostring occup_isco, replace format(%04.0f) + replace occup_isco = "" if occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + +* Make occup var to match in merge, depends on the year we are looking at + gen kji1982_2d = b4r8 + +* Merge with 2 digit mapping + merge m:1 kji1982_2d educat7 using "`path_in_stata'\kji_corresp_2d.dta", keep(match master) nogen + +* Quick check, which codes where not matched + tab kji1982_2d if missing(option_1) + +* Set seed so process is reproducible +* Kapuas river, Indonesia's longest stands at 1143 KM (https://en.wikipedia.org/wiki/Kapuas_River) + set seed 1143 + +* Generate uniform random variable, the logic is, it will lie between 0 and 1 and fall +* within the cumulation category with the probability from the 2011 to 2015 data + gen helper_occup = uniform() + +* Assing fix cases + gen occup = . + replace occup = option_1 if !missing(kji1982_2d) & probs_1 == 1 + +* Assigng binary cases based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup <= probs_1 + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup > probs_1 + +* Assign three way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_3) + +* Assign four way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_3) + replace occup = option_4 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_4) + replace occup = 10 if occup==0 + replace occup=. if lstatus!=1 + label var occup "1 digit occupational classification, primary job 7 day recall" + la de lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians and associate professionals" 4 "Clerical support workers" 5 "Service and market sales workers" 6 "Skilled agricultural, forestry and fishery workers" 7 "Craft and related trades workers" 8 "Plant and machine operators, and assemblers" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill=occup + recode occup_skill (1/3=3) (4/8=2) (9=1) (0=.) + replace occup_skill = . if lstatus!=1 + label define lbl_occup_skill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lbl_occup_skill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +/*<_wage_no_compen_note_> + +In the raw dataset, question 13 devides into "in cash" and "in-kind". For each observation, I calculated the total income by adding up "in cash" and "in-kind" salary. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = b4r11a + b4r11b + replace wage_no_compen = . if lstatus!=1 | empstat==2 | wage_no_compen==0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + 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 = b4r7 + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_note_> + +We know the average monthly wage, which is "wage_no_compen". But since we do not know how +many months each observation works for, we left the annualized total wage missing. + +<_wage_total_note_>*/ + + +*<_wage_total_> + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract = . + 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 = . 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 = . + 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_note_> + +We do not have information on the employment status of the main additional job. But we know whether the respondent has a second job. Therefore, for people who have a second job, they were all coded as "Other, unclassified workers." + +<_empstat_2_note_>*/ + + +*<_empstat_2_> + gen byte empstat_2 = 5 if b4r12==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_2 +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + 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_note_> + +There are two original variables concerning industrial classification: + +b4r13 --- Type of industry/line of business of the main additional job +b4r20 --- Type of industry/activities of job during the previous year + +Variable "b4r13" is not 7-day reference and it does not have value labels. +It follows KJI 1982 industrial classifications. + +<_industry_orig_2_note_>*/ + + +*<_industry_orig_2_> + gen industry_orig_2 = b4r13 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = "" + tostring industrycat_isic_2, replace format(%04.0f) + replace industrycat_isic_2= "" if b4r12!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1) (2 3 4 5 =2) (6 7 8 9=3) (10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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 < minlaborage & age != . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year =. + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = b4r20 + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/IDN/IDN_1997_SAKERNAS/IDN_1997_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1997_SAKERNAS_V01_M_V08_A_GLD_ALL.do b/GLD/IDN/IDN_1997_SAKERNAS/IDN_1997_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1997_SAKERNAS_V01_M_V08_A_GLD_ALL.do new file mode 100644 index 000000000..e94ffb02d --- /dev/null +++ b/GLD/IDN/IDN_1997_SAKERNAS/IDN_1997_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1997_SAKERNAS_V01_M_V08_A_GLD_ALL.do @@ -0,0 +1,1756 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1997_Sakernas_v01_M_v07_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-08-18 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1997 +<_Study ID_> IDN_1997_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 65,648 +<_Sample size (IND)_> 219,439 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 1968 +<_OCCUP National_> KBJI 1982 +<_ISIC Version_> N/A +<_INDUS National_> KBLI 1997 +--------------------------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1997_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2022-08-24] File: [IDN_1997_Sakernas_v01_M_v03_A_GLD.do] - [Recode "occup_skill" and "occup"; change path to the intermediate file] +* Date: [2022-11-07] File: [IDN_1997_Sakernas_v01_M_v04_A_GLD.do] - [Recode "occup_skill" and "occup"; change path to the intermediate file] +* Date: [2023-01-12] File: [IDN_1997_Sakernas_v01_M_v05_A_GLD.do] - [Change directories; fix "primary school completed" of educat7; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_1997_Sakernas_v01_M_v06_A_GLD.do] - [Recode "industry_orig" & "occup_orig"; change "Z" drive to "Y" drive] +* Date: [2023-04-04] File: [IDN_1997_Sakernas_v01_M_v07_A_GLD.do] - [Updated "occup" and helper data file; set "industry_orig" to missing as the original variable only has two unknown categories; set employed and unemployed observations' non-labor force reason to missing; added variable "empstat"; set "wage_no_compen" to missing for unpaid workers and zero values] +* Date: [2026-03-12] File: [IDN_1997_Sakernas_V01_M_V08_A_GLD.do] - [Revise "subnatidsurvey"] + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1997" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V08" + +* 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'\sakernas97.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = "isco_1968" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 1997 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1997 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// b1p01 = province +// b1p02= district/city +// b1p03= sub-district +// b1p04= village/kelurahan +// b1p05= village/kelurahan classification +(urban/rural) +// b1p07= sample code number +// b1p10= household sample sequential number + +<_hhid_note_>*/ + + +*<_hhid_> + sort b1p1-b1p10 + egen hhid = group(b1p1-b1p10) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 219,439 100.00 100.00 +------------+----------------------------------- + Total | 219,439 100.00 + + +<_pid_note_>*/ + + +*<_pid_> + duplicates drop + gen pid = string(_n,"%06.0f") + tostring pid, replace + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = timbang + label var weight "Survey sampling weight" +* + + +/*<_psu_note_> + +We do know that the primary sampling unit of Sakernas is census block and the +census block number is in the questionnaire. However this information is not +provided due to it is part of the confidential information withheld by the NSO. + +<_psu_note_>*/ + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ +{ + +*<_urban_> + gen urban = b1p5 + recode urban (2=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +/*<_subnatid1_note_> + +Province 54 - Timur Timor became independent from Indonesia in 2002. + +<_subnatid1_note_>*/ + + +*<_subnatid1_> + gen subnatid1_copy = b1p1 + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 53 "53 - NUSA TENGGARA TIMUR" 54 "54 - TIMUR TIMOR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + + Because SAKERNAS 1997 does not have the district name variable as other years, yet it has the same districts surveyed in 2013. Therefore, I used districts' names and codes in 2013 to codify subnatid2 in 1997. + + But note that 27 district codes only appear in 1997 (no district labels) not in 2013: +1171 1472 +3218 3219 3220 3273 +5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 +6271 +7271 7319 7320 7321 7371 +8208 8209 +These districts' names were left missing. + +Province 54 - East Timor became indipendent from Indonesia in 2002. All districts in province 54 do not have names as in no year do these districts have name labels. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = b1p2 + tostring code_kab, format (%02.0f) replace + gen code_prop = b1p1 + tostring code_prop, format (%02.0f) replace + gen subnatid2_code = code_prop + code_kab + drop b1p2 + rename subnatid2_code b1p2 + merge n:1 b1p2 using "`path_in_stata'\district_list_2013.dta" + drop if _merge==2 + 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 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen hsize = b1p12 + label var hsize "Household size" +* + + +*<_age_> + gen age = b3p5 + label var age "Individual age" +* + + +*<_male_> + gen male = b3p4 + 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 = b3p3 + recode relationharm (4 5=3) (6=4) (7=5) (8 9=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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = b3p3 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = b3p6 + recode marital (1=2) (2=1) (3=4) (4=5) + label var marital "Marital status" + la de lblmarital4 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + gen eye_dsablty = . + label var eye_dsablty "Disability related to eyesight" + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var hear_dsablty "Disability related to hearing" + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var walk_dsablty "Disability related to walking or climbing stairs" + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label var comm_dsablty "Disability related to communicating" + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty +* + +} + + +/*%%============================================================================================= + 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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen byte school = b3p7 + recode school (1 3=0) (2=1) + replace school = . if age < ed_mod_age & age!=. + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +"Packet A": an educational level equavalent to the primary school level; +"Packet B": an educational level equavalent to the junior high school level of education; +"Packet C": an educational level equavalent to the senior seconddary level. + +Original code list of variable "b4p1" in the dataset: + +00 No/Not in school yet +11/12/13 Did not complete/have not completed primary school +21/22/23 Primary school +31/32/33 Public school junior high +41/42/43 Vocational junior school +51/52/53 Senior high school +61/62/63 Vocational senior high school +71/72/73 Diploma I/II +81/82/83 Diploma III +91/92/93 Univ./Diploma IV + +*/ + + +*<_educy_> + gen byte educy = . + replace educy=. if age < ed_mod_age & age!=. + label var educy "Years of education" +* + + +*<_educat7_> + tostring b4p1, gen(educat7_sub) + gen educat7_sub1 = substr(educat7_sub, 1, 1) + destring educat7_sub1, gen (educat7) + recode educat7 (0=1) (1=2) (2=3) (3/4=4) (5/6=5) (7/8=6) (9=7) + replace educat7 = . if age < ed_mod_age & age!=. + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4p1 + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4p1 + recode educat_isced (0=020) (1/2=100) (3/4=244) (5/6=344) (7=454) (8=550) (9=660) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4p4b==1)" or + "worked at least 1 hour during the last week (b4p5==1)" or + "has a job but was temporarily out of work (b4p8==1)"; +unemployed: "who do not have a job/business lstatus != 1" & "seeking a job (b4p15==1)" +non-labor force: "who do not have a job/business lstatus != 1" & "not seeking a job (b4p15==2)" + +labour force participation: 56.78% + +. count if !mi(b4p8) + 121,541 + +<_lstatus_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if b4p4b==1 | b4p5==1 | b4p8==1 + replace lstatus = 2 if lstatus != 1 & (b4p15==1) + replace lstatus = 3 if lstatus != 1 & (b4p15==2) + replace lstatus = . if age < minlaborage + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4p21==1 & (b4p15==2)) or +2)searching but not immediately available to work (b4p15==1) & b4p21==2 + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if [b4p21==1 & (b4p15==2)] | [ b4p15==1 & b4p21==2 ] + replace potential_lf = 0 if [b4p21==1 & b4p15==1] | [ b4p15==2 & b4p21==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +/*<_nlfreason_note_> + +The original variable "b4p20" has 6 non-missing categories: + 1 Satisfied with current job/no need + 2 Futile + 3 Attending schooling + 4 Housekeeping + 5 Not able to work + 6 Other + +<_nlfreason_note_>*/ + + +*<_nlfreason_> + gen byte nlfreason = b4p20 + recode nlfreason (3=1) (4=2) (5=4) (1 2 6=5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +The original variable "b4p18" is the period of seeking job. Therefore, the lower +and upper bound of unemploymenmt duration are the same. They are in fact the length +of unemployment period. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + gen byte unempldur_l = b4p18 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4p18 + replace unempldur_u = . if lstatus!=2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +/*<_empstat_note_> + +In the questionnaire this question has 5 categories: + +1.Self-employed +2.Self-employed assisted by workers/temporary workers /unpaid workers/temporary +3.Self-employed assisted by workers/permanent employees +4.Worker/employee/paid worker +5.Unpaid worker + +But the first two categories were wrongly labeled and named in the raw dataset. + +*<_empstat_note_>*/ + + +*<_empstat_> + gen byte empstat = b4p11 + recode empstat (1/3=4) (4=1) (5=2) + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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 = "" + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +/*<_industrycat_isic_note_> + +The original industrial classification used in 1997, "b4p6", is supposed to be KBLI 1997 which is based on ISIC Rev.3 . + +However, in the raw dataset, "b4p6" only has two categories without labels. Since we do not know what these categories represent and they do not match the structure of KBLI1997, following industry mappings were not coded. + +<_industrycat_isic_note_>*/ + + +*<_industrycat_isic_> + gen industrycat_isic = . + replace industrycat_isic = . if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen byte industrycat10 = . + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1) (2 3 4 5 =2) (6 7 8 9=3) (10=4) + label var industrycat4 "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 = b4p9 + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = b4p9 + recode occup_isco (55=5) (65/67=.) + replace occup_isco = occup_isco*100 + tostring occup_isco, replace format(%04.0f) + replace occup_isco = "" if occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> +* Make occup var to match in merge, depends on the year we are looking at + gen kji1982_2d = b4p9 + +* Merge with 2 digit mapping + merge m:1 kji1982_2d educat7 using "`path_in_stata'\kji_corresp_2d.dta", keep(match master) nogen + +* Quick check, which codes where not matched + tab kji1982_2d if missing(option_1) + +* Set seed so process is reproducible +* Kapuas river, Indonesia's longest stands at 1143 KM (https://en.wikipedia.org/wiki/Kapuas_River) + set seed 1143 + +* Generate uniform random variable, the logic is, it will lie between 0 and 1 and fall +* within the cumulation category with the probability from the 2011 to 2015 data + gen helper_occup = uniform() + +* Assing fix cases + gen occup = . + replace occup = option_1 if !missing(kji1982_2d) & probs_1 == 1 + +* Assigng binary cases based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup <= probs_1 + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup > probs_1 + +* Assign three way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_3) + +* Assign four way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_3) + replace occup = option_4 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_4) + replace occup = 10 if occup==0 + replace occup=. if lstatus!=1 + label var occup "1 digit occupational classification, primary job 7 day recall" + la de lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians and associate professionals" 4 "Clerical support workers" 5 "Service and market sales workers" 6 "Skilled agricultural, forestry and fishery workers" 7 "Craft and related trades workers" 8 "Plant and machine operators, and assemblers" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill=occup + recode occup_skill (1/3=3) (4/8=2) (9=1) (0=.) + replace occup_skill = . if lstatus!=1 + label define lbl_occup_skill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lbl_occup_skill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +/*<_wage_no_compen_note_> + +In the raw dataset, question 13 devides into "in cash" and "in-kind". For each observation, I calculated the total income by adding up "in cash" and "in-kind" salary. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = b4p12a1 + b4p12a2 + replace wage_no_compen = . if lstatus!=1 | wage_no_compen==0 | empstat == 2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + 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 = b4p7b + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_note_> + +We know the average monthly wage, which is "wage_no_compen". But since we do not know how +many months each observation works for, we left the annualized total wage missing. + +<_wage_total_note_>*/ + + +*<_wage_total_> + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract = . + 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 = . 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_note_> + +We count both "old-age insurance" and "pension insurance" as indicators for having social security or not. A given respondent does not have social security if he/she does not have neither. + +<_socialsec_note_>*/ + + +*<_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 = . + 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_note_> + +This question was only asked to those who are seld-employed. + +<_firmsize_l_note_>*/ + + +*<_firmsize_l_> + gen byte firmsize_l = . + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u = . + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +/*<_empstat_2_note_> + +We do not have information on the employment status of the main additional job. But we know whether the respondent has a second job. Therefore, for people who have a second job, they were all coded as "Other, unclassified workers." + +<_empstat_2_note_>*/ + + +*<_empstat_2_> + gen byte empstat_2 = 5 if b4p13==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_2 +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + 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 = b4p14 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = "" + tostring industrycat_isic_2, replace format(%04.0f) + replace industrycat_isic_2= "" if b4p13!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1) (2 3 4 5 =2) (6 7 8 9=3) (10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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 = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/IDN/IDN_1998_SAKERNAS/IDN_1998_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1998_SAKERNAS_V01_M_V08_A_GLD_ALL.do b/GLD/IDN/IDN_1998_SAKERNAS/IDN_1998_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1998_SAKERNAS_V01_M_V08_A_GLD_ALL.do new file mode 100644 index 000000000..0ea97ff98 --- /dev/null +++ b/GLD/IDN/IDN_1998_SAKERNAS/IDN_1998_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1998_SAKERNAS_V01_M_V08_A_GLD_ALL.do @@ -0,0 +1,1754 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1998_Sakernas_v01_M_v07_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-08-18 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1998 +<_Study ID_> IDN_1998_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 49,150 +<_Sample size (IND)_> 163,515 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 1968 +<_OCCUP National_> KBJI 1982 +<_ISIC Version_> N/A +<_INDUS National_> KBLI 1990 +--------------------------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1998_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2022-08-24] File: [IDN_1998_Sakernas_v01_M_v03_A_GLD.do] - [Recode "occup_skill" and "occup"; change path to the intermediate file] +* Date: [2022-11-07] File: [IDN_1998_Sakernas_v01_M_v04_A_GLD.do] - [Added occup based on KBJI1982 two digits and KBJI2002 one digit] +* Date: [2023-01-12] File: [IDN_1998_Sakernas_v01_M_v05_A_GLD.do] - [Change directories; industrycat10 updated; ISIC version changed from ISIC Rev.3 to missing; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_1998_Sakernas_v01_M_v06_A_GLD.do] - [Recode "industry_orig" & "occup_orig"; change "Z" drive to "Y" drive] +* Date: [2023-04-05] File: [IDN_1998_Sakernas_v01_M_v07_A_GLD.do] - [Updated "occup" and helper data file; set "industry_orig" to missing as the original variable only has two unknown categories; set employed and unemployed observations' non-labor force reason to missing; set "wage_no_compen" to missing for unpaid workers and zero values.] +* Date: [2026-03-12] File: [IDN_1998_Sakernas_V01_M_V08_A_GLD.do] - [Revise "subnatidsurvey"] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1998" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V08" + +* 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'\sakernas98.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = "isco_1968" + 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 = 1998 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1998 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// b1p01 = province +// b1p02= district/city +// b1p03= sub-district +// b1p04= village/kelurahan +// b1p05= village/kelurahan classification +(urban/rural) +// b1p07= sample code number +// b1p10= household sample sequential number + +<_hhid_note_>*/ + + +*<_hhid_> + sort b1p1-b1p10 + egen hhid = group(b1p1-b1p10) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 163,513 100.00 100.00 + 1 | 4 0.00 100.00 +------------+----------------------------------- + Total | 163,517 100.00 + + 2 observations were dropped. + +<_pid_note_>*/ + + +*<_pid_> + duplicates drop + gen pid = string(_n,"%06.0f") + tostring pid, replace + label var pid "Individual ID" +* + + +*<_weight_> + destring weight, replace + label var weight "Survey sampling weight" +* + + +/*<_psu_note_> + +We do know that the primary sampling unit of Sakernas is census block and the +census block number is in the questionnaire. However this information is not +provided due to it is part of the confidential information withheld by the NSO. + +<_psu_note_>*/ + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ +{ + +*<_urban_> + destring b1p5, gen(urban) + recode urban (2=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +/*<_subnatid1_note_> + +Province 54 - Timur Timor became independent from Indonesia in 2002. + +<_subnatid1_note_>*/ + + +*<_subnatid1_> + destring b1p1, gen(subnatid1_copy) + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 53 "53 - NUSA TENGGARA TIMUR" 54 "54 - TIMUR TIMOR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + + Because SAKERNAS 1998 does not have the district name variable as other years, yet it has the same districts surveyed in 2013. Therefore, I used districts' names and codes in 2013 to codify subnatid2 in 1998. + + But note that 30 district codes only appear in 1998 (no district labels) not in 2013: +1171 1472 +3218 3219 3220 3273 +5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 +6271 +7271 7319 7320 7321 7371 +8208 8209 8210 8211 8212 +These districts' names were left missing. + +Province 54 - East Timor became indipendent from Indonesia in 2002. All districts in province 54 do not have names as in no year do these districts have name labels. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + destring b1p2, replace + gen code_kab = b1p2 + tostring code_kab, format (%02.0f) replace + destring b1p1, gen (code_prop) + tostring code_prop, format (%02.0f) replace + gen subnatid2_code = code_prop + code_kab + drop b1p2 + rename subnatid2_code b1p2 + merge n:1 b1p2 using "`path_in_stata'\district_list_2013.dta" + drop if _merge==2 + 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 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + destring b1p12, replace + gen hsize = b1p12 + label var hsize "Household size" +* + + +*<_age_> + destring b3p5, replace + gen age = b3p5 + label var age "Individual age" +* + + +*<_male_> + destring b3p4, replace + gen male = b3p4 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + destring b3p3, replace + gen byte relationharm = b3p3 + recode relationharm (4 5=3) (6=4) (7=5) (8 9=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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = b3p3 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + destring b3p6, replace + gen byte marital = b3p6 + recode marital (1=2) (2=1) (3=4) (4=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 = . + label var eye_dsablty "Disability related to eyesight" + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var hear_dsablty "Disability related to hearing" + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var walk_dsablty "Disability related to walking or climbing stairs" + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label var comm_dsablty "Disability related to communicating" + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty +* + +} + + +/*%%============================================================================================= + 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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + destring b3p7, replace + gen byte school = b3p7 + recode school (1 3=0) (2=1) + replace school=. if age < ed_mod_age & age!=. + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +"Packet A": an educational level equavalent to the primary school level; +"Packet B": an educational level equavalent to the junior high school level of education; +"Packet C": an educational level equavalent to the senior seconddary level. + +Original code list of variable "b4p1a" in the dataset: +0.University/D. IV +1.Did not attend/have not attended school +2.Did not complete/have not completed primary school +3.Primary school +4.Public junior high school/TSANAWIYAH +5.Vocational junior high school +6.Public senior high school/ALIYAH +7.Vocational senior high school +8.Diploma I/II +9.Diploma III + +*/ + + +*<_educy_> + gen byte educy = . + replace educy=. if age < ed_mod_age & age!=. + label var educy "Years of education" +* + + +*<_educat7_> + destring b4p1a, replace + gen byte educat7 = b4p1a + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age < ed_mod_age & age!=. + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4p1a + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4p1a + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4p2b ==1)" or + "worked at least 1 hour during the last week (b4p3==1)" or + "has a job but was temporarily out of work (b4p4==1)"; +unemployed: "who do not have a job/business lstatus != 1" & "seeking a job (b4p13==1)" +non-labor force: "who do not have a job/business lstatus != 1" & "not seeking a job (b4p13==2)" + +labour force participation: 58.98% + +. count if !mi(b4p6) + 91,242 + +<_lstatus_note_>*/ + + +*<_lstatus_> + destring b4p2b b4p3 b4p4 b4p13, replace + gen byte lstatus = . + replace lstatus = 1 if b4p2b==1 | b4p3==1 | b4p4==1 + replace lstatus = 2 if lstatus != 1 & (b4p13==1) + replace lstatus = 3 if lstatus != 1 & (b4p13==2) + replace lstatus = . if age < minlaborage + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4p19==1 & (b4p13==2)) or +2)searching but not immediately available to work (b4p13==1) & b4p19==2 + +*/ + + +*<_potential_lf_> + destring b4p19, replace + gen byte potential_lf = . + replace potential_lf = 1 if [b4p19==1 & (b4p13==2)] | [ b4p13==1 & b4p19==2 ] + replace potential_lf = 0 if [b4p19==1 & b4p13==1] | [ b4p13==2 & b4p19==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +/*<_nlfreason_note_> + +The original variable "b4p18" has 6 non-missing categories: + 1 Satisfied with current job/no need + 2 Futile + 3 Attending schooling + 4 Housekeeping + 5 Not able to work + 6 Other + +<_nlfreason_note_>*/ + + +*<_nlfreason_> + destring b4p18, replace + gen byte nlfreason = b4p18 + recode nlfreason (3=1) (4=2) (5=4) (1 2 6=5) + replace nlfreason = . if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +The original variable "b4p16" is the period of seeking job. Therefore, the lower +and upper bound of unemploymenmt duration are the same. They are in fact the length +of unemployment period. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + destring b4p16, replace + gen byte unempldur_l = b4p16 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4p16 + replace unempldur_u = . if lstatus!=2 + label var unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job------------------------------* + + +{ +*<_empstat_> + destring b4p9, replace + gen byte empstat = b4p9 if inrange(b4p9, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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 = b4p6 + tostring industry_orig, replace + replace industry_orig = "" if industry_orig=="." + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + destring b4p6, replace + gen industrycat10 = floor(b4p6/10) + replace industrycat10=10 if inrange(b4p6,92,99) + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + replace industrycat10 = . if lstatus!=1 + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1) (2 3 4 5 =2) (6 7 8 9=3) (10=4) + label var industrycat4 "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 = b4p7 + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + destring b4p7, replace + gen occup_isco = b4p7 + recode occup_isco (55=5) + replace occup_isco = occup_isco*100 + tostring occup_isco, replace format(%04.0f) + replace occup_isco = "" if occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> + +* Make occup var to match in merge, depends on the year we are looking at + gen kji1982_2d = b4p7 + +* Merge with 2 digit mapping + merge m:1 kji1982_2d educat7 using "`path_in_stata'\kji_corresp_2d.dta", keep(match master) nogen + +* Quick check, which codes where not matched + tab kji1982_2d if missing(option_1) + +* Set seed so process is reproducible +* Kapuas river, Indonesia's longest stands at 1143 KM (https://en.wikipedia.org/wiki/Kapuas_River) + set seed 1143 + +* Generate uniform random variable, the logic is, it will lie between 0 and 1 and fall +* within the cumulation category with the probability from the 2011 to 2015 data + gen helper_occup = uniform() + +* Assing fix cases + gen occup = . + replace occup = option_1 if !missing(kji1982_2d) & probs_1 == 1 + +* Assigng binary cases based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup <= probs_1 + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup > probs_1 + +* Assign three way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_3) + +* Assign four way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_3) + replace occup = option_4 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_4) + replace occup = 10 if occup==0 + replace occup=. if lstatus!=1 + label var occup "1 digit occupational classification, primary job 7 day recall" + la de lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians and associate professionals" 4 "Clerical support workers" 5 "Service and market sales workers" 6 "Skilled agricultural, forestry and fishery workers" 7 "Craft and related trades workers" 8 "Plant and machine operators, and assemblers" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill=occup + recode occup_skill (1/3=3) (4/8=2) (9=1) (0=.) + replace occup_skill = . if lstatus!=1 + label define lbl_occup_skill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lbl_occup_skill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +/*<_wage_no_compen_note_> + +In the raw dataset, question 13 devides into "in cash" and "in-kind". For each observation, I calculated the total income by adding up "in cash" and "in-kind" salary. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + destring b4p10a b4p10b, replace + gen double wage_no_compen = b4p10a + b4p10b + replace wage_no_compen = . if lstatus!=1 | empstat==2 | wage_no_compen==0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + 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_> + destring b4p5b, replace + gen whours = b4p5b + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_note_> + +We know the average monthly wage, which is "wage_no_compen". But since we do not know how +many months each observation works for, we left the annualized total wage missing. + +<_wage_total_note_>*/ + + +*<_wage_total_> + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract = . + 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 = . 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_note_> + +We count both "old-age insurance" and "pension insurance" as indicators for having social security or not. A given respondent does not have social security if he/she does not have neither. + +<_socialsec_note_>*/ + + +*<_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 = . + 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_note_> + +This question was only asked to those who are seld-employed. + +<_firmsize_l_note_>*/ + + +*<_firmsize_l_> + gen byte firmsize_l = . + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u = . + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +/*<_empstat_2_note_> + +We do not have information on the employment status of the main additional job. But we know whether the respondent has a second job. Therefore, for people who have a second job, they were all coded as "Other, unclassified workers." + +<_empstat_2_note_>*/ + + +*<_empstat_2_> + destring b4p11, replace + gen byte empstat_2 = 5 if b4p11==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_2 +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + 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 = b4p12 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = "" + tostring industrycat_isic_2, replace format(%04.0f) + replace industrycat_isic_2= "" if b4p11!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1) (2 3 4 5 =2) (6 7 8 9=3) (10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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 = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/IDN/IDN_1999_SAKERNAS/IDN_1999_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1999_SAKERNAS_V01_M_V08_A_GLD_ALL.do b/GLD/IDN/IDN_1999_SAKERNAS/IDN_1999_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1999_SAKERNAS_V01_M_V08_A_GLD_ALL.do new file mode 100644 index 000000000..9d66fd4f6 --- /dev/null +++ b/GLD/IDN/IDN_1999_SAKERNAS/IDN_1999_SAKERNAS_V01_M_V08_A_GLD/Programs/IDN_1999_SAKERNAS_V01_M_V08_A_GLD_ALL.do @@ -0,0 +1,1716 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_1999_Sakernas_v01_M_v07_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-08-18 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 1999 +<_Study ID_> IDN_1999_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 47,580 +<_Sample size (IND)_> 155,572 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> ISCO 1968 +<_OCCUP National_> KBJI 1982 +<_ISIC Version_> N/A +<_INDUS National_> KBLI 1990 +--------------------------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_1999_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2022-08-24] File: [IDN_1999_Sakernas_v01_M_v03_A_GLD.do] - [Recode "occup_skill" and "occup"; change path to the intermediate file] +* Date: [2022-11-07] File: [IDN_1999_Sakernas_v01_M_v04_A_GLD.do] - [Added occup based on KBJI1982 two digits and KBJI2002 one digit] +* Date: [2023-01-12] File: [IDN_1999_Sakernas_v01_M_v05_A_GLD.do] - [Educat7 correction & directories update; Changed directories; industrycat10 updated; ISIC version changed from ISIC Rev.3 to missing; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-04-04] File: [IDN_1999_Sakernas_v01_M_v07_A_GLD.do] - [Updated "occup" and helper data file; set employed and unemployed observations' non-labor force reason to missing; set "wage_no_compen" to missing for unpaid workers and zero values.] +* Date: [2026-03-12] File: [IDN_1999_Sakernas_V01_M_V08_A_GLD.do] - [Revise "subnatidsurvey"] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "1999" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V08" + +* 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'\sakernas99.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = "isco_1968" + 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 = 1999 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 1999 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// b1p01 = province +// b1p02= district/city +// b1p03= sub-district +// b1p04= village/kelurahan +// b1p05= village/kelurahan classification +(urban/rural) +// b1p07= sample code number +// b1p10= household sample sequential number + +<_hhid_note_>*/ + + +*<_hhid_> + sort b1p1-b1p10 + egen hhid = group(b1p1-b1p10) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 155,572 100.00 100.00 +------------+----------------------------------- + Total | 155,572 100.00 + +<_pid_note_>*/ + + +*<_pid_> + gen pid = string(_n,"%06.0f") + tostring pid, replace + label var pid "Individual ID" +* + + +*<_weight_> + *gen weight = . + label var weight "Survey sampling weight" +* + + +/*<_psu_note_> + +We do know that the primary sampling unit of Sakernas is census block and the +census block number is in the questionnaire. However this information is not +provided due to it is part of the confidential information withheld by the NSO. + +<_psu_note_>*/ + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ +{ + +*<_urban_> + gen byte urban = b1p5 + recode urban (2=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen byte subnatid1_copy = b1p1 + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 36 "36 - BANTEN" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 53 "53 - NUSA TENGGARA TIMUR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 81 "81 - MALUKU" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + + Because SAKERNAS 1999 does not have the district name variable as other years, yet it has the same districts surveyed in 2013. Therefore, I used districts' names and codes in 2013 to codify subnatid2 in 1999. + + But note that 17 district codes only appear in 1999 (no district labels) not in 2013: 1171 1472 3218 3219 3220 3273 6271 7271 7319 7320 7321 7371 8208 8209 8210 8211 8212. These districts' names were left missing. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = b1p2 + tostring code_kab, format(%02.0f) replace + gen code_prop = b1p1 + tostring code_prop, replace + gen subnatid2_code = code_prop + code_kab + drop b1p2 + rename subnatid2_code b1p2 + merge n:1 b1p2 using "`path_in_stata'\district_list_2013.dta" + drop if _merge==2 + 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 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = "" + replace subnatid1_prev = "32 - JAWA BARAT" if b1p1 == 36 + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen hsize = b1p12 + label var hsize "Household size" +* + + +*<_age_> + gen age = b3k5 + label var age "Individual age" +* + + +*<_male_> + gen male = b3k4 + 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 = b3k3 + recode relationharm (4 5=3) (6=4) (7=5) (8 9=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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = b3k3 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = b3k6 + recode marital (1=2) (2=1) (3=4) (4=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 = . + label var eye_dsablty "Disability related to eyesight" + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var hear_dsablty "Disability related to hearing" + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var walk_dsablty "Disability related to walking or climbing stairs" + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label var comm_dsablty "Disability related to communicating" + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty +* + +} + + +/*%%============================================================================================= + 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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen byte school = b3k7 + recode school (1 3=0) (2=1) + replace school = . if age < ed_mod_age & age!=. + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +"Packet A": an educational level equavalent to the primary school level; +"Packet B": an educational level equavalent to the junior high school level of education; +"Packet C": an educational level equavalent to the senior seconddary level. + +Original code list of variable "b4p1a" in the dataset: +0.Diploma IV/Bachelor/Postgraduate +1.No/never in school +2.No/not yet finish Primary School +3.Primary school +4.Public Junior High School +5.Vocational Junior High School +6.Public Senior High School +7.Vocational senior high school +8.Diploma I/II +9.Diploma III + +*/ + + +*<_educy_> + gen byte educy = . + replace educy=. if age < ed_mod_age & age!=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7 = b4p1a + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age < ed_mod_age & age!=. + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4p1a + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4p1a + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4p2b==1)" or + "worked at least 1 hour during the last week (b4p3==1)" or + "has a job but was temporarily out of work (b4p4==1)"; +unemployed: "who do not have a job/business lstatus != 1" & "seeking a job (b4p13==1)" +non-labor force: "who do not have a job/business lstatus != 1" & "not seeking a job (b4p13==2)" + +labour force participation: 59.44% + +. count if !mi(b4p6a) + 86,863 + +<_lstatus_note_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if b4p2b==1 | b4p3==1 | b4p4==1 + replace lstatus = 2 if lstatus != 1 & (b4p13==1) + replace lstatus = 3 if lstatus != 1 & (b4p13==2) + replace lstatus = . if age < minlaborage + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4p19==1 & (b4p13==2)) or +2)searching but not immediately available to work (b4p13==1) & b4p19==2 + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if [b4p19==1 & (b4p13==2)] | [ b4p13==1 & b4p19==2 ] + replace potential_lf = 0 if [b4p19==1 & b4p13==1] | [ b4p13==2 & b4p19==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +/*<_nlfreason_note_> + +The original variable "b4p18" has 7 non-missing categories: + 1 Felt impossible to find a job + 2 Attending school + 3 Housekeeping + 4 Have work/business + 5 Feel sufficient + 6 Unable to do work + 7 Other, specify + +<_nlfreason_note_>*/ + + +*<_nlfreason_> + gen byte nlfreason = b4p18 + recode nlfreason (2=1) (3=2) (6=4) (1 4 5 7=5) + replace nlfreason = . if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +The original variable "b4p16" is the period of seeking job. Therefore, the lower +and upper bound of unemploymenmt duration are the same. They are in fact the length +of unemployment period. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + gen byte unempldur_l = b4p16 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4p16 + 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 = b4p9 if inrange(b4p9, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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 = b4p6 + tostring industry_orig, replace + replace industry_orig = "" if industry_orig=="." + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = "" + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10 = floor(b4p6/10) + replace industrycat10=10 if inrange(b4p6,92,99) + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + replace industrycat10 = . if lstatus!=1 + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1) (2 3 4 5 =2) (6 7 8 9=3) (10=4) + label var industrycat4 "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 = b4p7 + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = b4p7 + recode occup_isco (55=5) + replace occup_isco = occup_isco*100 + tostring occup_isco, replace format(%04.0f) + replace occup_isco = "" if occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_> +* Make occup var to match in merge, depends on the year we are looking at + gen kji1982_2d = b4p7 + +* Merge with 2 digit mapping + merge m:1 kji1982_2d educat7 using "`path_in_stata'\kji_corresp_2d.dta", keep(match master) nogen + +* Quick check, which codes where not matched + tab kji1982_2d if missing(option_1) + +* Set seed so process is reproducible +* Kapuas river, Indonesia's longest stands at 1143 KM (https://en.wikipedia.org/wiki/Kapuas_River) + set seed 1143 + +* Generate uniform random variable, the logic is, it will lie between 0 and 1 and fall +* within the cumulation category with the probability from the 2011 to 2015 data + gen helper_occup = uniform() + +* Assing fix cases + gen occup = . + replace occup = option_1 if !missing(kji1982_2d) & probs_1 == 1 + +* Assigng binary cases based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup <= probs_1 + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_3)) & helper_occup > probs_1 + +* Assign three way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & missing(probs_4)) & inrange(helper_occup, 0, probs_3) + +* Assign four way based on probability + replace occup = option_1 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_1) + replace occup = option_2 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_2) + replace occup = option_3 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_3) + replace occup = option_4 if (!missing(kji1982_2d) & missing(occup) & !missing(probs_4)) & inrange(helper_occup, 0, probs_4) + replace occup = 10 if occup==0 + replace occup=. if lstatus!=1 + label var occup "1 digit occupational classification, primary job 7 day recall" + la de lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians and associate professionals" 4 "Clerical support workers" 5 "Service and market sales workers" 6 "Skilled agricultural, forestry and fishery workers" 7 "Craft and related trades workers" 8 "Plant and machine operators, and assemblers" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill=occup + recode occup_skill (1/3=3) (4/8=2) (9=1) (0=.) + replace occup_skill = . if lstatus!=1 + label define lbl_occup_skill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lbl_occup_skill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +/*<_wage_no_compen_note_> + +In the raw dataset, question 13 devides into "in cash" and "in-kind". For each observation, I calculated the total income by adding up "in cash" and "in-kind" salary. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = b4p10a1 + b4p10a2 + replace wage_no_compen = . if lstatus!=1 | wage_no_compen==0 | empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + 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 = b4p5b + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_note_> + +We know the average monthly wage, which is "wage_no_compen". But since we do not know how +many months each observation works for, we left the annualized total wage missing. + +<_wage_total_note_>*/ + + +*<_wage_total_> + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract = . + 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 = . 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_note_> + +We count both "old-age insurance" and "pension insurance" as indicators for having social security or not. A given respondent does not have social security if he/she does not have neither. + +<_socialsec_note_>*/ + + +*<_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 = . + 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_note_> + +This question was only asked to those who are seld-employed. + +<_firmsize_l_note_>*/ + + +*<_firmsize_l_> + gen byte firmsize_l = . + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u = . + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +/*<_empstat_2_note_> + +We do not have information on the employment status of the main additional job. But we know whether the respondent has a second job. Therefore, for people who have a second job, they were all coded as "Other, unclassified workers." + +<_empstat_2_note_>*/ + + +*<_empstat_2_> + gen byte empstat_2 = 5 if b4p11==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_2 +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + 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 = b4p12 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = "" + tostring industrycat_isic_2, replace format(%03.0f) + replace industrycat_isic_2= "" if b4p11!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1) (2 3 4 5 =2) (6 7 8 9=3) (10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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 = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +* diff --git a/GLD/IDN/IDN_2000_SAKERNAS/IDN_2000_SAKERNAS_V01_M_V07_A_GLD/Programs/IDN_2000_SAKERNAS_V01_M_V07_A_GLD_ALL.do b/GLD/IDN/IDN_2000_SAKERNAS/IDN_2000_SAKERNAS_V01_M_V07_A_GLD/Programs/IDN_2000_SAKERNAS_V01_M_V07_A_GLD_ALL.do new file mode 100644 index 000000000..f378709ad --- /dev/null +++ b/GLD/IDN/IDN_2000_SAKERNAS/IDN_2000_SAKERNAS_V01_M_V07_A_GLD/Programs/IDN_2000_SAKERNAS_V01_M_V07_A_GLD_ALL.do @@ -0,0 +1,1708 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> IDN_2000_Sakernas_v01_M_v06_A_GLD.do +<_Application_> Stata MP 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2021-08-18 +------------------------------------------------------------------------- +<_Country_> Indonesia (IDN) +<_Survey Title_> Survei Angkatan Kerja Nasional (The National Labor Force Survey) +<_Survey Year_> 2000 +<_Study ID_> IDN_2000_Sakernas_v01_M +<_Data collection from (M/Y)_> [MM/YYYY] +<_Data collection to (M/Y)_> [MM/YYYY] +<_Source of dataset_> Shared with Job's Group by the World Bank Indonesia Team + data request form required to get the access +<_Sample size (HH)_> 31,439 +<_Sample size (IND)_> 98,952 +<_Sampling method_> Two-stage cluster sampling method +<_Geographic coverage_> Province +<_Currency_> Indonesian Rupiah +----------------------------------------------------------------------- +<_ICLS Version_> ICLS 13 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> N/A +<_OCCUP National_> KBJI 2000 +<_ISIC Version_> ISIC Rev.3 +<_INDUS National_> KBLI 2000 +--------------------------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2022-05-24] File: [IDN_2000_Sakernas_v01_M_v02_A_GLD.do] - [Reducing original indutry and occupation codes digits and remapping those two to ISIC/ISCO.] +* Date: [2022-08-24] File: [IDN_2000_Sakernas_v01_M_v03_A_GLD.do] - [Recode employment status:Agricultural & non-agricultual casual worker recoded to "paid employee"; recode "occup_skill" and "occup"; change path to the intermediate file] +* Date: [2023-01-11] File: [IDN_2000_Sakernas_v01_M_v04_A_GLD.do] - [Educat7 correction & directories update; Empstat "self-employed" assisted with non-paid workers were "self-employed"; added "secondary incomplete to "educat7"] +* Date: [2023-03-13] File: [IDN_2000_Sakernas_v01_M_v05_A_GLD.do] - [Recode "industry_orig" & "occup_orig"; change "Z" drive to "Y" drive] +* Date: [2023-04-04] File: [IDN_2000_Sakernas_v01_M_v06_A_GLD.do] - [Recoding: isco_version & occup_isco as missing; occup took the first digit of the original occupation variable; set employed and unemployed observations' non-labor force reason to missing; set "wage_no_compen" to missing for unpaid workers and zero values.] +* Date: [2026-03-12] File: [IDN_2000_Sakernas_V01_M_V06_A_GLD.do] - [Revise "subnatidsurvey"; recode occup as missing] + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 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 "C:\Users\wb611670\WBG\GLD - 611670_SF" +local country "IDN" +local year "2000" +local survey "SAKERNAS" +local vermast "V01" +local veralt "V07" + +* 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'\sakernas00.dta", clear + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode = "IDN" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname = "Sakernas" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey = "Survei Angkatan Kerja Nasional" + 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 = "isic_3" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year = 2000 + label var year "Year of survey" +* + + +*<_vermast_> + gen vermast = "`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen veralt = "`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization = "GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = 2000 + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_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_note_> + +Following codes given by the "A guide to working with Indonesian survey data": + +// create household ID with +// b1p01 = province +// b1p02= district/city +// b1p03= sub-district +// b1p04= village/kelurahan +// b1p05= village/kelurahan classification +(urban/rural) +// b1p07= sample code number +// b1p10= household sample sequential number + +<_hhid_note_>*/ + + +*<_hhid_> + sort b1p01-b1p10 + egen hhid = group(b1p01-b1p10) + label var hhid "Household id" +* + + +/*<_pid_note_> + + duplicates tag, gen(dup) + tab dup + + dup | Freq. Percent Cum. +------------+----------------------------------- + 0 | 98,952 100.00 100.00 +------------+----------------------------------- + Total | 98,952 100.00 + +<_pid_note_>*/ + + +*<_pid_> + gen pid = string(_n,"%06.0f") + tostring pid, replace + label var pid "Individual ID" +* + + +*<_weight_> + gen weight = timbang + label var weight "Survey sampling weight" +* + + +/*<_psu_note_> + +We do know that the primary sampling unit of Sakernas is census block and the +census block number is in the questionnaire. However this information is not +provided due to it is part of the confidential information withheld by the NSO. + +<_psu_note_>*/ + + +*<_psu_> + gen psu = . + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu = . + label var ssu "Secondary sampling units" +* + + +*<_strata_> + gen strata = . + label var strata "Strata" +* + + +*<_wave_> + gen wave = . + label var wave "Survey wave" +* + +} + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ +{ + +*<_urban_> + gen byte urban = b1p05 + recode urban (2=0) + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> + gen byte subnatid1_copy = b1p01 + label de lblsubnatid1 11 "11 - ACEH" 12 "12 - SUMATERA UTARA" 13 "13 - SUMATERA BARAT" 14 "14 - RIAU" 15 "15 - JAMBI" 16 "16 - SUMATERA SELATAN" 17 "17 - BENGKULU" 18 "18 - LAMPUNG" 31 "31 - DKI JAKARTA" 32 "32 - JAWA BARAT" 33 "33 - JAWA TENGAH" 34 "34 - DI YOGYAKARTA" 35 "35 - JAWA TIMUR" 36 "36 - BANTEN" 51 "51 - BALI" 52 "52 - NUSA TENGGARA BARAT" 53 "53 - NUSA TENGGARA TIMUR" 61 "61 - KALIMANTAN BARAT" 62 "62 - KALIMANTAN TENGAH" 63 "63 - KALIMANTAN SELATAN" 64 "64 - KALIMANTAN TIMUR" 71 "71 - SULAWESI UTARA" 72 "72 - SULAWESI TENGAH" 73 "73 - SULAWESI SELATAN" 74 "74 - SULAWESI TENGGARA" 82 "82 - MALUKU UTARA" + label values subnatid1_copy lblsubnatid1 + decode subnatid1_copy, gen(subnatid1) + drop subnatid1_copy + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +/*<_subnatid2_note_> + + Because SAKERNAS 2000 does not have the district name variable as other years, yet it has the same districts surveyed in 2013. Therefore, I used districts' names and codes in 2013 to codify subnatid2 in 2000. + + But note that 17 district codes only appear in 2000 (no district labels) not in 2013: 1171 1472 3218 3219 3220 3273 6271 7271 7319 7320 7321 7371 8208 8209 8210 8211 8212. These districts' names were left missing. + +*<_subnatid2_note_>*/ + + +*<_subnatid2_> + gen code_kab = b1p02 + tostring code_kab, format(%02.0f) replace + gen code_prop = b1p01 + tostring code_prop, replace + gen subnatid2_code = code_prop + code_kab + drop b1p02 + rename subnatid2_code b1p02 + merge n:1 b1p02 using "`path_in_stata'\district_list_2013.dta" + drop if _merge==2 + 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 + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code = . + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code = . + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code = . + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + gen hsize = b1p12 + label var hsize "Household size" +* + + +*<_age_> + gen age = umur + label var age "Individual age" +* + + +*<_male_> + gen male = jk + 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 = hub + recode relationharm (4 5=3) (6=4) (7=5) (8 9=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 "Non-relatives" + label values relationharm lblrelationharm +* + + +*<_relationcs_> + gen relationcs = hub + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen byte marital = stat + recode marital (1=2) (2=1) (3=4) (4=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 = . + label var eye_dsablty "Disability related to eyesight" + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty +* + + +*<_hear_dsablty_> + gen hear_dsablty = . + label var hear_dsablty "Disability related to hearing" + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty +* + + +*<_walk_dsablty_> + gen walk_dsablty = . + label var walk_dsablty "Disability related to walking or climbing stairs" + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty +* + + +*<_conc_dsord_> + gen conc_dsord = . + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + label var slfcre_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty = . + label var comm_dsablty "Disability related to communicating" + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty +* + +} + + +/*%%============================================================================================= + 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" +* + + +*<_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 = 10 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen byte school = sek + recode school (1 3=0) (2=1) + replace school = . if age < ed_mod_age & age!=. + label var school "Attending school" + la de lblschool 0 "No" 1 "Yes" + label values school lblschool +* + + +*<_literacy_> + gen byte literacy = . + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +/*<_educy_note_> + +Years of education, or "educy" (and all other related variables were left missing) +because of the unclear mapping for "Not finished primary school yet". + +According to isced-2011 mappings, there are day care centre, playgroup, and +kindergarten as pre-primary education before 7 years old. Whether to map +primary unfinished to those options depends on specific assumptions and research +needs. Therefore, variable "educy" was left missing. + +"Packet A": an educational level equavalent to the primary school level; +"Packet B": an educational level equavalent to the junior high school level of education; +"Packet C": an educational level equavalent to the senior seconddary level. + +Original code list of variable "b4p1a" in the questionnaire: +0.University (DIV, S-1, or above) +1.Never/not yet in school +2.No/not yet finish Primary School +3.Primary school +4.General Junior High School +5.Vocational Junior High School +6.General Senior High School +7.Vocational secondary school +8.Diploma I/II +9.Academy D.III + +*/ + + +*<_educy_> + gen byte educy = . + replace educy=. if age < ed_mod_age & age!=. + label var educy "Years of education" +* + + +*<_educat7_> + gen byte educat7 = b4p1a + recode educat7 (4/5=4) (6/7=5) (8/9=6) (0=7) + replace educat7 = . if age < ed_mod_age & age!=. + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5 = educat7 + recode educat5 (4=3) (5=4) (6/7=5) + replace educat5 = . if age < ed_mod_age & age!=. + 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 age < ed_mod_age & age!=. + 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 = b4p1a + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced = b4p1a + recode educat_isced (0=660) (1=020) (2/3=100) (4/5=244) (6/7=344) (8=454) (9=550) + 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 = . + label var vocational "Ever received vocational training" +* + +*<_vocational_type_> + gen vocational_type = . + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + +*<_vocational_length_l_> + gen vocational_length_l = . + label var vocational_length_l "Length of training, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + label var vocational_length_u "Length of training, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label var vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + + +*<_minlaborage_> + gen byte minlaborage = 10 + label var minlaborage "Labor module application age" +* + + +*----------8.1: 7 day reference overall------------------------------* + +{ + +/*<_lstatus_note_> + +We define the employed as who "worked primarily (b4p2b==1)" or + "worked at least 1 hour during the last week (b4p3==1)" or + "has a job but was temporarily out of work (b4p4==1)"; (this was defined by the questionnaire) +unemployed: "who do not have a job/business lstatus != 1" & "seeking a job (b4p5==1)" +non-labor force: "who do not have a job/business lstatus != 1" & "not seeking a job (b4p5==2)" + +labour force participation: 60.25% + +. tab b4p6a, m + + Total | + working | + day(s) of | + all jobs | Freq. Percent Cum. +------------+----------------------------------- + 0 | 1,049 1.06 1.06 + 1 | 141 0.14 1.20 + 2 | 598 0.60 1.81 + 3 | 1,352 1.37 3.17 + 4 | 2,964 3.00 6.17 + 5 | 6,752 6.82 12.99 + 6 | 19,378 19.58 32.58 + 7 | 23,872 24.12 56.70 + . | 42,846 43.30 100.00 +------------+----------------------------------- + Total | 98,952 100.00 + +. count if !mi(b4p6a) + 56,106 + +<_lstatus_note_>*/ + + +*<_lstatus_> + gen byte lstatus = . + replace lstatus = 1 if b4p2b==1 | b4p3==1 | b4p4==1 + replace lstatus = 2 if lstatus != 1 & (b4p5==1) + replace lstatus = 3 if lstatus != 1 & (b4p5==2) + replace lstatus = . if age < minlaborage + label var lstatus "Labor status" + la de lbllstatus 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lbllstatus +* + + +/*<_potential_lf_note_> +Note: var "potential_lf" is missing if the respondent is in labor force or unemployed; it 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 (b4p22==1 & b4p5==2) or +2)searching but not immediately available to work ( b4p5==1 & b4p22==2) + +*/ + + +*<_potential_lf_> + gen byte potential_lf = . + replace potential_lf = 1 if [b4p22==1 & b4p5==2] | [ b4p5==1 & b4p22==2] + replace potential_lf = 0 if [b4p22==1 & b4p5==1] | [ b4p5==2 & b4p22==2] + replace potential_lf = . if age < minlaborage & age != . + replace potential_lf = . if lstatus != 3 + label var potential_lf "Potential labour force status" + la de lblpotential_lf 0 "No" 1 "Yes" + label values potential_lf lblpotential_lf +* + + +*<_underemployment_> + gen byte underemployment = . + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +/*<_nlfreason_note_> + +The original variable "b4p19" has 7 non-missing categories: + 1 Felt impossible to find a job + 2 Attending school + 3 Housekeeping + 4 Have work/business + 5 Feel sufficient + 6 Unable to do work + 7 Other, specify + +<_nlfreason_note_>*/ + + +*<_nlfreason_> + gen byte nlfreason = b4p19 + recode nlfreason (2=1) (3=2) (6=4) (1 4 5 7=5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +/*<_unempldur_l_note_> + +The original variable "b4p17" is the period of seeking job. Therefore, the lower +and upper bound of unemploymenmt duration are the same. They are in fact the length +of unemployment period. + +<_unempldur_l_note_>*/ + + +*<_unempldur_l_> + gen byte unempldur_l = b4p17 + replace unempldur_l = . if lstatus != 2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u = b4p17 + 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 = b4p10 if inrange(b4p10, 1, 5) + recode empstat (1 2=4) (4=1) (5=2) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec = . + 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 = b4p7 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = b4p7 + recode industrycat_isic (101 102=100) (174=170) (262/266=260) (30 531/549 000 268 625=.) (631/639=630) (703=700) + replace industrycat_isic = industrycat_isic*10 + tostring industrycat_isic, replace format(%04.0f) + replace industrycat_isic = "" if industrycat_isic=="." + replace industrycat_isic = "" if lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen industrycat10_str = substr(industrycat_isic, 1, 2) + destring industrycat10_str, replace + gen byte industrycat10 = industrycat10_str + recode industrycat10 (1/5=1) (10/14=2) (15/37=3) (40/41=4) (45=5) (50/55=6) (60/64=7) (65/74=8) (75=9) (75/99=10) + replace industrycat10 = 6 if inrange(b4p7, 531, 549) + 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" + replace industrycat10 = . if lstatus!=1 + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4 = industrycat10 + recode industrycat4 (1=1) (2 3 4 5 =2) (6 7 8 9=3) (10=4) + label var industrycat4 "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 = b4p8 + replace occup_orig=. if lstatus!=1 + label var occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + gen occup_isco = "" + replace occup_isco = "" if occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + +/*<_occup_note_> + +The distribution of occup in 2000 appears to be an outlier compared with the years before and after. This may be due to the occupation coding in 2000 being KBJI 2000 at the 3-digit level, whereas the surrounding years use the 1982 classification at the 1-digit level. To avoid potential inconsistencies or confusion across years, we set the occupation variable for 2000 to missing. + +<_occup_note_>*/ + +*<_occup_> + gen occup=. + label var occup "1 digit occupational classification, primary job 7 day recall" + la de lbloccup 1 "Managers" 2 "Professionals" 3 "Technicians and associate professionals" 4 "Clerical support workers" 5 "Service and market sales workers" 6 "Skilled agricultural, forestry and fishery workers" 7 "Craft and related trades workers" 8 "Plant and machine operators, and assemblers" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup lbloccup +* + + +*<_occup_skill_> + gen occup_skill=occup + recode occup_skill (1/3=3) (4/8=2) (9=1) (0=.) + replace occup_skill = . if lstatus!=1 + label define lbl_occup_skill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lbl_occup_skill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +/*<_wage_no_compen_note_> + +In the raw dataset, question 13 devides into "in cash" and "in-kind". For each observation, I calculated the total income by adding up "in cash" and "in-kind" salary. + +<_wage_no_compen_note_>*/ + + +*<_wage_no_compen_> + gen double wage_no_compen = b4p11a1 + b4p11a2 + replace wage_no_compen = . if lstatus!=1 | empstat==2 | wage_no_compen==0 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage = 5 + 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 = b4p6b + replace whours = . if lstatus!=1 + replace whours = . if whours == 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_note_> + +We know the average monthly wage, which is "wage_no_compen". But since we do not know how +many months each observation works for, we left the annualized total wage missing. + +<_wage_total_note_>*/ + + +*<_wage_total_> + gen wage_total = . + label var wage_total "Annualized total wage primary job 7 day recall" +* + + +*<_contract_> + gen byte contract = . + 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 = . 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_note_> + +We count both "old-age insurance" and "pension insurance" as indicators for having social security or not. A given respondent does not have social security if he/she does not have neither. + +<_socialsec_note_>*/ + + +*<_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 = . + 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_note_> + +This question was only asked to those who are seld-employed. + +<_firmsize_l_note_>*/ + + +*<_firmsize_l_> + gen byte firmsize_l = . + label var firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + + +*<_firmsize_u_> + gen byte firmsize_u = . + label var firmsize_u "Firm size (upper bracket) primary job 7 day recall" +* + +} + + +*----------8.3: 7 day reference secondary job------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +{ +/*<_empstat_2_note_> + +We do not have information on the employment status of the main additional job. But we know whether the respondent has a second job. Therefore, for people who have a second job, they were all coded as "Other, unclassified workers." + +<_empstat_2_note_>*/ + + +*<_empstat_2_> + gen byte empstat_2 = 5 if b4p13==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_2 +* + + +*<_ocusec_2_> + gen byte ocusec_2 = . + 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 = b4p14 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2 = "" + tostring industrycat_isic_2, replace format(%03.0f) + replace industrycat_isic_2= "" if b4p13!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen byte industrycat10_2 = . + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2 = industrycat10_2 + recode industrycat4_2 (1=1) (2 3 4 5 =2) (6 7 8 9=3) (10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2 = . + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = "" + label var occup_isco_2 "ISCO code of secondary job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + label var occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" +* + + +*<_occup_2_> + gen byte occup_2 = . + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + gen double wage_no_compen_2 = . + label var wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2 = . + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2 = . + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2 = . + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2 = . + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen 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 = . + label var lstatus_year "Labor status during last year" + la de lbllstatus_year 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus_year lbllstatus_year +* + +*<_potential_lf_year_> + gen byte potential_lf_year = . + replace potential_lf_year = . if age < minlaborage & age != . + replace potential_lf_year = . if lstatus_year != 3 + label var potential_lf_year "Potential labour force status" + la de lblpotential_lf_year 0 "No" 1 "Yes" + label values potential_lf_year lblpotential_lf_year +* + + +*<_underemployment_year_> + gen byte underemployment_year = . + replace underemployment_year = . if age < minlaborage & age != . + replace underemployment_year = . if lstatus_year == 1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year = . + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "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 = . + 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 occup_isco_year = . + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + 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 & empstat_2 ==. + replace njobs = 2 if lstatus ==1 & empstat_2 !=. + replace njobs = 0 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 psu strata wave 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 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 psu strata wave 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 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." + } + + +* + +} + + +*<_% COMPRESS_> + +compress + +* + + +*<_% 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' +} + +* + + +*<_% SAVE_> + +save "`path_output'\\`level_2_harm'_ALL.dta", replace + +*