diff --git a/GLD/CMR/CMR_2021_EESI/CMR_2021_EESI_V01_M_V02_A_GLD/Programs/CMR_2021_EESI_V01_M_V02_A_GLD_ALL.do b/GLD/CMR/CMR_2021_EESI/CMR_2021_EESI_V01_M_V02_A_GLD/Programs/CMR_2021_EESI_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..29510a4f7 --- /dev/null +++ b/GLD/CMR/CMR_2021_EESI/CMR_2021_EESI_V01_M_V02_A_GLD/Programs/CMR_2021_EESI_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,1905 @@ + +/*%%============================================================================================= + 0: GLD Harmonization Preamble +================================================================================================*/ + +/* ----------------------------------------------------------------------- +<_Program name_> CMR_2021_EESI_V01_M_V02_A_GLD_ALL.do +<_Application_> Stata SE 16.1 <_Application_> +<_Author(s)_> Wolrd Bank Job's Group +<_Date created_> 2024-1-31 +------------------------------------------------------------------------- +<_Country_> Cameroon (CMR) +<_Survey Title_> Second survey on employment and the informal sector in Cameroon (EESI2) +<_Survey Year_> 2021 +<_Study ID_> CMR_2021_EESI_v01_M +<_Data collection from (M/Y)_> [02/2021] +<_Data collection to (M/Y)_> [10/2021] +<_Source of dataset_> +<_Sample size (HH)_> 4,861 +<_Sample size (IND)_> +<_Sampling method_> Two-phase statistical operation combined with a + two-stage stratified random design. +<_Geographic coverage_> EESI covers the whole national territory which comprises + 12 survey regions: cities of Douala and Yaoundé and + the ten regions of the country. +<_Currency_> Central African CFA franc +----------------------------------------------------------------------- +<_ICLS Version_> ICLS-15 +<_ISCED Version_> ISCED-2011 +<_ISCO Version_> +<_OCCUP National_> +<_ISIC Version_> +<_INDUS National_> +----------------------------------------------------------------------- + +<_Version Control_> + +* Date: [2024-10-08] V02 A --> update weight. Use coefexti instead of coefextph1, same value, but former has no missing +* gen test = coefexti == coefextph1 if !mi(coefextph1) +* Date: [YYYY-MM-DD] File: [As in Program name above] - [Description of changes] + + + + +-------------------------------------------------------------------------*/ + + +/*%%============================================================================================= + 1: Setting up of program environment, dataset +================================================================================================*/ + +*----------1.1: Initial commands------------------------------* + +clear +set more off +set mem 800m + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "CMR" +local year "2021" +local survey "EESI" +local vermast "V01" +local veralt "V02" + +* 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 + +* First full file, with 10 vars. Note that the ones that are not used for merging are the same in both (for those that match) +use "`path_in_stata'/eesi3ind_hh.dta", clear + +* Then merge with individual file of those interviewed +merge 1:1 hhid m1 using "`path_in_stata'/eesi3ind.dta", assert(master match) nogen + + +/*%%============================================================================================= + 2: Survey & ID +================================================================================================*/ + +{ + +*<_countrycode_> + gen str4 countrycode="`country'" + label var countrycode "Country code" +* + + +*<_survname_> + gen survname="EESI" + label var survname "Survey acronym" +* + + +*<_survey_> + gen survey="LFS" + label var survey "Survey type" +* + + +*<_icls_v_> + gen icls_v="ICLS-15" + label var icls_v "ICLS version underlying questionnaire questions" +* + + +*<_isced_version_> + gen isced_version="isced_2011" + label var isced_version "Version of ISCED used for educat_isced" +* + + +*<_isco_version_> + gen isco_version="" + label var isco_version "Version of ISCO used" +* + + +*<_isic_version_> + gen isic_version="" + label var isic_version "Version of ISIC used" +* + + +*<_year_> + gen int year=`year' + label var year "Year of survey" +* + + +*<_vermast_> + gen str3 vermast="`vermast'" + label var vermast "Version of master data" +* + + +*<_veralt_> + gen str3 veralt="`veralt'" + label var veralt "Version of the alt/harmonized data" +* + + +*<_harmonization_> + gen harmonization="GLD" + label var harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year=`year' + label var int_year "Year of the interview" +* + + +*<_int_month_> + gen int_month=s0g19m + 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_> + * Variable hhid already in the data + * gen hhid == + label var hhid "Household id" +* + + +*<_pid_> + +/*<_pid_note_> + +The pid created this way is not able to uniquely identify all the observations +as variables from G2-G7 are not included in the raw dataset. It seems to be the +case that many hhids using the same ID are actually different households. + +*<_pid_note_>*/ + + tostring m1 s0g19m, gen(id_str month) format(%02.0f) + egen pid=concat(hhid id_str), punct("-") + label var pid "Individual ID" + isid pid +* + + +*<_weight_> + gen weight = coefexti + label var weight "Household sampling weight" +* + + +*<_psu_> + gen psu=zd + label var psu "Primary sampling units" +* + + +*<_ssu_> + gen ssu=hhid + label var ssu "Secondary sampling units" +* + + +*<_strata_> + * Is made up of union of region and urban rural + * urban rural is not present for those under 10 (and some other small missing cases) + * We can use the fact that each ZD is in either urban or rural area + bys zd: egen urb_median = median(s0g8) + replace s0g8 = urb_median if mi(s0g8) + decode s0g1, gen(region) + decode s0g8, gen(urb) + +quietly + +{ + replace region="Duala" if s0g1==1 + replace region="Yaounde" if s0g1==2 + replace region="Adamawa" if s0g1==3 + replace region="Centre ex Yaounde" if s0g1==4 + replace region="East" if s0g1==5 + replace region="Far North" if s0g1==6 + replace region="Littoral ex Douala" if s0g1==7 + replace region="North" if s0g1==8 + replace region="Northwest" if s0g1==9 + replace region="West" if s0g1==10 + replace region="South" if s0g1==11 + replace region="Southwest" if s0g1==12 + + replace urb="Urban" if s0g8==1 + replace urb="Rural" if s0g8==2 + } + gen strata=region+"-"+urb + label var strata "Strata" +* + + +*<_wave_> + gen wave=. + replace wave=1 if inrange(int_month,1,3) + replace wave=2 if inrange(int_month,4,6) + replace wave=3 if inrange(int_month,7,9) + replace wave=4 if inrange(int_month,10,12) + label var wave "Survey wave" +* + + +*<_panel_> + gen panel="" + label var panel "Panel individual belongs to" +* + + +*<_visit_no_> + gen visit_no=. + label var visit_no "Visit number in panel" +* +} + + +/*%%============================================================================================= + 3: Geography +================================================================================================*/ + +{ + +*<_urban_> + gen urban=s0g8 + recode urban (2=0) + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban + label var urban "Location is urban" +* + + +*<_subnatid1_> + tostring s0g1, gen(regioncode) + gen subnatid1 = region + replace subnatid1 = regioncode + " - " + region + replace subnatid1 = "1 - Douala" if subnatid1 == "1 - Duala" + label var subnatid1 "Subnational ID at First Administrative Level" +* + + +*<_subnatid2_> + gen subnatid2=. + label var subnatid2 "Subnational ID at Second Administrative Level" +* + + +*<_subnatid3_> + gen subnatid3=. + label var subnatid3 "Subnational ID at Third Administrative Level" +* + + +*<_subnatidsurvey_> + gen subnatidsurvey = subnatid1 + " " + urb + label var subnatidsurvey "Administrative level at which survey is representative" +* + + +*<_subnatid1_prev_> + +/* <_subnatid1_prev_note_> +subnatid1_prev is coded as missing unless the classification used for subnatid1 has changed since the previous survey. + */ + + gen subnatid1_prev=. + label var subnatid1_prev "Classification used for subnatid1 from previous survey" +* + + +*<_subnatid2_prev_> + gen subnatid2_prev=. + label var subnatid2_prev "Classification used for subnatid2 from previous survey" +* + + +*<_subnatid3_prev_> + gen subnatid3_prev=. + label var subnatid3_prev "Classification used for subnatid3 from previous survey" +* + + +*<_gaul_adm1_code_> + gen gaul_adm1_code=. + label var gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + + +*<_gaul_adm2_code_> + gen gaul_adm2_code=. + label var gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" +* + + +*<_gaul_adm3_code_> + gen gaul_adm3_code=. + label var gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + +/*%%============================================================================================= + 4: Demography +================================================================================================*/ + +{ + +*<_hsize_> + +/*<_hsize_note_> + +Three variables g10, g11, g12 in the raw datasets are all household size-relavent. + +g10: number of persons in the household (including visitors and absent residents) +g11: number of persons aged 10 years and above in the household (including visitors and absent residents) +g12: number of persons who responded to the survey + +Variable g10 includes people who are not targeted by the survey (need to be aged +10 and above); g11 includes people targeted by the survey but it also has people +who did not respond to the survey. + +None of these captures the concept we want (people of all ages residing in the HH), thus blank + +*<_hsize_note_>*/ + + gen hsize = . + label var hsize "Household size" +* + + +*<_age_> + rename age age_cat + gen age=m5 + replace age=98 if age>98 & age!=. + label var age "Individual age" +* + + +*<_male_> + gen male=m4 + recode male 2=0 + label var male "Sex - Ind is male" + la de lblmale 1 "Male" 0 "Female" + label values male lblmale +* + + +*<_relationharm_> + +/*<_relationharm_note_> + +Again, since the household id and personal id are not unique, 686 households have +zero or multipal households. + +*<_relationharm_note_>*/ + + gen byte relationharm=m2 + recode relationharm (4=5) (7 8=6) + label var relationharm "Relationship to the head of household - Harmonized" + la de lblrelationharm 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm lblrelationharm +*<_relationharm_> + + +*<_relationcs_> + gen relationcs=m2 + label var relationcs "Relationship to the head of household - Country original" +* + + +*<_marital_> + gen marital=m6 + recode marital (1=2) (2 3=1) (4=5) (5=4) (6=3) + label var marital "Marital status" + la de lblmarital 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital lblmarital +* + + +*<_eye_dsablty_> + +/*<_eye_dsablty_note_> + +Note that for all disability variables below, questions M9 and M9-A in the raw dataset +indicate whether the respondent has a certain kind of disability. But the questions +do not indicate the level of disability the respondent has. Therefore, we didn't +code the disability variables. + +*<_eye_dsablty_note_>*/ + gen eye_dsablty=. + la de lbleye_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values eye_dsablty lbleye_dsablty + label var eye_dsablty "Disability related to eyesight" +* + + +*<_hear_dsablty_> + gen hear_dsablty=. + la de lblhear_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values hear_dsablty lblhear_dsablty + label var hear_dsablty "Disability related to hearing" +* + + +*<_walk_dsablty_> + gen walk_dsablty=. + la de lblwalk_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values walk_dsablty lblwalk_dsablty + label var walk_dsablty "Disability related to walking or climbing stairs" +* + + +*<_conc_dsord_> + gen conc_dsord=. + la de lblconc_dsord 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values conc_dsord lblconc_dsord + label var conc_dsord "Disability related to concentration or remembering" +* + + +*<_slfcre_dsablty_> + gen slfcre_dsablty=. + la de lblslfcre_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values slfcre_dsablty lblslfcre_dsablty + label var eye_dsablty "Disability related to selfcare" +* + + +*<_comm_dsablty_> + gen comm_dsablty=. + la de lblcomm_dsablty 1 "No" 2 "Yes-some" 3 "Yes-a lot" 4 "Cannot at all" + label values comm_dsablty lblcomm_dsablty + label var eye_dsablty "Disability related to communicating" +* + +} + + +/*%%============================================================================================= + 5: Migration +================================================================================================*/ + +{ +*<_migrated_mod_age_> + gen migrated_mod_age=10 + label var migrated_mod_age "Migration module application age" +* + + +*<_migrated_ref_time_> + gen migrated_ref_time=99 + label var migrated_ref_time "Reference time applied to migration questions (in years)" +* + + +*<_migrated_binary_> + gen migrated_binary=m11 + recode migrated_binary (2=1) (1=0) + 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=. + * Add years + replace migrated_years=m11an if !mi(m11an) + * Add months (304 with m11an = 0, 333 with m11an = 1) + replace migrated_years=round(m11am/12,0.1) if !mi(m11am) & m11an==0 + replace migrated_years=round(m11am/12,0.1) + 1 if !mi(m11am) & m11an==1 + * Replace if months is 98 (unknown), if not migrated + replace migrated_years = . if m11an == 98 + replace migrated_years=. if migrated_binary!=1 + 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=. + replace migrated_from_cat=. if migrated_binary!=1 + label de lblmigrated_from_cat 1 "From same admin3 area" 2 "From same admin2 area" 3 "From same admin1 area" 4 "From other admin1 area" 5 "From other country" + label values migrated_from_cat lblmigrated_from_cat + label var migrated_from_cat "Category of migration area" +* + + +*<_migrated_from_code_> + gen migrated_from_code="" + replace migrated_from_code="" if migrated_binary!=1 + label var migrated_from_code "Code of migration area as subnatid level of migrated_from_cat" +* + + +*<_migrated_from_country_> + +/*<_migrated_from_country_note> + +Although variable m12a provides information on the country the respondent migrated from, +most of its categories are comprised of mixed categories such as "rest of the world", +"other CEMAC countries" etc. + +*<_migrated_from_country_note>*/ + + gen migrated_from_country="" + replace migrated_from_country="NGA" if m12a==2 + replace migrated_from_country="CHN" if m12a==7 + replace migrated_from_country="" if migrated_binary!=1 + label var migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + + +*<_migrated_reason_> + gen migrated_reason=m13 + recode migrated_reason (1 2=3) (4=2) (7 8=1) (3 6 9 10=5) + replace migrated_reason=. if migrated_binary!=1 + label de lblmigrated_reason 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, …)" 5 "Other reasons" + label values migrated_reason lblmigrated_reason + label var migrated_reason "Reason for migrating" +* +} + + +/*%%============================================================================================= + 6: Education +================================================================================================*/ + + +{ +*<_ed_mod_age_> + gen byte ed_mod_age=10 + label var ed_mod_age "Education module application age" +* + + +*<_school_> + gen school=m20 + recode school (2=0) (9=.) + replace school=. if age + + +*<_literacy_> + gen byte literacy=. + replace m22a=0 if m22a==2 + replace m22b=0 if m22b==2 + replace m22c=0 if m22c==2 + replace m22d=0 if m22d==2 + egen total_lit=rowtotal(m22a-m22d) + replace literacy=0 if total_lit==0 + replace literacy=1 if inrange(total_lit,1,4) + label var literacy "Individual can read & write" + la de lblliteracy 0 "No" 1 "Yes" + label values literacy lblliteracy +* + + +*<_educy_> + +/*<_educy_note_> + +Use variable "nae" from the raw data. Note that this is a derived varible. +Has negative values. Anything <1 set to missing + +*<_educy_note_>*/ + + gen byte educy = nae + replace educy = . if nae <1 + replace educy=. if age + + +*<_educat7_> + gen byte educat7=. + replace educat7 = 1 if m14 == 2 | m15n == 0 + replace educat7 = 2 if m15n == 1 & m15c < 15 + replace educat7 = 3 if m15n == 1 & m15c > 14 & m15c < 17 + replace educat7 = 4 if m15n == 2 + replace educat7 = 5 if m15n == 3 + replace educat7 = 7 if m15n == 4 + label var educat7 "Level of education 1" + la de lbleducat7 1 "No education" 2 "Primary incomplete" 3 "Primary complete" 4 "Secondary incomplete" 5 "Secondary complete" 6 "Higher than secondary but not university" 7 "University incomplete or complete" + label values educat7 lbleducat7 +* + + +*<_educat5_> + gen byte educat5=educat7 + recode educat5 (4=3) (5=4) (6 7=5) + label var educat5 "Level of education 2" + la de lbleducat5 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "Secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 lbleducat5 +* + + +*<_educat4_> + gen byte educat4 = educat7 + recode educat4 (2 3 4 = 2) (5=3) (6 7=4) + label var educat4 "Level of education 3" + la de lbleducat4 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 lbleducat4 +* + + +*<_educat_orig_> + gen educat_orig=m15c + label var educat_orig "Original survey education code" +* + + +*<_educat_isced_> + gen educat_isced=. + replace educat_isced=100 if m16==2 + replace educat_isced=244 if m16==3 + replace educat_isced=352 if m16==4 + replace educat_isced=354 if m16==5 + replace educat_isced=660 if m16==6 + replace educat_isced=344 if m16==7 + replace educat_isced=760 if m16==8 + replace educat_isced=860 if m16==9 + replace educat_isced=. if age + + +*----------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 +foreach v of local ed_var { + replace `v'=. if ( age < ed_mod_age & !missing(age) ) +} +* + +} + +/*%%============================================================================================= + 7: Training +================================================================================================*/ + +{ + +*<_vocational_> + gen vocational=m23 + recode vocational (2 3=0) (8=.) + la de vocationallbl 1 "Yes" 0 "No" + la values vocational vocationallbl + label var vocational "Ever received vocational training" +* + + +*<_vocational_type_> + gen vocational_type=. + label de lblvocational_type 1 "Inside Enterprise" 2 "External" + label values vocational_type lblvocational_type + label var vocational_type "Type of vocational training" +* + + +*<_vocational_length_l_> + gen vocational_length_l=. + replace vocational_length_l=. if vocational!=1 + label var vocational_length_l "Length of training in months, lower limit" +* + + +*<_vocational_length_u_> + gen vocational_length_u=. + replace vocational_length_u=. if vocational!=1 + label var vocational_length_u "Length of training in months, upper limit" +* + + +*<_vocational_field_orig_> + +/*<_vocational_field_orig_note_> + +The offical documentation of numenclature has a complete list of training labels +for the original variable m24. We did not code the labels here. + +*<_vocational_field_orig_note_>*/ + + * Convert to string with number + label + decode m24, gen(helper_1) + * Since number is in label and in number of the format DDDD. DDDD :: Description + * we try to get rid of the first set of digits, make file lighter + * To do so, find the dot position. From there + 1, snip the text + gen helper_2 = strpos(helper_1, ".") + 1 + replace helper_1 = substr(helper_1, helper_2,.) if !missing(helper_1) + gen vocational_field_orig=helper_1 + replace vocational_field_orig="" if vocational!=1 + label var vocational_field_orig "Original field of training information" +* + + +*<_vocational_financed_> + gen vocational_financed=. + label de lblvocational_financed 1 "Employer" 2 "Government" 3 "Mixed Employer/Government" 4 "Own funds" 5 "Other" + label var vocational_financed "How training was financed" +* + +} + +/*%%============================================================================================= + 8: Labour +================================================================================================*/ + +*<_minlaborage_> + gen byte minlaborage=10 + label var minlaborage "Labor module application age" +* + + + +*----------8.1: 7 day reference overall------------------------------* + +{ +*<_lstatus_> + gen byte lstatus=. + replace lstatus=1 if se2==1 | inrange(se3,1,9) | inrange(se5,1,7) | inrange(se6,1,2) + replace lstatus=2 if lstatus==.&(sch1a==1|sch1b==1)&inlist(sch1c,1,2) + replace lstatus=3 if lstatus==. + replace lstatus=. if age + + +*<_potential_lf_> + +/*<_potential_lf_note_> +Note: var "potential_lf" only takes value if the respondent is not in labor force. (lstatus==3) + +"potential_lf"=1 if the person is +1)available but not searching or inrange(se7c,1,2)&se7b==2 +2)searching but not immediately available to work or (se7a==1|se7b==1)&inrange(se7c,3,4) + +*/ + + gen potential_lf = 0 + replace potential_lf = 1 if (sch1a == 2 & inlist(sch1c,1,2) ) | (sch1b == 2 & inlist(sch1c,1,2) ) | ( (sch1a==1|sch1b==1) & inlist(sch1c,3,4) ) + 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_> + * Asks whether person is ready to work for more hours than they do + gen byte underemployment=r3 + recode underemployment (2=0) (9=.) + replace underemployment=. if lstatus!=1 + label var underemployment "Underemployment status" + la de lblunderemployment 0 "No" 1 "Yes" + label values underemployment lblunderemployment +* + + +*<_nlfreason_> + gen byte nlfreason=sch2a + recode nlfreason (1=4) (2=1) (3=3) (4=2) (5/8=5) + replace nlfreason=. if lstatus!=3 + label var nlfreason "Reason not in the labor force" + la de lblnlfreason 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason lblnlfreason +* + + +*<_unempldur_l_> + +/*<_unempldur_l_note_> + +GLD variables unempldur_l and unempldur_u are the same. +The original variable referred to for unemployment duration is c1. +c1a indicates the last two-digit of the year a given respondent was unemployed; +c1b is the month in 2021 a given respondent was unemployed. + +*<_unempldur_l_note_>*/ + + gen unemp_year= 2021 - c1y + gen unemp_month=unemp_year*12 + c1m + + gen byte unempldur_l=unemp_month + replace unempldur_l=. if lstatus!=2 + label var unempldur_l "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_> + gen byte unempldur_u=unemp_month + 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=ap3 + recode empstat (1/5=1) (6=3) (7=4) (8/9=2) (10/11=5) + replace empstat=. if lstatus!=1 + label var empstat "Employment status during past week primary job 7 day recall" + la de lblempstat 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat lblempstat +* + + +*<_ocusec_> + gen byte ocusec=ap4 + recode ocusec (1 5 =1) (2=3) (3 4 6 7 8=2) + replace ocusec=. if lstatus!=1 + label var ocusec "Sector of activity primary job 7 day recall" + la de lblocusec 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec lblocusec +* + + +*<_industry_orig_> + gen industry_orig=ap2 + replace industry_orig=. if lstatus!=1 + label var industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic="" + replace industrycat_isic="" if industrycat_isic=="."|lstatus!=1 + label var industrycat_isic "ISIC code of primary job 7 day recall" +* + + +*<_industrycat10_> + gen ap2_1dig=floor(ap2/1000) + gen industrycat10=ap2_1dig + recode industrycat10 (1/4 = 1) (5/6=2) (7/28=3) (29/30=4) (31=5) (32 33=6) (34 35=7) (36/38=8) (39=9) (40/44=10) + replace industrycat10=. if lstatus!=1 + label var industrycat10 "1 digit industry classification, primary job 7 day recall" + la de lblindustrycat10 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 lblindustrycat10 +* + + +*<_industrycat4_> + gen byte industrycat4=industrycat10 + recode industrycat4 (3/5=2)(6/9=3)(10=4) + label var industrycat4 "1 digit industry classification (Broad Economic Activities), primary job 7 day recall" + la de lblindustrycat4 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 lblindustrycat4 +* + + +*<_occup_orig_> + +/*<_occup_orig_note_> + +The 8 major groups in the questionnaire are defined as: + +1. Agriculture, livestock, forestry; Hunting and fishing --- skill level 2 +2. Members of the executive and legislative bodies, administrative authorities, +company managers and staff, clergy --- skill level 1 +3.Liberal intellectual and scientific professions --- skill level 1 +4.Senior Executive --- skill level 1 +5. Middle Manager & Technician --- skill level 2 +6. Employed and self-employed --- skill level 2 +7. Artisan and Laborer --- skill level 2 +8. Armed Forces and Police + +*<_occup_orig_note_>*/ + + gen occup_orig=ap1 + 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 lstatus!=1 | occup_isco=="." + label var occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill=. + la de lblskill 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill lblskill + label var occup_skill "Skill based on ISCO standard primary job 7 day recall" +* + + +*<_occup_> + gen occup=. + 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_> + +/*<_wage_no_compen_note_> + +The wage questions in the questionnare are organized into two parts: the first part +asks for the specific number of income if the given respondent could recall and was +willing to answer; the second part provides different categories of income range +if the given respondent could not recall or was not willing to answer the first part. + +We have accurate data for 5,947 people at monthly level and 1,608 annually. The category +data is present for 4,105 people monthly, 325 annually. + +The general logic here is to impute wage values for people who only answered an income +range. We used industry and gender to estimate their specific income values. + +In the Cameroonian case the information can be at annual level or monthly. +*<_wage_no_compen_note_>*/ + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage13m=ap13a1 if ap13a==1 + gen wage13a=ap13a1 if ap13a==2 + replace wage13m=. if wage13m==0 + replace wage13a=. if wage13a==0 + + * First replace outliers by + winsor2 wage13m, suffix(_w) cuts(1 99) + winsor2 wage13a, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_catm=. + replace salary_catm=1 if inrange(wage13m_w, 1, 28499) + replace salary_catm=2 if inrange(wage13m_w, 28500, 46999) + replace salary_catm=3 if inrange(wage13m_w, 47000, 93999) + replace salary_catm=4 if inrange(wage13m_w, 94000, 187999) + replace salary_catm=5 if inrange(wage13m_w, 188000, 375999) + replace salary_catm=6 if inrange(wage13m_w, 376000, 751999) + replace salary_catm=7 if inrange(wage13m_w, 752000, 99999999) + + gen salary_cata=. + replace salary_cata=8 if inrange(wage13a_w, 1, 199999) + replace salary_cata=8 if inrange(wage13a_w, 200000, 399999) + replace salary_cata=10 if inrange(wage13a_w, 400000, 799999) + replace salary_cata=11 if inrange(wage13a_w, 800000, 1499999) + replace salary_cata=12 if inrange(wage13a_w, 1500000, 2999999) + replace salary_cata=13 if inrange(wage13a_w, 3000000, 4999999) + replace salary_cata=14 if inrange(wage13a_w, 5000000, 99999999) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage13m_w[iw=weight], by(industrycat4 male urban salary_catm) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage13m_w mwage_group_estimate + + * Rename salary_cat to ap13b since this is what we want the info to latch on to + rename salary_catm ap13b + tempfile salary_helper + save "`salary_helper'" + + * Restore, merge in + restore + merge m:1 industrycat4 male urban ap13b using "`salary_helper'", keep(matched master) nogen + + * Same process for annual estimates + preserve + collapse (mean)wage13a_w[iw=weight], by(industrycat4 male urban salary_cata) + rename wage13a_w awage_group_estimate + rename salary_cata ap13b + tempfile salary_helper2 + save "`salary_helper2'" + restore + merge m:1 industrycat4 male urban ap13b using "`salary_helper2'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen=. + + * Fill it first with values that are accurate + replace wage_no_compen=wage13m if ap13a==1 + replace wage_no_compen=wage13a if ap13a==2 + + * Now add the categorised means + replace wage_no_compen=mwage_group_estimate if inrange(ap13b,1,7)&!mi(mwage_group_estimate) + replace wage_no_compen=awage_group_estimate if inrange(ap13b,8,14)&!mi(awage_group_estimate) + + * Keep only for employed employees, label + replace wage_no_compen=. if lstatus!=1|empstat==2 + label var wage_no_compen "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_> + gen byte unitwage=. + replace unitwage=5 if ap13a==1|inrange(ap13b,1,7) + replace unitwage=8 if ap13a==2|inrange(ap13b,8,14) + replace unitwage=. if lstatus!=1 | empstat==2 + label var unitwage "Last wages' time unit primary job 7 day recall" + la de lblunitwage 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage lblunitwage +* + + +*<_whours_> + gen whours=ap10c + replace whours=. if lstatus!=1|ap10c==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=ap8d2 + recode contract (1 2=1) (3 4 5=0) (9=.) + 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=ap15e + recode healthins (2=0) (9=.) + 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_> + * Question 15f asks if the salary has CNPS, other. CNPS is the right thing we wish + * to code here (stands for Caisse nationale de prévoyance sociale), but, according to + * the interviewer manual, it should only be yes if it was not declared in AP13, + * that is, it does not work as a binary: are you contributing to CNPS. Moreover, + * the "other" category is never define (other social security or any other?) + gen byte socialsec = . + replace socialsec=. if lstatus!=1 + label var socialsec "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec 1 "With social security" 0 "Without social secturity" + label values socialsec lblsocialsec +* + + +*<_union_> + gen byte union=. + replace union=. if lstatus!=1 + label var union "Union membership at primary job 7 day recall" + la de lblunion 0 "Not union member" 1 "Union member" + label values union lblunion +* + + +*<_firmsize_l_> + gen byte firmsize_l=ap5 + recode firmsize_l (4=6) (5=11) (6=21) (7=51) (8=101) (9=501) + 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=ap5 + recode firmsize_u (3=5) (4=10) (5=20) (6=50) (7=100) (8=500) (9=.) + 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=as3 + recode empstat_2 (1/5=1) (6=3) (7=4) (8/9=2) (10/11=5) + replace empstat_2=. if lstatus!=1|as1a!=1 + label var empstat_2 "Employment status during past week secondary job 7 day recall" + la de lblempstat_2 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_2 lblempstat +* + + +*<_ocusec_2_> + gen byte ocusec_2 = as4 + recode ocusec_2 (1 5 =1) (2=3) (3 4 6 7 8=2) + replace ocusec_2=. if lstatus!=1|as1a!=1 + label var ocusec_2 "Sector of activity secondary job 7 day recall" + la de lblocusec_2 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2 lblocusec_2 +* + + +*<_industry_orig_2_> + gen industry_orig_2=as2 + replace industry_orig_2=. if lstatus!=1|as1a!=1 + label var industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + + +*<_industrycat_isic_2_> + gen industrycat_isic_2="" + replace industrycat_isic_2="" if industrycat_isic_2=="."|as1a!=1 + label var industrycat_isic_2 "ISIC code of secondary job 7 day recall" +* + + +*<_industrycat10_2_> + gen as2_1dig=floor(as2/1000) + gen industrycat10_2=as2_1dig + recode industrycat10_2 (1/4 = 1) (5/6=2) (7/28=3) (29/30=4) (31=5) (32 33=6) (34 35=7) (36/38=8) (39=9) (40/44=10) + replace industrycat10_2=. if lstatus!=1|as1a!=1 + label var industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 lblindustrycat10 +* + + +*<_industrycat4_2_> + gen byte industrycat4_2=industrycat10_2 + recode industrycat4_2 (3/5=2)(6/9=3)(10=4) + label var industrycat4_2 "1 digit industry classification (Broad Economic Activities), secondary job 7 day recall" + label values industrycat4_2 lblindustrycat4 +* + + +*<_occup_orig_2_> + gen occup_orig_2=as1 + replace occup_orig_2=. if lstatus!=1|as1a!=1 + label var occup_orig_2 "Original occupation record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2="" + replace occup_isco_2="" if lstatus!=1 | occup_isco_2=="."|as1a!=1 + 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 occup_2=. + replace occup_2=. if lstatus!=1|as1a!=1 + label var occup_2 "1 digit occupational classification secondary job 7 day recall" + label values occup_2 lbloccup +* + + +*<_wage_no_compen_2_> + + * Overall --> wage info (here the variable, for us it should be wage_no_compen) + * to missing if value is 0. + gen wage10m=as13a1 if as13a==1 + gen wage10a=as13a1 if as13a==2 + replace wage10m=. if wage10m==0 + replace wage10a=. if wage10a==0 + + * First replace outliers by + winsor2 wage10m, suffix(_w) cuts(1 99) + winsor2 wage10a, suffix(_w) cuts(1 99) + + * Create salary categories based on winsor values + gen salary_catm2=. + replace salary_catm2=1 if inrange(wage10m_w, 1, 28499) + replace salary_catm2=2 if inrange(wage10m_w, 28500, 46999) + replace salary_catm2=3 if inrange(wage10m_w, 47000, 93999) + replace salary_catm2=4 if inrange(wage10m_w, 94000, 187999) + replace salary_catm2=5 if inrange(wage10m_w, 188000, 375999) + replace salary_catm2=6 if inrange(wage10m_w, 376000, 752000) + + gen salary_cata2=. + replace salary_cata2=1 if inrange(wage10a_w, 1, 199999) + replace salary_cata2=2 if inrange(wage10a_w, 200000, 399999) + replace salary_cata2=3 if inrange(wage10a_w, 400000, 799999) + replace salary_cata2=4 if inrange(wage10a_w, 800000, 1499999) + replace salary_cata2=5 if inrange(wage10a_w, 1500000, 2999999) + replace salary_cata2=6 if inrange(wage10a_w, 3000000, 4999999) + replace salary_cata2=7 if inrange(wage10a_w, 5000000, 99999999) + + * Preserve to collapse, so we can merge the info in + preserve + + * Collpase by industry, sex, and salary categories + collapse (mean)wage10m_w[iw=weight], by(industrycat10_2 occup_skill_2 male urban salary_catm2) + + * Rename variable, otherwise when merging in, master version of an equally name one will be kept + rename wage10m_w mwage_group_estimate2 + + * Rename salary_cat to ap13b since this is what we want the info to latch on to + rename salary_catm2 as13b + tempfile salary_helper3 + save "`salary_helper3'" + + * Restore, merge in + restore + merge m:1 industrycat10_2 occup_skill_2 male urban as13b using "`salary_helper3'", keep(matched master) nogen + + * Same process for annual estimates + preserve + collapse (mean)wage10a_w[iw=weight], by(industrycat10_2 occup_skill_2 male urban salary_cata2) + rename wage10a_w awage_group_estimate2 + rename salary_cata2 as13b + tempfile salary_helper4 + save "`salary_helper4'" + restore + merge m:1 industrycat10_2 occup_skill_2 male urban as13b using "`salary_helper4'", keep(matched master) nogen + + * Create wage variable + gen wage_no_compen_2=. + + * Fill it first with values that are accurate + replace wage_no_compen_2=wage10m if as13a==1 + replace wage_no_compen_2=wage10a if as13a==2 + + * Now add the categorised means + replace wage_no_compen_2=mwage_group_estimate2 if inrange(as13b,1,7)&!mi(mwage_group_estimate2) + replace wage_no_compen_2=awage_group_estimate2 if inrange(as13b,8,14)&!mi(awage_group_estimate2) + + * Keep only for employed employees, label + replace wage_no_compen_2=. if as1a!=1 | empstat_2==2 + label var wage_no_compen_2 "Last wage payment primary job 7 day recall" +* + + +*<_unitwage_2_> + gen byte unitwage_2=. + replace unitwage_2=5 if as13a==1|inrange(as13b,1,7) + replace unitwage_2=8 if as13a==2|inrange(as13b,8,14) + label var unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 lblunitwage +* + + +*<_whours_2_> + gen whours_2=as10c + replace whours_2=. if as9b==0|as1a!=1 + label var whours_2 "Hours of work in last week secondary job 7 day recall" +* + + +*<_wmonths_2_> + gen wmonths_2=. + label var wmonths_2 "Months of work in past 12 months secondary job 7 day recall" +* + + +*<_wage_total_2_> + gen wage_total_2=. + label var wage_total_2 "Annualized total wage secondary job 7 day recall" +* + + +*<_firmsize_l_2_> + gen byte firmsize_l_2=as5 + recode firmsize_l_2 (4=6) (5=11) (6=21) (7=51) (8=101) (9=501) + label var firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + + +*<_firmsize_u_2_> + gen byte firmsize_u_2=as5 + recode firmsize_u_2 (4=6) (5=11) (6=21) (7=51) (8=101) (9=501) + 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 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 lstatus_year==1 + label var underemployment_year "Underemployment status" + la de lblunderemployment_year 0 "No" 1 "Yes" + label values underemployment_year lblunderemployment_year +* + + +*<_nlfreason_year_> + gen byte nlfreason_year=. + label var nlfreason_year "Reason not in the labor force" + la de lblnlfreason_year 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disable" 5 "Other" + label values nlfreason_year lblnlfreason_year +* + + +*<_unempldur_l_year_> + gen byte unempldur_l_year=. + label var unempldur_l_year "Unemployment duration (months) lower bracket" +* + + +*<_unempldur_u_year_> + gen byte unempldur_u_year=. + label var unempldur_u_year "Unemployment duration (months) upper bracket" +* + +} + +*----------8.7: 12 month reference main job------------------------------* + +{ +*<_empstat_year_> + gen byte empstat_year=. + label var empstat_year "Employment status during past week primary job 12 month recall" + la de lblempstat_year 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classifiable by status" + label values empstat_year lblempstat_year +* + + +*<_ocusec_year_> + gen byte ocusec_year=. + label var ocusec_year "Sector of activity primary job 12 day recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year=. + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year="" + replace industrycat_isic_year="" if industrycat_isic_year=="." + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + + +*<_industrycat10_year_> + gen byte industrycat10_year=. + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "1 digit industry classification (Broad Economic Activities), primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year=. + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen str4 occup_isco_year="" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_skill_year_> + gen skill_level_year=substr(occup_isco_year,1,1) + destring skill_level_year, replace + gen occup_skill_year=. + replace occup_skill_year=1 if skill_level_year==9 + replace occup_skill_year=2 if inrange(skill_level_year,4,8) + replace occup_skill_year=3 if inrange(skill_level_year,1,3) + replace occup_skill_year=. if skill_level_year==0 + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year=. + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year=. + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen byte unitwage_year=. + label var unitwage_year "Last wages' time unit primary job 12 month recall" + la de lblunitwage_year 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonthly" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage_year lblunitwage_year +* + + +*<_whours_year_> + gen whours_year=. + label var whours_year "Hours of work in last week primary job 12 month recall" +* + + +*<_wmonths_year_> + gen wmonths_year=. + label var wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + + +*<_wage_total_year_> + gen wage_total_year=. + label var wage_total_year "Annualized total wage primary job 12 month recall" +* + + +*<_contract_year_> + gen byte contract_year=. + label var contract_year "Employment has contract primary job 12 month recall" + la de lblcontract_year 0 "Without contract" 1 "With contract" + label values contract_year lblcontract_year +* + + +*<_healthins_year_> + gen byte healthins_year=. + label var healthins_year "Employment has health insurance primary job 12 month recall" + la de lblhealthins_year 0 "Without health insurance" 1 "With health insurance" + label values healthins_year lblhealthins_year +* + + +*<_socialsec_year_> + gen byte socialsec_year=. + label var socialsec_year "Employment has social security insurance primary job 7 day recall" + la de lblsocialsec_year 1 "With social security" 0 "Without social secturity" + label values socialsec_year lblsocialsec_year +* + + +*<_union_year_> + gen byte union_year=. + label var union_year "Union membership at primary job 12 month recall" + la de lblunion_year 0 "Not union member" 1 "Union member" + label values union_year lblunion_year +* + + +*<_firmsize_l_year_> + gen byte firmsize_l_year=. + label var firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + + +*<_firmsize_u_year_> + gen byte firmsize_u_year=. + label var firmsize_u_year "Firm size (upper bracket) primary job 12 month recall" +* + +} + + +*----------8.8: 12 month reference secondary job------------------------------* + +{ + +*<_empstat_2_year_> + gen byte empstat_2_year=. + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year=. + label var ocusec_2_year "Sector of activity secondary job 12 day recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year=. + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year=. + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year=. + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "1 digit industry classification (Broad Economic Activities), secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year=. + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year=. + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year=. + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year=. + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year=. + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen byte unitwage_2_year=. + label var unitwage_2_year "Last wages' time unit secondary job 12 month recall" + label values unitwage_2_year lblunitwage_year +* + + +*<_whours_2_year_> + gen whours_2_year=. + label var whours_2_year "Hours of work in last week secondary job 12 month recall" +* + + +*<_wmonths_2_year_> + gen wmonths_2_year=. + label var wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + + +*<_wage_total_2_year_> + gen wage_total_2_year=. + label var wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + + +*<_firmsize_l_2_year_> + gen byte firmsize_l_2_year=. + label var firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + + +*<_firmsize_u_2_year_> + gen byte firmsize_u_2_year=. + label var firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + +} + + +*----------8.9: 12 month reference additional jobs------------------------------* + + +*<_t_hours_others_year_> + gen t_hours_others_year=. + label var t_hours_others_year "Annualized hours worked in all but primary and secondary jobs 12 month recall" +* + + +*<_t_wage_nocompen_others_year_> + gen t_wage_nocompen_others_year=. + label var t_wage_nocompen_others_year "Annualized wage in all but primary & secondary jobs excl. bonuses, etc. 12 month recall)" +* + + +*<_t_wage_others_year_> + gen t_wage_others_year=. + label var t_wage_others_year "Annualized wage in all but primary and secondary jobs 12 month recall" +* + + +*----------8.10: 12 month total summary------------------------------* + + +*<_t_hours_total_year_> + gen t_hours_total_year=. + label var t_hours_total_year "Annualized hours worked in all jobs 12 month month recall" +* + + +*<_t_wage_nocompen_total_year_> + gen t_wage_nocompen_total_year=. + label var t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + + +*<_t_wage_total_year_> + gen t_wage_total_year=. + label var t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* + + +*<_njobs_> + gen njobs=. + replace njobs=1 if lstatus==1&as1a!=1 + replace njobs=2 if lstatus==1&as1a==1 + replace njobs=. if lstatus!=1 + label var njobs "Total number of jobs" +* + + +*<_t_hours_annual_> + gen t_hours_annual=. + label var t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + + +*<_linc_nc_> + gen linc_nc=. + label var linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + + +*<_laborincome_> + gen laborincome=. + label var laborincome "Total annual individual labor income in all jobs, incl. bonuses, etc." +* + + +*----------8.13: Labour cleanup------------------------------* + +{ +*<_% Correction min age_> + +** Drop info for cases under the age for which questions to be asked (do not need a variable for this) + local lab_var "minlaborage lstatus nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome" + + foreach v of local lab_var { + cap confirm numeric variable `v' + if _rc == 0 { // is indeed numeric + replace `v'=. if ( age < minlaborage & !missing(age) ) + } + else { // is not + replace `v'= "" if ( age < minlaborage & !missing(age) ) + } + + } + +* +} + + +/*%%============================================================================================= + 9: Final steps +==============================================================================================%%*/ + +quietly{ + +*<_% KEEP VARIABLES - ALL_> + + keep countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% ORDER VARIABLES_> + + order countrycode survname survey icls_v isced_version isco_version isic_version year vermast veralt harmonization int_year int_month hhid pid weight psu ssu strata wave panel visit_no urban subnatid1 subnatid2 subnatid3 subnatidsurvey subnatid1_prev subnatid2_prev subnatid3_prev gaul_adm1_code gaul_adm2_code gaul_adm3_code hsize age male relationharm relationcs marital eye_dsablty hear_dsablty walk_dsablty conc_dsord slfcre_dsablty comm_dsablty migrated_mod_age migrated_ref_time migrated_binary migrated_years migrated_from_urban migrated_from_cat migrated_from_code migrated_from_country migrated_reason ed_mod_age school literacy educy educat7 educat5 educat4 educat_orig educat_isced vocational vocational_type vocational_length_l vocational_length_u vocational_field_orig vocational_financed minlaborage lstatus potential_lf underemployment nlfreason unempldur_l unempldur_u empstat ocusec industry_orig industrycat_isic industrycat10 industrycat4 occup_orig occup_isco occup_skill occup wage_no_compen unitwage whours wmonths wage_total contract healthins socialsec union firmsize_l firmsize_u empstat_2 ocusec_2 industry_orig_2 industrycat_isic_2 industrycat10_2 industrycat4_2 occup_orig_2 occup_isco_2 occup_skill_2 occup_2 wage_no_compen_2 unitwage_2 whours_2 wmonths_2 wage_total_2 firmsize_l_2 firmsize_u_2 t_hours_others t_wage_nocompen_others t_wage_others t_hours_total t_wage_nocompen_total t_wage_total lstatus_year potential_lf_year underemployment_year nlfreason_year unempldur_l_year unempldur_u_year empstat_year ocusec_year industry_orig_year industrycat_isic_year industrycat10_year industrycat4_year occup_orig_year occup_isco_year occup_skill_year occup_year wage_no_compen_year unitwage_year whours_year wmonths_year wage_total_year contract_year healthins_year socialsec_year union_year firmsize_l_year firmsize_u_year empstat_2_year ocusec_2_year industry_orig_2_year industrycat_isic_2_year industrycat10_2_year industrycat4_2_year occup_orig_2_year occup_isco_2_year occup_skill_2_year occup_2_year wage_no_compen_2_year unitwage_2_year whours_2_year wmonths_2_year wage_total_2_year firmsize_l_2_year firmsize_u_2_year t_hours_others_year t_wage_nocompen_others_year t_wage_others_year t_hours_total_year t_wage_nocompen_total_year t_wage_total_year njobs t_hours_annual linc_nc laborincome + +* + +*<_% DROP UNUSED LABELS_> + + * Store all labels in data + label dir + local all_lab `r(names)' + + * Store all variables with a label, extract value label names + local used_lab = "" + ds, has(vallabel) + + local labelled_vars `r(varlist)' + + foreach varName of local labelled_vars { + local y : value label `varName' + local used_lab `"`used_lab' `y'"' + } + + * Compare lists, `notused' is list of labels in directory but not used in final variables + local notused : list all_lab - used_lab // local `notused' defines value labs not in remaining vars + local notused_len : list sizeof notused // store size of local + + * drop labels if the length of the notused vector is 1 or greater, otherwise nothing to drop + if `notused_len' >= 1 { + label drop `notused' + } + else { + di "There are no unused labels to drop. No value labels dropped." + } + + +* + +} + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach var of local kept_vars { + + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + +save "`path_output'/`level_2_harm'_ALL.dta", replace + +*