From c2a194605a0599075ac1a01d5788e9c6964e1835 Mon Sep 17 00:00:00 2001 From: Mario G <63501500+gronert-m@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:40:01 -0500 Subject: [PATCH] Update BRA: socialsec label was wrong --- .../BRA_1981_PNAD_V01_M_V03_A_GLD_ALL.do | 2472 +++++++++++++++ .../BRA_1982_PNAD_V01_M_V03_A_GLD_ALL.do | 2436 +++++++++++++++ .../BRA_1983_PNAD_V01_M_V03_A_GLD_ALL.do | 2443 +++++++++++++++ .../BRA_1984_PNAD_V01_M_V03_A_GLD_ALL.do | 2444 +++++++++++++++ .../BRA_1985_PNAD_V01_M_V03_A_GLD_ALL.do | 2437 +++++++++++++++ .../BRA_1986_PNAD_V01_M_V03_A_GLD_ALL.do | 2440 +++++++++++++++ .../BRA_1987_PNAD_V01_M_V03_A_GLD_ALL.do | 2438 +++++++++++++++ .../BRA_1988_PNAD_V01_M_V03_A_GLD_ALL.do | 2444 +++++++++++++++ .../BRA_1989_PNAD_V01_M_V03_A_GLD_ALL.do | 2443 +++++++++++++++ .../BRA_1990_PNAD_V01_M_V03_A_GLD_ALL.do | 2492 ++++++++++++++++ .../BRA_1992_PNAD_V01_M_V02_A_GLD_ALL.do | 2638 +++++++++++++++++ .../BRA_1993_PNAD_V01_M_V02_A_GLD_ALL.do | 2636 ++++++++++++++++ .../BRA_1995_PNAD_V01_M_V02_A_GLD_ALL.do | 2637 ++++++++++++++++ .../BRA_1996_PNAD_V01_M_V02_A_GLD_ALL.do | 2633 ++++++++++++++++ .../BRA_1997_PNAD_V01_M_V02_A_GLD_ALL.do | 2636 ++++++++++++++++ .../BRA_1998_PNAD_V01_M_V03_A_GLD_ALL.do | 2634 ++++++++++++++++ .../BRA_1999_PNAD_V01_M_V02_A_GLD_ALL.do | 2635 ++++++++++++++++ .../BRA_2001_PNAD_V01_M_V02_A_GLD_ALL.do | 2386 +++++++++++++++ .../BRA_2002_PNAD_V01_M_V02_A_GLD_ALL.do | 2291 ++++++++++++++ .../BRA_2003_PNAD_V01_M_V02_A_GLD_ALL.do | 2286 ++++++++++++++ .../BRA_2004_PNAD_V01_M_V02_A_GLD_ALL.do | 2288 ++++++++++++++ .../BRA_2005_PNAD_V01_M_V03_A_GLD_ALL.do | 2288 ++++++++++++++ .../BRA_2006_PNAD_V01_M_V02_A_GLD_ALL.do | 2286 ++++++++++++++ .../BRA_2007_PNAD_V01_M_V02_A_GLD_ALL.do | 2286 ++++++++++++++ .../BRA_2008_PNAD_V01_M_V02_A_GLD_ALL.do | 2287 ++++++++++++++ .../BRA_2009_PNAD_V01_M_V02_A_GLD_ALL.do | 2286 ++++++++++++++ .../BRA_2011_PNAD_V01_M_V02_A_GLD_ALL.do | 2286 ++++++++++++++ .../BRA_2012_PNADC_V01_M_V05_A_GLD_ALL.do | 2030 +++++++++++++ .../BRA_2013_PNADC_V01_M_V05_A_GLD_ALL.do | 2031 +++++++++++++ .../BRA_2014_PNADC_V01_M_V05_A_GLD_ALL.do | 2032 +++++++++++++ .../BRA_2015_PNADC_V01_M_V05_A_GLD_ALL.do | 2041 +++++++++++++ .../BRA_2016_PNADC_V01_M_V05_A_GLD_ALL.do | 2040 +++++++++++++ .../BRA_2017_PNADC_V01_M_V05_A_GLD_ALL.do | 2041 +++++++++++++ .../BRA_2018_PNADC_V01_M_V05_A_GLD_ALL.do | 2045 +++++++++++++ .../BRA_2019_PNADC_V01_M_V05_A_GLD_ALL.do | 2041 +++++++++++++ .../BRA_2020_PNADC_V01_M_V05_A_GLD_ALL.do | 2041 +++++++++++++ .../BRA_2022_PNADC_V01_M_V02_A_GLD_ALL.do | 2036 +++++++++++++ 37 files changed, 86286 insertions(+) create mode 100644 GLD/BRA/BRA_1981_PNAD/BRA_1981_PNAD_V01_M_V03_A_GLD/Programs/BRA_1981_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1982_PNAD/BRA_1982_PNAD_V01_M_V03_A_GLD/Programs/BRA_1982_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1983_PNAD/BRA_1983_PNAD_V01_M_V03_A_GLD/Programs/BRA_1983_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1984_PNAD/BRA_1984_PNAD_V01_M_V03_A_GLD/Programs/BRA_1984_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1985_PNAD/BRA_1985_PNAD_V01_M_V03_A_GLD/Programs/BRA_1985_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1986_PNAD/BRA_1986_PNAD_V01_M_V03_A_GLD/Programs/BRA_1986_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1987_PNAD/BRA_1987_PNAD_V01_M_V03_A_GLD/Programs/BRA_1987_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1988_PNAD/BRA_1988_PNAD_V01_M_V03_A_GLD/Programs/BRA_1988_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1989_PNAD/BRA_1989_PNAD_V01_M_V03_A_GLD/Programs/BRA_1989_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1990_PNAD/BRA_1990_PNAD_V01_M_V03_A_GLD/Programs/BRA_1990_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1992_PNAD/BRA_1992_PNAD_V01_M_V02_A_GLD/Programs/BRA_1992_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1993_PNAD/BRA_1993_PNAD_V01_M_V02_A_GLD/Programs/BRA_1993_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1995_PNAD/BRA_1995_PNAD_V01_M_V02_A_GLD/Programs/BRA_1995_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1996_PNAD/BRA_1996_PNAD_V01_M_V02_A_GLD/Programs/BRA_1996_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1997_PNAD/BRA_1997_PNAD_V01_M_V02_A_GLD/Programs/BRA_1997_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1998_PNAD/BRA_1998_PNAD_V01_M_V03_A_GLD/Programs/BRA_1998_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_1999_PNAD/BRA_1999_PNAD_V01_M_V02_A_GLD/Programs/BRA_1999_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2001_PNAD/BRA_2001_PNAD_V01_M_V02_A_GLD/Programs/BRA_2001_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2002_PNAD/BRA_2002_PNAD_V01_M_V02_A_GLD/Programs/BRA_2002_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2003_PNAD/BRA_2003_PNAD_V01_M_V02_A_GLD/Programs/BRA_2003_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2004_PNAD/BRA_2004_PNAD_V01_M_V02_A_GLD/Programs/BRA_2004_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2005_PNAD/BRA_2005_PNAD_V01_M_V03_A_GLD/Programs/BRA_2005_PNAD_V01_M_V03_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2006_PNAD/BRA_2006_PNAD_V01_M_V02_A_GLD/Programs/BRA_2006_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2007_PNAD/BRA_2007_PNAD_V01_M_V02_A_GLD/Programs/BRA_2007_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2008_PNAD/BRA_2008_PNAD_V01_M_V02_A_GLD/Programs/BRA_2008_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2009_PNAD/BRA_2009_PNAD_V01_M_V02_A_GLD/Programs/BRA_2009_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2011_PNAD/BRA_2011_PNAD_V01_M_V02_A_GLD/Programs/BRA_2011_PNAD_V01_M_V02_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2012_PNADC/BRA_2012_PNADC_V01_M_V05_A_GLD/Programs/BRA_2012_PNADC_V01_M_V05_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2013_PNADC/BRA_2013_PNADC_V01_M_V05_A_GLD/Programs/BRA_2013_PNADC_V01_M_V05_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2014_PNADC/BRA_2014_PNADC_V01_M_V05_A_GLD/Programs/BRA_2014_PNADC_V01_M_V05_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2015_PNADC/BRA_2015_PNADC_V01_M_V05_A_GLD/Programs/BRA_2015_PNADC_V01_M_V05_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2016_PNADC/BRA_2016_PNADC_V01_M_V05_A_GLD/Programs/BRA_2016_PNADC_V01_M_V05_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2017_PNADC/BRA_2017_PNADC_V01_M_V05_A_GLD/Programs/BRA_2017_PNADC_V01_M_V05_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2018_PNADC/BRA_2018_PNADC_V01_M_V05_A_GLD/Programs/BRA_2018_PNADC_V01_M_V05_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2019_PNADC/BRA_2019_PNADC_V01_M_V05_A_GLD/Programs/BRA_2019_PNADC_V01_M_V05_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2020_PNADC/BRA_2020_PNADC_V01_M_V05_A_GLD/Programs/BRA_2020_PNADC_V01_M_V05_A_GLD_ALL.do create mode 100644 GLD/BRA/BRA_2022_PNADC/BRA_2022_PNADC_V01_M_V02_A_GLD/Programs/BRA_2022_PNADC_V01_M_V02_A_GLD_ALL.do diff --git a/GLD/BRA/BRA_1981_PNAD/BRA_1981_PNAD_V01_M_V03_A_GLD/Programs/BRA_1981_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1981_PNAD/BRA_1981_PNAD_V01_M_V03_A_GLD/Programs/BRA_1981_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..49beaccc8 --- /dev/null +++ b/GLD/BRA/BRA_1981_PNAD/BRA_1981_PNAD_V01_M_V03_A_GLD/Programs/BRA_1981_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2472 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1981_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1981 +<_Study ID_> BRA_1981_PNAD_v01_M +<_Data collection from_> 09/1981 +<_Data collection to_> 09/1981 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 103,961 +<_Sample size (IND)_> 482,611 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Cruzeiro (Cr$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1981" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1981 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\pnad1981.dta", clear + + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + tab count [iweight = v9991] + + * 0 instances where HH weight is missing + count if v9991 == . + + egen tag = diff(v9981 v9991) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + + distinct id_dom id_pes, joint + + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + +*/ + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + tostring id_pes, replace + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> + +sum v9991, de + + rename v9991 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" // Check; A: Individual Weights + +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + + +*<_urban_> + recode v0003 (5=0) + rename v0003 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + + + destring uf, replace +recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + + +/* CENSUS AREA */ +rename v0005 census_area + + + + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1981: contains "-1", which should be changed to missing (.) + + */ + + rename v0107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +/* DATE OF BIRTH */ +* Year of birth reports age when age is assumed. +* Replacing with missing. +recode v0310 (0/98=.) if v0309 == 20 | v0309 == 30 + +* In some cases, year of birth and age are interchanged. +gen x1 = v0310 if v0310 < 800 +gen x2 = v0805 if v0805 > 800 +replace v0310 = x2 if x1 ~= . +replace v0805 = x1 if x2 ~= . +drop x1 x2 +recode v0310 (999=.) + +* Adding the 1 in the year of birth +* People of presumed age do not have year of birth +gene x1 = 1 +egen birth_year = concat(x1 v0310) if v0310 ~= . +drop x1 v0310 +destring birth_year, replace +label var birth_year "year of birth" + +recode v0308 (0 99=.) +rename v0308 birth_day +* 0 (zero) would be presumed age, 99 without declaration + +recode v0309 (20 30 99 =.) +rename v0309 birth_month +* 20 and 30 would be presumed age, 99 without declaration + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename v0805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename v0303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +gen relationcs = . +gen relationharm = . +gen marital = . + + +*<_eye_dsablty_> + gen eye_dsablty = v6501 + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab + drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = v6511 + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab + drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = v6551 + recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty + replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab + drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + + + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + */ + gen school = (v0314 !=0) if v0314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode v0311 (3 = 0) (1 = 1) (9 = .) + rename v0311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = v0318 - 1 if v0318 >= 1 & v0318 < 9 + + replace educy =1 if v0314==1 & v0312==2 +replace educy =2 if v0314==1 & v0312==3 +replace educy =3 if v0314==1 & v0312==4 + +replace educy =4 if v0314==2 & v0312==1 +replace educy =5 if v0314==2 & v0312==2 +replace educy =6 if v0314==2 & v0312==3 +replace educy =7 if v0314==2 & v0312==4 + +replace educy =8 if v0314==3 & v0312==1 +replace educy =9 if v0314==3 & v0312==2 +replace educy =10 if v0314==3 & v0312==3 + +replace educy =0 if v0314==4 & v0312==1 +replace educy =1 if v0314==4 & v0312==2 +replace educy =2 if v0314==4 & v0312==3 +replace educy =3 if v0314==4 & v0312==4 +replace educy =4 if v0314==4 & v0312==5 +replace educy =5 if v0314==4 & v0312==6 +replace educy =6 if v0314==4 & v0312==7 +replace educy =7 if v0314==4 & v0312==8 + +replace educy =8 if v0314==5 & v0312==1 +replace educy =9 if v0314==5 & v0312==2 +replace educy =10 if v0314==5 & v0312==3 +replace educy =11 if v0314==5 & v0312==4 + +replace educy =11 if v0314==6 & v0312==1 +replace educy =12 if v0314==6 & v0312==2 +replace educy =13 if v0314==6 & v0312==3 +replace educy =14 if v0314==6 & v0312==4 +replace educy =15 if v0314==6 & v0312==5 +replace educy =16 if v0314==6 & v0312==6 + +replace educy =0 if v0314==7 + +replace educy =0 if v0314==8 + +replace educy =0 if v0314==9 & v0312==1 +replace educy =1 if v0314==9 & v0312==2 +replace educy =2 if v0314==9 & v0312==3 +replace educy =3 if v0314==9 & v0312==4 +replace educy =4 if v0314==9 & v0312==5 +replace educy =5 if v0314==9 & v0312==6 +replace educy =6 if v0314==9 & v0312==7 +replace educy =7 if v0314==9 & v0312==8 + +replace educy =8 if v0314==10 & v0312==1 +replace educy =9 if v0314==10 & v0312==2 +replace educy =10 if v0314==10 & v0312==3 + +replace educy =0 if v0314==11 & v0312==1 +replace educy =1 if v0314==11 & v0312==2 +replace educy =2 if v0314==11 & v0312==3 +replace educy =3 if v0314==11 & v0312==4 +replace educy =4 if v0314==11 & v0312==5 +replace educy =5 if v0314==11 & v0312==6 +replace educy =6 if v0314==11 & v0312==7 +replace educy =7 if v0314==11 & v0312==8 + +replace educy =8 if v0314==12 & v0312==1 +replace educy =9 if v0314==12 & v0312==2 +replace educy =10 if v0314==12 & v0312==3 + +replace educy =11 if v0314==14 + +replace educy =15 if v0314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if v0317==1 & v0315==1 +replace educy =2 if v0317==1 & v0315==2 +replace educy =3 if v0317==1 & v0315==3 +replace educy =4 if v0317==1 & v0315==4 +replace educy =4 if v0317==1 & v0315==5 + +replace educy =5 if v0317==2 & v0315==1 +replace educy =6 if v0317==2 & v0315==2 +replace educy =7 if v0317==2 & v0315==3 +replace educy =8 if v0317==2 & v0315==4 +replace educy =8 if v0317==2 & v0315==5 + +replace educy =9 if v0317==3 & v0315==1 +replace educy =10 if v0317==3 & v0315==2 +replace educy =11 if v0317==3 & v0315==3 +replace educy =11 if v0317==3 & v0315==4 + +replace educy =1 if v0317==4 & v0315==1 +replace educy =2 if v0317==4 & v0315==2 +replace educy =3 if v0317==4 & v0315==3 +replace educy =4 if v0317==4 & v0315==4 +replace educy =5 if v0317==4 & v0315==5 +replace educy =6 if v0317==4 & v0315==6 +replace educy =7 if v0317==4 & v0315==7 +replace educy =8 if v0317==4 & v0315==8 + +replace educy =9 if v0317==5 & v0315==1 +replace educy =10 if v0317==5 & v0315==2 +replace educy =11 if v0317==5 & v0315==3 +replace educy =11 if v0317==5 & v0315==4 + +replace educy =12 if v0317==6 & v0315==1 +replace educy =13 if v0317==6 & v0315==2 +replace educy =14 if v0317==6 & v0315==3 +replace educy =15 if v0317==6 & v0315==4 +replace educy =16 if v0317==6 & v0315==5 +replace educy =17 if v0317==6 & v0315==6 + +replace educy =17 if v0317==7 & v0315==2 +replace educy =18 if v0317==7 & v0315==3 +replace educy =19 if v0317==7 & v0315>=4 + + +replace educy =0 if v0312==0 & v0314==0 & v0315==0 & v0317==0 + +* Change that so university incomplete is having had stepped in university + + recast float educy + label variable educy "Years of education" + drop v0312 v0315 v0317 v0318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (v0314 == 1 | v0314 == 2 | v0314 == 4 | v0314 == 7 | v0314 == 8 | v0314 == 9 | v0314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (v0314 == 14 | v0314 == 12 | v0314 == 10 | v0314 == 5 | v0314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (v0314 == 13 | v0314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1981 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode v0537 (9999999=.) if year >= 1981 & year <= 1984 +recode v0537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode v0538 (9999999=.) if year >= 1981 & year <= 1984 +recode v0538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode v0549 (9999999=.) if year >= 1981 & year <= 1984 +recode v0549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode v0550 (9999999=.) if year >= 1981 & year <= 1984 +recode v0550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode v0578 (9999999=.) if year >= 1981 & year <= 1984 +recode v0578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode v0579 (9999999=.) if year >= 1981 & year <= 1984 +recode v0579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode v0580 (9999999=.) if year >= 1981 & year <= 1984 +recode v0580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode v0581 (9999999=.) if year >= 1981 & year <= 1984 +recode v0581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode v0582 (9999999=.) if year >= 1981 & year <= 1984 +recode v0582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode v0600 (9999999=.) if year >= 1981 & year <= 1984 +recode v0600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode v0601 (9999999=.) if year >= 1981 & year <= 1984 +recode v0601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode v0602 (9999999=.) if year >= 1981 & year <= 1984 +recode v0602 (999999999=.) if year >= 1985 & year <= 1990 + +replace v5010 =. if v5010>=9999999 + +/* CONVERTING NOMINAL VALUES TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1981 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1981: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (v0501 == 1 | v0501 == 2) & age >= minlaborage + replace lstatus = 2 if (v0501 == 3 | v0513 == 1) & age >= minlaborage + replace lstatus = 3 if (v0501 == 4 | v0501 == 5 | v0501 == 6 | v0501 == 7) & v0513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop v0513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = v0501 - 3 if v0501 >= 4 & v0501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop v0501 +* + +*<_unempldur_l_> + gen unempldur_l = v0516 if v0516 >= 0 & v0516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check; A: Don't worry about that + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4756 is V4756 + + */ + rename v5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(v0504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10)*100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(v0503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring v0503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0503 = "00`i'" if v0503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0503 = "0`i'" if v0503 == "`i'" + } + + + } + +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "." +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + */ + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename v0600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename v0508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename v0506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename v0511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = "" + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace v0601 = 0 if v0601 ==. + g v0600 = wage_no_compen + replace v0600 = 0 if v0600 ==. + + gen wage_no_compen_2 = v0601 - v0600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop v0600 v0601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace v5100 = 0 if v5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = v5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop v5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop v9981 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1982_PNAD/BRA_1982_PNAD_V01_M_V03_A_GLD/Programs/BRA_1982_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1982_PNAD/BRA_1982_PNAD_V01_M_V03_A_GLD/Programs/BRA_1982_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..234c1aad6 --- /dev/null +++ b/GLD/BRA/BRA_1982_PNAD/BRA_1982_PNAD_V01_M_V03_A_GLD/Programs/BRA_1982_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2436 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1982_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1982 +<_Study ID_> BRA_1982_PNAD_v01_M +<_Data collection from_> 09/1982 +<_Data collection to_> 09/1982 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 114,186 +<_Sample size (IND)_> 512,016 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Cruzeiro (Cr$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023-02-21 Correct whours +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1982" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1982 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\pnad1982.dta",clear + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + tab count [iweight = v9991] + + * 0 instances where HH weight is missing + count if v9991 == . + + + egen tag = diff(v9981 v9991) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + + distinct id_dom id_pes, joint + + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + +*/ + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" + +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000001 + rename id_dom hhid + label variable hhid "Household ID" + + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + cap drop __000000 + tostring id_pes, replace + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" //check +* + +*<_weight_> + +sum v9981, de + + rename v9981 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* drop v9981 +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +*<_urban_> + recode v0003 (5=0) + rename v0003 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + + + destring uf, replace +recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + + +/* CENSUS AREA */ +rename v0005 census_area + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1981: contains "-1", which should be changed to missing (.) + + */ + + rename v0107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename v0805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename v0303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +gen relationcs = . +gen relationharm = . +gen marital = . + + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab +cap drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab +cap drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = . +* recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty +* replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +cap drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + */ + gen school = (v0314 !=0) if v0314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode v0311 (3 = 0) (1 = 1) (9 = .) + rename v0311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = v0318 - 1 if v0318 >= 1 & v0318 < 9 + + replace educy =1 if v0314==1 & v0312==2 +replace educy =2 if v0314==1 & v0312==3 +replace educy =3 if v0314==1 & v0312==4 + +replace educy =4 if v0314==2 & v0312==1 +replace educy =5 if v0314==2 & v0312==2 +replace educy =6 if v0314==2 & v0312==3 +replace educy =7 if v0314==2 & v0312==4 + +replace educy =8 if v0314==3 & v0312==1 +replace educy =9 if v0314==3 & v0312==2 +replace educy =10 if v0314==3 & v0312==3 + +replace educy =0 if v0314==4 & v0312==1 +replace educy =1 if v0314==4 & v0312==2 +replace educy =2 if v0314==4 & v0312==3 +replace educy =3 if v0314==4 & v0312==4 +replace educy =4 if v0314==4 & v0312==5 +replace educy =5 if v0314==4 & v0312==6 +replace educy =6 if v0314==4 & v0312==7 +replace educy =7 if v0314==4 & v0312==8 + +replace educy =8 if v0314==5 & v0312==1 +replace educy =9 if v0314==5 & v0312==2 +replace educy =10 if v0314==5 & v0312==3 +replace educy =11 if v0314==5 & v0312==4 + +replace educy =11 if v0314==6 & v0312==1 +replace educy =12 if v0314==6 & v0312==2 +replace educy =13 if v0314==6 & v0312==3 +replace educy =14 if v0314==6 & v0312==4 +replace educy =15 if v0314==6 & v0312==5 +replace educy =16 if v0314==6 & v0312==6 + +replace educy =0 if v0314==7 + +replace educy =0 if v0314==8 + +replace educy =0 if v0314==9 & v0312==1 +replace educy =1 if v0314==9 & v0312==2 +replace educy =2 if v0314==9 & v0312==3 +replace educy =3 if v0314==9 & v0312==4 +replace educy =4 if v0314==9 & v0312==5 +replace educy =5 if v0314==9 & v0312==6 +replace educy =6 if v0314==9 & v0312==7 +replace educy =7 if v0314==9 & v0312==8 + +replace educy =8 if v0314==10 & v0312==1 +replace educy =9 if v0314==10 & v0312==2 +replace educy =10 if v0314==10 & v0312==3 + +replace educy =0 if v0314==11 & v0312==1 +replace educy =1 if v0314==11 & v0312==2 +replace educy =2 if v0314==11 & v0312==3 +replace educy =3 if v0314==11 & v0312==4 +replace educy =4 if v0314==11 & v0312==5 +replace educy =5 if v0314==11 & v0312==6 +replace educy =6 if v0314==11 & v0312==7 +replace educy =7 if v0314==11 & v0312==8 + +replace educy =8 if v0314==12 & v0312==1 +replace educy =9 if v0314==12 & v0312==2 +replace educy =10 if v0314==12 & v0312==3 + +replace educy =11 if v0314==14 + +replace educy =15 if v0314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if v0317==1 & v0315==1 +replace educy =2 if v0317==1 & v0315==2 +replace educy =3 if v0317==1 & v0315==3 +replace educy =4 if v0317==1 & v0315==4 +replace educy =4 if v0317==1 & v0315==5 + +replace educy =5 if v0317==2 & v0315==1 +replace educy =6 if v0317==2 & v0315==2 +replace educy =7 if v0317==2 & v0315==3 +replace educy =8 if v0317==2 & v0315==4 +replace educy =8 if v0317==2 & v0315==5 + +replace educy =9 if v0317==3 & v0315==1 +replace educy =10 if v0317==3 & v0315==2 +replace educy =11 if v0317==3 & v0315==3 +replace educy =11 if v0317==3 & v0315==4 + +replace educy =1 if v0317==4 & v0315==1 +replace educy =2 if v0317==4 & v0315==2 +replace educy =3 if v0317==4 & v0315==3 +replace educy =4 if v0317==4 & v0315==4 +replace educy =5 if v0317==4 & v0315==5 +replace educy =6 if v0317==4 & v0315==6 +replace educy =7 if v0317==4 & v0315==7 +replace educy =8 if v0317==4 & v0315==8 + +replace educy =9 if v0317==5 & v0315==1 +replace educy =10 if v0317==5 & v0315==2 +replace educy =11 if v0317==5 & v0315==3 +replace educy =11 if v0317==5 & v0315==4 + +replace educy =12 if v0317==6 & v0315==1 +replace educy =13 if v0317==6 & v0315==2 +replace educy =14 if v0317==6 & v0315==3 +replace educy =15 if v0317==6 & v0315==4 +replace educy =16 if v0317==6 & v0315==5 +replace educy =17 if v0317==6 & v0315==6 + +replace educy =17 if v0317==7 & v0315==2 +replace educy =18 if v0317==7 & v0315==3 +replace educy =19 if v0317==7 & v0315>=4 + + +replace educy =0 if v0312==0 & v0314==0 & v0315==0 & v0317==0 + +* Change that so university incomplete is having had stepped in university + + recast float educy + label variable educy "Years of education" + drop v0312 v0315 v0317 v0318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (v0314 == 1 | v0314 == 2 | v0314 == 4 | v0314 == 7 | v0314 == 8 | v0314 == 9 | v0314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (v0314 == 14 | v0314 == 12 | v0314 == 10 | v0314 == 5 | v0314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (v0314 == 13 | v0314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1981 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode v0537 (9999999=.) if year >= 1981 & year <= 1984 +recode v0537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode v0538 (9999999=.) if year >= 1981 & year <= 1984 +recode v0538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode v0549 (9999999=.) if year >= 1981 & year <= 1984 +recode v0549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode v0550 (9999999=.) if year >= 1981 & year <= 1984 +recode v0550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode v0578 (9999999=.) if year >= 1981 & year <= 1984 +recode v0578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode v0579 (9999999=.) if year >= 1981 & year <= 1984 +recode v0579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode v0580 (9999999=.) if year >= 1981 & year <= 1984 +recode v0580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode v0581 (9999999=.) if year >= 1981 & year <= 1984 +recode v0581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode v0582 (9999999=.) if year >= 1981 & year <= 1984 +recode v0582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode v0600 (9999999=.) if year >= 1981 & year <= 1984 +recode v0600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode v0601 (9999999=.) if year >= 1981 & year <= 1984 +recode v0601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode v0602 (9999999=.) if year >= 1981 & year <= 1984 +recode v0602 (999999999=.) if year >= 1985 & year <= 1990 + +replace v5010 =. if v5010>=9999999 + +/* CONVERTING NOMINAL VALUES TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1981 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1981: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (v0501 == 1 | v0501 == 2) & age >= minlaborage + replace lstatus = 2 if (v0501 == 3 | v0513 == 1) & age >= minlaborage + replace lstatus = 3 if (v0501 == 4 | v0501 == 5 | v0501 == 6 | v0501 == 7) & v0513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop v0513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = v0501 - 3 if v0501 >= 4 & v0501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop v0501 +* + +*<_unempldur_l_> + gen unempldur_l = v0516 if v0516 >= 0 & v0516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check; A: Don't worry about that + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4756 is V4756 + + */ + rename v5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(v0504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10)*100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(v0503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring v0503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0503 = "00`i'" if v0503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0503 = "0`i'" if v0503 == "`i'" + } + + + } + +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "." +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + */ + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename v0600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename v0508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename v0506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename v0511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = "" + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace v0601 = 0 if v0601 ==. + g v0600 = wage_no_compen + replace v0600 = 0 if v0600 ==. + + gen wage_no_compen_2 = v0601 - v0600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop v0600 v0601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace v5100 = 0 if v5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = v5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop v5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1983_PNAD/BRA_1983_PNAD_V01_M_V03_A_GLD/Programs/BRA_1983_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1983_PNAD/BRA_1983_PNAD_V01_M_V03_A_GLD/Programs/BRA_1983_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..7978b74a9 --- /dev/null +++ b/GLD/BRA/BRA_1983_PNAD/BRA_1983_PNAD_V01_M_V03_A_GLD/Programs/BRA_1983_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2443 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1983_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1983 +<_Study ID_> BRA_1983_PNAD_v01_M +<_Data collection from_> 09/1983 +<_Data collection to_> 09/1983 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 114,186 +<_Sample size (IND)_> 512,016 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Cruzeiro (Cr$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023-02-21 Correct whours +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear all + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1983" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1983 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\pnad1983.dta",clear + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + tab count [iweight = v9991] + + * 0 instances where HH weight is missing + count if v9991 == . + + egen tag = diff(v9981 v9991) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + + distinct id_dom id_pes, joint + + + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + +*/ + + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" + +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + rename id_dom hhid + label variable hhid "Household ID" + + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + + tostring id_pes, replace + cap drop __000000 __000001 __000002 __000003 __000004 + + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" //check +* + +*<_weight_> + +sum v9981, de + + rename v9981 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* drop v9981 +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +*<_urban_> + recode v0003 (5=0) + rename v0003 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + + + destring uf, replace + + recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + + +/* CENSUS AREA */ +rename v0005 census_area + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1981: contains "-1", which should be changed to missing (.) + + */ + + rename v0107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename v0805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename v0303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +gen relationcs = . +gen relationharm = . +gen marital = . + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab +cap drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab +cap drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = . +* recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty +* replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +cap drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + */ + gen school = (v0314 !=0) if v0314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode v0311 (3 = 0) (1 = 1) (9 = .) + rename v0311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = v0318 - 1 if v0318 >= 1 & v0318 < 9 + + replace educy =1 if v0314==1 & v0312==2 +replace educy =2 if v0314==1 & v0312==3 +replace educy =3 if v0314==1 & v0312==4 + +replace educy =4 if v0314==2 & v0312==1 +replace educy =5 if v0314==2 & v0312==2 +replace educy =6 if v0314==2 & v0312==3 +replace educy =7 if v0314==2 & v0312==4 + +replace educy =8 if v0314==3 & v0312==1 +replace educy =9 if v0314==3 & v0312==2 +replace educy =10 if v0314==3 & v0312==3 + +replace educy =0 if v0314==4 & v0312==1 +replace educy =1 if v0314==4 & v0312==2 +replace educy =2 if v0314==4 & v0312==3 +replace educy =3 if v0314==4 & v0312==4 +replace educy =4 if v0314==4 & v0312==5 +replace educy =5 if v0314==4 & v0312==6 +replace educy =6 if v0314==4 & v0312==7 +replace educy =7 if v0314==4 & v0312==8 + +replace educy =8 if v0314==5 & v0312==1 +replace educy =9 if v0314==5 & v0312==2 +replace educy =10 if v0314==5 & v0312==3 +replace educy =11 if v0314==5 & v0312==4 + +replace educy =11 if v0314==6 & v0312==1 +replace educy =12 if v0314==6 & v0312==2 +replace educy =13 if v0314==6 & v0312==3 +replace educy =14 if v0314==6 & v0312==4 +replace educy =15 if v0314==6 & v0312==5 +replace educy =16 if v0314==6 & v0312==6 + +replace educy =0 if v0314==7 + +replace educy =0 if v0314==8 + +replace educy =0 if v0314==9 & v0312==1 +replace educy =1 if v0314==9 & v0312==2 +replace educy =2 if v0314==9 & v0312==3 +replace educy =3 if v0314==9 & v0312==4 +replace educy =4 if v0314==9 & v0312==5 +replace educy =5 if v0314==9 & v0312==6 +replace educy =6 if v0314==9 & v0312==7 +replace educy =7 if v0314==9 & v0312==8 + +replace educy =8 if v0314==10 & v0312==1 +replace educy =9 if v0314==10 & v0312==2 +replace educy =10 if v0314==10 & v0312==3 + +replace educy =0 if v0314==11 & v0312==1 +replace educy =1 if v0314==11 & v0312==2 +replace educy =2 if v0314==11 & v0312==3 +replace educy =3 if v0314==11 & v0312==4 +replace educy =4 if v0314==11 & v0312==5 +replace educy =5 if v0314==11 & v0312==6 +replace educy =6 if v0314==11 & v0312==7 +replace educy =7 if v0314==11 & v0312==8 + +replace educy =8 if v0314==12 & v0312==1 +replace educy =9 if v0314==12 & v0312==2 +replace educy =10 if v0314==12 & v0312==3 + +replace educy =11 if v0314==14 + +replace educy =15 if v0314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if v0317==1 & v0315==1 +replace educy =2 if v0317==1 & v0315==2 +replace educy =3 if v0317==1 & v0315==3 +replace educy =4 if v0317==1 & v0315==4 +replace educy =4 if v0317==1 & v0315==5 + +replace educy =5 if v0317==2 & v0315==1 +replace educy =6 if v0317==2 & v0315==2 +replace educy =7 if v0317==2 & v0315==3 +replace educy =8 if v0317==2 & v0315==4 +replace educy =8 if v0317==2 & v0315==5 + +replace educy =9 if v0317==3 & v0315==1 +replace educy =10 if v0317==3 & v0315==2 +replace educy =11 if v0317==3 & v0315==3 +replace educy =11 if v0317==3 & v0315==4 + +replace educy =1 if v0317==4 & v0315==1 +replace educy =2 if v0317==4 & v0315==2 +replace educy =3 if v0317==4 & v0315==3 +replace educy =4 if v0317==4 & v0315==4 +replace educy =5 if v0317==4 & v0315==5 +replace educy =6 if v0317==4 & v0315==6 +replace educy =7 if v0317==4 & v0315==7 +replace educy =8 if v0317==4 & v0315==8 + +replace educy =9 if v0317==5 & v0315==1 +replace educy =10 if v0317==5 & v0315==2 +replace educy =11 if v0317==5 & v0315==3 +replace educy =11 if v0317==5 & v0315==4 + +replace educy =12 if v0317==6 & v0315==1 +replace educy =13 if v0317==6 & v0315==2 +replace educy =14 if v0317==6 & v0315==3 +replace educy =15 if v0317==6 & v0315==4 +replace educy =16 if v0317==6 & v0315==5 +replace educy =17 if v0317==6 & v0315==6 + +replace educy =17 if v0317==7 & v0315==2 +replace educy =18 if v0317==7 & v0315==3 +replace educy =19 if v0317==7 & v0315>=4 +replace educy =0 if v0312==0 & v0314==0 & v0315==0 & v0317==0 + + + recast float educy + label variable educy "Years of education" + drop v0312 v0315 v0317 v0318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (v0314 == 1 | v0314 == 2 | v0314 == 4 | v0314 == 7 | v0314 == 8 | v0314 == 9 | v0314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (v0314 == 14 | v0314 == 12 | v0314 == 10 | v0314 == 5 | v0314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (v0314 == 13 | v0314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1981 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode v0537 (9999999=.) if year >= 1981 & year <= 1984 +recode v0537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode v0538 (9999999=.) if year >= 1981 & year <= 1984 +recode v0538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode v0549 (9999999=.) if year >= 1981 & year <= 1984 +recode v0549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode v0550 (9999999=.) if year >= 1981 & year <= 1984 +recode v0550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode v0578 (9999999=.) if year >= 1981 & year <= 1984 +recode v0578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode v0579 (9999999=.) if year >= 1981 & year <= 1984 +recode v0579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode v0580 (9999999=.) if year >= 1981 & year <= 1984 +recode v0580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode v0581 (9999999=.) if year >= 1981 & year <= 1984 +recode v0581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode v0582 (9999999=.) if year >= 1981 & year <= 1984 +recode v0582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode v0600 (9999999=.) if year >= 1981 & year <= 1984 +recode v0600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode v0601 (9999999=.) if year >= 1981 & year <= 1984 +recode v0601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode v0602 (9999999=.) if year >= 1981 & year <= 1984 +recode v0602 (999999999=.) if year >= 1985 & year <= 1990 + +replace v5010 =. if v5010>=9999999 + +/* CONVERTING NOMINAL VALUES TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1981 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1981: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (v0501 == 1 | v0501 == 2) & age >= minlaborage + replace lstatus = 2 if (v0501 == 3 | v0513 == 1) & age >= minlaborage + replace lstatus = 3 if (v0501 == 4 | v0501 == 5 | v0501 == 6 | v0501 == 7) & v0513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop v0513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = v0501 - 3 if v0501 >= 4 & v0501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop v0501 +* + +*<_unempldur_l_> + gen unempldur_l = v0516 if v0516 >= 0 & v0516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check; A: Don't worry about that + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4756 is V4756 + + */ + rename v5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(v0504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(v0503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring v0503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0503 = "00`i'" if v0503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0503 = "0`i'" if v0503 == "`i'" + } + + + } + +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "." +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename v0600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename v0508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename v0506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename v0511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = . + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace v0601 = 0 if v0601 ==. + g v0600 = wage_no_compen + replace v0600 = 0 if v0600 ==. + + gen wage_no_compen_2 = v0601 - v0600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop v0600 v0601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace v5100 = 0 if v5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = v5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop v5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + + save "`path_output'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1984_PNAD/BRA_1984_PNAD_V01_M_V03_A_GLD/Programs/BRA_1984_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1984_PNAD/BRA_1984_PNAD_V01_M_V03_A_GLD/Programs/BRA_1984_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..768315ef3 --- /dev/null +++ b/GLD/BRA/BRA_1984_PNAD/BRA_1984_PNAD_V01_M_V03_A_GLD/Programs/BRA_1984_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2444 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1984_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1984 +<_Study ID_> BRA_1984_PNAD_v01_M +<_Data collection from_> 09/1984 +<_Data collection to_> 09/1984 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 116,409 +<_Sample size (IND)_> 514,866 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Cruzeiro (Cr$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023-02-21 Correct whours +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear all + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1984" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1984 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\pnad1984.dta",clear + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + tab count [iweight = v9991] + + * 0 instances where HH weight is missing + count if v9991 == . + + egen tag = diff(v9981 v9991) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + + distinct id_dom id_pes, joint + + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + +*/ + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" + +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + rename id_dom hhid + label variable hhid "Household ID" + + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + + tostring id_pes, replace + cap drop __000000 __000001 __000002 __000003 __000004 + + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" //check +* + +*<_weight_> + +sum v9991, de + + rename v9991 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* drop v9991 +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +*<_urban_> + recode v0003 (5=0) + rename v0003 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + + + destring uf, replace + + recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + +/* CENSUS AREA */ +rename v0005 census_area + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1981: contains "-1", which should be changed to missing (.) + + */ + + rename v0107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename v0805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename v0303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + + +gen relationcs = . +gen relationharm = . +gen marital = . + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab +cap drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab +cap drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = . +* recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty +* replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +cap drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + */ + gen school = (v0314 !=0) if v0314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode v0311 (3 = 0) (1 = 1) (9 = .) + rename v0311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = v0318 - 1 if v0318 >= 1 & v0318 < 9 + + replace educy =1 if v0314==1 & v0312==2 +replace educy =2 if v0314==1 & v0312==3 +replace educy =3 if v0314==1 & v0312==4 + +replace educy =4 if v0314==2 & v0312==1 +replace educy =5 if v0314==2 & v0312==2 +replace educy =6 if v0314==2 & v0312==3 +replace educy =7 if v0314==2 & v0312==4 + +replace educy =8 if v0314==3 & v0312==1 +replace educy =9 if v0314==3 & v0312==2 +replace educy =10 if v0314==3 & v0312==3 + +replace educy =0 if v0314==4 & v0312==1 +replace educy =1 if v0314==4 & v0312==2 +replace educy =2 if v0314==4 & v0312==3 +replace educy =3 if v0314==4 & v0312==4 +replace educy =4 if v0314==4 & v0312==5 +replace educy =5 if v0314==4 & v0312==6 +replace educy =6 if v0314==4 & v0312==7 +replace educy =7 if v0314==4 & v0312==8 + +replace educy =8 if v0314==5 & v0312==1 +replace educy =9 if v0314==5 & v0312==2 +replace educy =10 if v0314==5 & v0312==3 +replace educy =11 if v0314==5 & v0312==4 + +replace educy =11 if v0314==6 & v0312==1 +replace educy =12 if v0314==6 & v0312==2 +replace educy =13 if v0314==6 & v0312==3 +replace educy =14 if v0314==6 & v0312==4 +replace educy =15 if v0314==6 & v0312==5 +replace educy =16 if v0314==6 & v0312==6 + +replace educy =0 if v0314==7 + +replace educy =0 if v0314==8 + +replace educy =0 if v0314==9 & v0312==1 +replace educy =1 if v0314==9 & v0312==2 +replace educy =2 if v0314==9 & v0312==3 +replace educy =3 if v0314==9 & v0312==4 +replace educy =4 if v0314==9 & v0312==5 +replace educy =5 if v0314==9 & v0312==6 +replace educy =6 if v0314==9 & v0312==7 +replace educy =7 if v0314==9 & v0312==8 + +replace educy =8 if v0314==10 & v0312==1 +replace educy =9 if v0314==10 & v0312==2 +replace educy =10 if v0314==10 & v0312==3 + +replace educy =0 if v0314==11 & v0312==1 +replace educy =1 if v0314==11 & v0312==2 +replace educy =2 if v0314==11 & v0312==3 +replace educy =3 if v0314==11 & v0312==4 +replace educy =4 if v0314==11 & v0312==5 +replace educy =5 if v0314==11 & v0312==6 +replace educy =6 if v0314==11 & v0312==7 +replace educy =7 if v0314==11 & v0312==8 + +replace educy =8 if v0314==12 & v0312==1 +replace educy =9 if v0314==12 & v0312==2 +replace educy =10 if v0314==12 & v0312==3 + +replace educy =11 if v0314==14 + +replace educy =15 if v0314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if v0317==1 & v0315==1 +replace educy =2 if v0317==1 & v0315==2 +replace educy =3 if v0317==1 & v0315==3 +replace educy =4 if v0317==1 & v0315==4 +replace educy =4 if v0317==1 & v0315==5 + +replace educy =5 if v0317==2 & v0315==1 +replace educy =6 if v0317==2 & v0315==2 +replace educy =7 if v0317==2 & v0315==3 +replace educy =8 if v0317==2 & v0315==4 +replace educy =8 if v0317==2 & v0315==5 + +replace educy =9 if v0317==3 & v0315==1 +replace educy =10 if v0317==3 & v0315==2 +replace educy =11 if v0317==3 & v0315==3 +replace educy =11 if v0317==3 & v0315==4 + +replace educy =1 if v0317==4 & v0315==1 +replace educy =2 if v0317==4 & v0315==2 +replace educy =3 if v0317==4 & v0315==3 +replace educy =4 if v0317==4 & v0315==4 +replace educy =5 if v0317==4 & v0315==5 +replace educy =6 if v0317==4 & v0315==6 +replace educy =7 if v0317==4 & v0315==7 +replace educy =8 if v0317==4 & v0315==8 + +replace educy =9 if v0317==5 & v0315==1 +replace educy =10 if v0317==5 & v0315==2 +replace educy =11 if v0317==5 & v0315==3 +replace educy =11 if v0317==5 & v0315==4 + +replace educy =12 if v0317==6 & v0315==1 +replace educy =13 if v0317==6 & v0315==2 +replace educy =14 if v0317==6 & v0315==3 +replace educy =15 if v0317==6 & v0315==4 +replace educy =16 if v0317==6 & v0315==5 +replace educy =17 if v0317==6 & v0315==6 + +replace educy =17 if v0317==7 & v0315==2 +replace educy =18 if v0317==7 & v0315==3 +replace educy =19 if v0317==7 & v0315>=4 +replace educy =0 if v0312==0 & v0314==0 & v0315==0 & v0317==0 + + + recast float educy + label variable educy "Years of education" + drop v0312 v0315 v0317 v0318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (v0314 == 1 | v0314 == 2 | v0314 == 4 | v0314 == 7 | v0314 == 8 | v0314 == 9 | v0314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (v0314 == 14 | v0314 == 12 | v0314 == 10 | v0314 == 5 | v0314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (v0314 == 13 | v0314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1981 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode v0537 (9999999=.) if year >= 1981 & year <= 1984 +recode v0537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode v0538 (9999999=.) if year >= 1981 & year <= 1984 +recode v0538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode v0549 (9999999=.) if year >= 1981 & year <= 1984 +recode v0549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode v0550 (9999999=.) if year >= 1981 & year <= 1984 +recode v0550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode v0578 (9999999=.) if year >= 1981 & year <= 1984 +recode v0578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode v0579 (9999999=.) if year >= 1981 & year <= 1984 +recode v0579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode v0580 (9999999=.) if year >= 1981 & year <= 1984 +recode v0580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode v0581 (9999999=.) if year >= 1981 & year <= 1984 +recode v0581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode v0582 (9999999=.) if year >= 1981 & year <= 1984 +recode v0582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode v0600 (9999999=.) if year >= 1981 & year <= 1984 +recode v0600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode v0601 (9999999=.) if year >= 1981 & year <= 1984 +recode v0601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode v0602 (9999999=.) if year >= 1981 & year <= 1984 +recode v0602 (999999999=.) if year >= 1985 & year <= 1990 + +replace v5010 =. if v5010>=9999999 + +/* CONVERTING NOMINAL VALUES TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1981 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1981: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (v0501 == 1 | v0501 == 2) & age >= minlaborage + replace lstatus = 2 if (v0501 == 3 | v0513 == 1) & age >= minlaborage + replace lstatus = 3 if (v0501 == 4 | v0501 == 5 | v0501 == 6 | v0501 == 7) & v0513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop v0513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = v0501 - 3 if v0501 >= 4 & v0501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop v0501 +* + +*<_unempldur_l_> + gen unempldur_l = v0516 if v0516 >= 0 & v0516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check; A: Don't worry about that + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4756 is V4756 + + */ + rename v5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(v0504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(v0503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring v0503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0503 = "00`i'" if v0503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0503 = "0`i'" if v0503 == "`i'" + } + + + } + +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "." +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename v0600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename v0508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename v0506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename v0511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = . + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace v0601 = 0 if v0601 ==. + g v0600 = wage_no_compen + replace v0600 = 0 if v0600 ==. + + gen wage_no_compen_2 = v0601 - v0600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop v0600 v0601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace v5100 = 0 if v5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = v5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop v5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + +*<_% SAVE_> + + save "`path_output'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1985_PNAD/BRA_1985_PNAD_V01_M_V03_A_GLD/Programs/BRA_1985_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1985_PNAD/BRA_1985_PNAD_V01_M_V03_A_GLD/Programs/BRA_1985_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..d9a6797c7 --- /dev/null +++ b/GLD/BRA/BRA_1985_PNAD/BRA_1985_PNAD_V01_M_V03_A_GLD/Programs/BRA_1985_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2437 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1985_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1985 +<_Study ID_> BRA_1985_PNAD_v01_M +<_Data collection from_> 09/1985 +<_Data collection to_> 09/1985 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 119,651 +<_Sample size (IND)_> 523,632 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Cruzeiro (Cr$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023-02-21 Correct whours +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear all + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1985" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1985 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\pnad1985.dta",clear + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = v9991] + + * 0 instances where HH weight is missing + count if v9991 == . + + egen tag = diff(v9981 v9991) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + + distinct id_dom id_pes, joint + + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + + + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + +*/ + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" + +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + rename id_dom hhid + label variable hhid "Household ID" + + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + + tostring id_pes, replace + cap drop __000000 __000001 __000002 __000003 __000004 + + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" //check +* + +*<_weight_> + +sum v9981, de + + rename v9981 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* drop v9981 +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +*<_urban_> + recode v0003 (5=0) + rename v0003 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + + + destring uf, replace + + recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + +/* CENSUS AREA */ +rename v0005 census_area + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1981: contains "-1", which should be changed to missing (.) + + */ + + rename v0107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename v0805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename v0303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + + +gen relationcs = . +gen relationharm = . +gen marital = . + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab +cap drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab +cap drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = . +* recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty +* replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +cap drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + */ + gen school = (v0314 !=0) if v0314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode v0311 (3 = 0) (1 = 1) (9 = .) + rename v0311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = v0318 - 1 if v0318 >= 1 & v0318 < 9 + + replace educy =1 if v0314==1 & v0312==2 +replace educy =2 if v0314==1 & v0312==3 +replace educy =3 if v0314==1 & v0312==4 + +replace educy =4 if v0314==2 & v0312==1 +replace educy =5 if v0314==2 & v0312==2 +replace educy =6 if v0314==2 & v0312==3 +replace educy =7 if v0314==2 & v0312==4 + +replace educy =8 if v0314==3 & v0312==1 +replace educy =9 if v0314==3 & v0312==2 +replace educy =10 if v0314==3 & v0312==3 + +replace educy =0 if v0314==4 & v0312==1 +replace educy =1 if v0314==4 & v0312==2 +replace educy =2 if v0314==4 & v0312==3 +replace educy =3 if v0314==4 & v0312==4 +replace educy =4 if v0314==4 & v0312==5 +replace educy =5 if v0314==4 & v0312==6 +replace educy =6 if v0314==4 & v0312==7 +replace educy =7 if v0314==4 & v0312==8 + +replace educy =8 if v0314==5 & v0312==1 +replace educy =9 if v0314==5 & v0312==2 +replace educy =10 if v0314==5 & v0312==3 +replace educy =11 if v0314==5 & v0312==4 + +replace educy =11 if v0314==6 & v0312==1 +replace educy =12 if v0314==6 & v0312==2 +replace educy =13 if v0314==6 & v0312==3 +replace educy =14 if v0314==6 & v0312==4 +replace educy =15 if v0314==6 & v0312==5 +replace educy =16 if v0314==6 & v0312==6 + +replace educy =0 if v0314==7 + +replace educy =0 if v0314==8 + +replace educy =0 if v0314==9 & v0312==1 +replace educy =1 if v0314==9 & v0312==2 +replace educy =2 if v0314==9 & v0312==3 +replace educy =3 if v0314==9 & v0312==4 +replace educy =4 if v0314==9 & v0312==5 +replace educy =5 if v0314==9 & v0312==6 +replace educy =6 if v0314==9 & v0312==7 +replace educy =7 if v0314==9 & v0312==8 + +replace educy =8 if v0314==10 & v0312==1 +replace educy =9 if v0314==10 & v0312==2 +replace educy =10 if v0314==10 & v0312==3 + +replace educy =0 if v0314==11 & v0312==1 +replace educy =1 if v0314==11 & v0312==2 +replace educy =2 if v0314==11 & v0312==3 +replace educy =3 if v0314==11 & v0312==4 +replace educy =4 if v0314==11 & v0312==5 +replace educy =5 if v0314==11 & v0312==6 +replace educy =6 if v0314==11 & v0312==7 +replace educy =7 if v0314==11 & v0312==8 + +replace educy =8 if v0314==12 & v0312==1 +replace educy =9 if v0314==12 & v0312==2 +replace educy =10 if v0314==12 & v0312==3 + +replace educy =11 if v0314==14 + +replace educy =15 if v0314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if v0317==1 & v0315==1 +replace educy =2 if v0317==1 & v0315==2 +replace educy =3 if v0317==1 & v0315==3 +replace educy =4 if v0317==1 & v0315==4 +replace educy =4 if v0317==1 & v0315==5 + +replace educy =5 if v0317==2 & v0315==1 +replace educy =6 if v0317==2 & v0315==2 +replace educy =7 if v0317==2 & v0315==3 +replace educy =8 if v0317==2 & v0315==4 +replace educy =8 if v0317==2 & v0315==5 + +replace educy =9 if v0317==3 & v0315==1 +replace educy =10 if v0317==3 & v0315==2 +replace educy =11 if v0317==3 & v0315==3 +replace educy =11 if v0317==3 & v0315==4 + +replace educy =1 if v0317==4 & v0315==1 +replace educy =2 if v0317==4 & v0315==2 +replace educy =3 if v0317==4 & v0315==3 +replace educy =4 if v0317==4 & v0315==4 +replace educy =5 if v0317==4 & v0315==5 +replace educy =6 if v0317==4 & v0315==6 +replace educy =7 if v0317==4 & v0315==7 +replace educy =8 if v0317==4 & v0315==8 + +replace educy =9 if v0317==5 & v0315==1 +replace educy =10 if v0317==5 & v0315==2 +replace educy =11 if v0317==5 & v0315==3 +replace educy =11 if v0317==5 & v0315==4 + +replace educy =12 if v0317==6 & v0315==1 +replace educy =13 if v0317==6 & v0315==2 +replace educy =14 if v0317==6 & v0315==3 +replace educy =15 if v0317==6 & v0315==4 +replace educy =16 if v0317==6 & v0315==5 +replace educy =17 if v0317==6 & v0315==6 + +replace educy =17 if v0317==7 & v0315==2 +replace educy =18 if v0317==7 & v0315==3 +replace educy =19 if v0317==7 & v0315>=4 +replace educy =0 if v0312==0 & v0314==0 & v0315==0 & v0317==0 + + + recast float educy + label variable educy "Years of education" + drop v0312 v0315 v0317 v0318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (v0314 == 1 | v0314 == 2 | v0314 == 4 | v0314 == 7 | v0314 == 8 | v0314 == 9 | v0314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (v0314 == 14 | v0314 == 12 | v0314 == 10 | v0314 == 5 | v0314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (v0314 == 13 | v0314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1981 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode v0537 (9999999=.) if year >= 1981 & year <= 1984 +recode v0537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode v0538 (9999999=.) if year >= 1981 & year <= 1984 +recode v0538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode v0549 (9999999=.) if year >= 1981 & year <= 1984 +recode v0549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode v0550 (9999999=.) if year >= 1981 & year <= 1984 +recode v0550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode v0578 (9999999=.) if year >= 1981 & year <= 1984 +recode v0578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode v0579 (9999999=.) if year >= 1981 & year <= 1984 +recode v0579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode v0580 (9999999=.) if year >= 1981 & year <= 1984 +recode v0580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode v0581 (9999999=.) if year >= 1981 & year <= 1984 +recode v0581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode v0582 (9999999=.) if year >= 1981 & year <= 1984 +recode v0582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode v0600 (9999999=.) if year >= 1981 & year <= 1984 +recode v0600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode v0601 (9999999=.) if year >= 1981 & year <= 1984 +recode v0601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode v0602 (9999999=.) if year >= 1981 & year <= 1984 +recode v0602 (999999999=.) if year >= 1985 & year <= 1990 + +replace v5010 =. if v5010>=9999999 + +/* CONVERTING NOMINAL VALUES TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1981 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1981: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (v0501 == 1 | v0501 == 2) & age >= minlaborage + replace lstatus = 2 if (v0501 == 3 | v0513 == 1) & age >= minlaborage + replace lstatus = 3 if (v0501 == 4 | v0501 == 5 | v0501 == 6 | v0501 == 7) & v0513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop v0513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = v0501 - 3 if v0501 >= 4 & v0501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop v0501 +* + +*<_unempldur_l_> + gen unempldur_l = v0516 if v0516 >= 0 & v0516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check; A: Don't worry about that + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4756 is V4756 + + */ + rename v5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(v0504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(v0503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring v0503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0503 = "00`i'" if v0503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0503 = "0`i'" if v0503 == "`i'" + } + + + } + +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "." +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename v0600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename v0508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename v0506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename v0511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = . + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace v0601 = 0 if v0601 ==. + g v0600 = wage_no_compen + replace v0600 = 0 if v0600 ==. + + gen wage_no_compen_2 = v0601 - v0600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop v0600 v0601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace v5100 = 0 if v5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = v5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop v5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1986_PNAD/BRA_1986_PNAD_V01_M_V03_A_GLD/Programs/BRA_1986_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1986_PNAD/BRA_1986_PNAD_V01_M_V03_A_GLD/Programs/BRA_1986_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..9bc304aa5 --- /dev/null +++ b/GLD/BRA/BRA_1986_PNAD/BRA_1986_PNAD_V01_M_V03_A_GLD/Programs/BRA_1986_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2440 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1986_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1986 +<_Study ID_> BRA_1986_PNAD_v01_M +<_Data collection from_> 09/1986 +<_Data collection to_> 09/1986 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 65,446 +<_Sample size (IND)_> 289,783 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Cruzado (Cz$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023-02-21 Correct whours +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear all + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1986" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1986 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\pnad1986.dta",clear + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + tab count [iweight = v9991] + + * 0 instances where HH weight is missing + count if v9991 == . + + egen tag = diff(v9981 v9991) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + + distinct id_dom id_pes, joint + + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + +*/ + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" + +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + rename id_dom hhid + label variable hhid "Household ID" + + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + + tostring id_pes, replace + cap drop __000000 __000001 __000002 __000003 __000004 + + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" //check +* + +*<_weight_> + +sum v9981, de + + rename v9981 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* drop v9981 +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +*<_urban_> + recode v0003 (5=0) + rename v0003 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + + + destring uf, replace + + recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + +/* CENSUS AREA */ +rename v0005 census_area + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1981: contains "-1", which should be changed to missing (.) + + */ + + rename v0107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename v0805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename v0303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + + +gen relationcs = . +gen relationharm = . +gen marital = . + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab +cap drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab +cap drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = . +* recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty +* replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +cap drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + */ + gen school = (v0314 !=0) if v0314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode v0311 (3 = 0) (1 = 1) (9 = .) + rename v0311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = v0318 - 1 if v0318 >= 1 & v0318 < 9 + + replace educy =1 if v0314==1 & v0312==2 +replace educy =2 if v0314==1 & v0312==3 +replace educy =3 if v0314==1 & v0312==4 + +replace educy =4 if v0314==2 & v0312==1 +replace educy =5 if v0314==2 & v0312==2 +replace educy =6 if v0314==2 & v0312==3 +replace educy =7 if v0314==2 & v0312==4 + +replace educy =8 if v0314==3 & v0312==1 +replace educy =9 if v0314==3 & v0312==2 +replace educy =10 if v0314==3 & v0312==3 + +replace educy =0 if v0314==4 & v0312==1 +replace educy =1 if v0314==4 & v0312==2 +replace educy =2 if v0314==4 & v0312==3 +replace educy =3 if v0314==4 & v0312==4 +replace educy =4 if v0314==4 & v0312==5 +replace educy =5 if v0314==4 & v0312==6 +replace educy =6 if v0314==4 & v0312==7 +replace educy =7 if v0314==4 & v0312==8 + +replace educy =8 if v0314==5 & v0312==1 +replace educy =9 if v0314==5 & v0312==2 +replace educy =10 if v0314==5 & v0312==3 +replace educy =11 if v0314==5 & v0312==4 + +replace educy =11 if v0314==6 & v0312==1 +replace educy =12 if v0314==6 & v0312==2 +replace educy =13 if v0314==6 & v0312==3 +replace educy =14 if v0314==6 & v0312==4 +replace educy =15 if v0314==6 & v0312==5 +replace educy =16 if v0314==6 & v0312==6 + +replace educy =0 if v0314==7 + +replace educy =0 if v0314==8 + +replace educy =0 if v0314==9 & v0312==1 +replace educy =1 if v0314==9 & v0312==2 +replace educy =2 if v0314==9 & v0312==3 +replace educy =3 if v0314==9 & v0312==4 +replace educy =4 if v0314==9 & v0312==5 +replace educy =5 if v0314==9 & v0312==6 +replace educy =6 if v0314==9 & v0312==7 +replace educy =7 if v0314==9 & v0312==8 + +replace educy =8 if v0314==10 & v0312==1 +replace educy =9 if v0314==10 & v0312==2 +replace educy =10 if v0314==10 & v0312==3 + +replace educy =0 if v0314==11 & v0312==1 +replace educy =1 if v0314==11 & v0312==2 +replace educy =2 if v0314==11 & v0312==3 +replace educy =3 if v0314==11 & v0312==4 +replace educy =4 if v0314==11 & v0312==5 +replace educy =5 if v0314==11 & v0312==6 +replace educy =6 if v0314==11 & v0312==7 +replace educy =7 if v0314==11 & v0312==8 + +replace educy =8 if v0314==12 & v0312==1 +replace educy =9 if v0314==12 & v0312==2 +replace educy =10 if v0314==12 & v0312==3 + +replace educy =11 if v0314==14 + +replace educy =15 if v0314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if v0317==1 & v0315==1 +replace educy =2 if v0317==1 & v0315==2 +replace educy =3 if v0317==1 & v0315==3 +replace educy =4 if v0317==1 & v0315==4 +replace educy =4 if v0317==1 & v0315==5 + +replace educy =5 if v0317==2 & v0315==1 +replace educy =6 if v0317==2 & v0315==2 +replace educy =7 if v0317==2 & v0315==3 +replace educy =8 if v0317==2 & v0315==4 +replace educy =8 if v0317==2 & v0315==5 + +replace educy =9 if v0317==3 & v0315==1 +replace educy =10 if v0317==3 & v0315==2 +replace educy =11 if v0317==3 & v0315==3 +replace educy =11 if v0317==3 & v0315==4 + +replace educy =1 if v0317==4 & v0315==1 +replace educy =2 if v0317==4 & v0315==2 +replace educy =3 if v0317==4 & v0315==3 +replace educy =4 if v0317==4 & v0315==4 +replace educy =5 if v0317==4 & v0315==5 +replace educy =6 if v0317==4 & v0315==6 +replace educy =7 if v0317==4 & v0315==7 +replace educy =8 if v0317==4 & v0315==8 + +replace educy =9 if v0317==5 & v0315==1 +replace educy =10 if v0317==5 & v0315==2 +replace educy =11 if v0317==5 & v0315==3 +replace educy =11 if v0317==5 & v0315==4 + +replace educy =12 if v0317==6 & v0315==1 +replace educy =13 if v0317==6 & v0315==2 +replace educy =14 if v0317==6 & v0315==3 +replace educy =15 if v0317==6 & v0315==4 +replace educy =16 if v0317==6 & v0315==5 +replace educy =17 if v0317==6 & v0315==6 + +replace educy =17 if v0317==7 & v0315==2 +replace educy =18 if v0317==7 & v0315==3 +replace educy =19 if v0317==7 & v0315>=4 +replace educy =0 if v0312==0 & v0314==0 & v0315==0 & v0317==0 + + + recast float educy + label variable educy "Years of education" + drop v0312 v0315 v0317 v0318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (v0314 == 1 | v0314 == 2 | v0314 == 4 | v0314 == 7 | v0314 == 8 | v0314 == 9 | v0314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (v0314 == 14 | v0314 == 12 | v0314 == 10 | v0314 == 5 | v0314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (v0314 == 13 | v0314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1981 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode v0537 (9999999=.) if year >= 1981 & year <= 1984 +recode v0537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode v0538 (9999999=.) if year >= 1981 & year <= 1984 +recode v0538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode v0549 (9999999=.) if year >= 1981 & year <= 1984 +recode v0549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode v0550 (9999999=.) if year >= 1981 & year <= 1984 +recode v0550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode v0578 (9999999=.) if year >= 1981 & year <= 1984 +recode v0578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode v0579 (9999999=.) if year >= 1981 & year <= 1984 +recode v0579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode v0580 (9999999=.) if year >= 1981 & year <= 1984 +recode v0580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode v0581 (9999999=.) if year >= 1981 & year <= 1984 +recode v0581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode v0582 (9999999=.) if year >= 1981 & year <= 1984 +recode v0582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode v0600 (9999999=.) if year >= 1981 & year <= 1984 +recode v0600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode v0601 (9999999=.) if year >= 1981 & year <= 1984 +recode v0601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode v0602 (9999999=.) if year >= 1981 & year <= 1984 +recode v0602 (999999999=.) if year >= 1985 & year <= 1990 + +replace v5010 =. if v5010>=9999999 + +/* CONVERTING NOMINAL VALUES TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1981 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1981: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (v0501 == 1 | v0501 == 2) & age >= minlaborage + replace lstatus = 2 if (v0501 == 3 | v0513 == 1) & age >= minlaborage + replace lstatus = 3 if (v0501 == 4 | v0501 == 5 | v0501 == 6 | v0501 == 7) & v0513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop v0513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = v0501 - 3 if v0501 >= 4 & v0501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop v0501 +* + +*<_unempldur_l_> + gen unempldur_l = v0516 if v0516 >= 0 & v0516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check; A: Don't worry about that + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4756 is V4756 + + */ + rename v5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(v0504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(v0503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring v0503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0503 = "00`i'" if v0503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0503 = "0`i'" if v0503 == "`i'" + } + + + } + +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "." +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename v0600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename v0508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename v0506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename v0511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = . + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace v0601 = 0 if v0601 ==. + g v0600 = wage_no_compen + replace v0600 = 0 if v0600 ==. + + gen wage_no_compen_2 = v0601 - v0600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop v0600 v0601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace v5100 = 0 if v5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = v5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop v5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1987_PNAD/BRA_1987_PNAD_V01_M_V03_A_GLD/Programs/BRA_1987_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1987_PNAD/BRA_1987_PNAD_V01_M_V03_A_GLD/Programs/BRA_1987_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..18529b2fc --- /dev/null +++ b/GLD/BRA/BRA_1987_PNAD/BRA_1987_PNAD_V01_M_V03_A_GLD/Programs/BRA_1987_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2438 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1987_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1987 +<_Study ID_> BRA_1987_PNAD_v01_M +<_Data collection from_> 09/1987 +<_Data collection to_> 09/1987 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 68,739 +<_Sample size (IND)_> 299,704 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Cruzado (Cz$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023-02-21 Correct whours +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear all + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1987" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1987 + local digitos = substr("`year'", 3, 2) + + + use "`path_in_stata'\pnad1987.dta",clear + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + tab count [iweight = v9991] + + count if v9991 == . + + egen tag = diff(v9981 v9991) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + + distinct id_dom id_pes, joint + + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + +*/ + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" + +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + rename id_dom hhid + label variable hhid "Household ID" + + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + + tostring id_pes, replace + cap drop __000000 __000001 __000002 __000003 __000004 + + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" //check +* + +*<_weight_> + +sum v9981, de + + rename v9981 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* drop v9981 +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +*<_urban_> + recode v0003 (5=0) + rename v0003 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + + + destring uf, replace + + recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + +/* CENSUS AREA */ +rename v0005 census_area + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1981: contains "-1", which should be changed to missing (.) + + */ + + rename v0107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename v0805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename v0303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + + +gen relationcs = . +gen relationharm = . +gen marital = . + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab +cap drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab +cap drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = . +* recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty +* replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +cap drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + */ + gen school = (v0314 !=0) if v0314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode v0311 (3 = 0) (1 = 1) (9 = .) + rename v0311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = v0318 - 1 if v0318 >= 1 & v0318 < 9 + + replace educy =1 if v0314==1 & v0312==2 +replace educy =2 if v0314==1 & v0312==3 +replace educy =3 if v0314==1 & v0312==4 + +replace educy =4 if v0314==2 & v0312==1 +replace educy =5 if v0314==2 & v0312==2 +replace educy =6 if v0314==2 & v0312==3 +replace educy =7 if v0314==2 & v0312==4 + +replace educy =8 if v0314==3 & v0312==1 +replace educy =9 if v0314==3 & v0312==2 +replace educy =10 if v0314==3 & v0312==3 + +replace educy =0 if v0314==4 & v0312==1 +replace educy =1 if v0314==4 & v0312==2 +replace educy =2 if v0314==4 & v0312==3 +replace educy =3 if v0314==4 & v0312==4 +replace educy =4 if v0314==4 & v0312==5 +replace educy =5 if v0314==4 & v0312==6 +replace educy =6 if v0314==4 & v0312==7 +replace educy =7 if v0314==4 & v0312==8 + +replace educy =8 if v0314==5 & v0312==1 +replace educy =9 if v0314==5 & v0312==2 +replace educy =10 if v0314==5 & v0312==3 +replace educy =11 if v0314==5 & v0312==4 + +replace educy =11 if v0314==6 & v0312==1 +replace educy =12 if v0314==6 & v0312==2 +replace educy =13 if v0314==6 & v0312==3 +replace educy =14 if v0314==6 & v0312==4 +replace educy =15 if v0314==6 & v0312==5 +replace educy =16 if v0314==6 & v0312==6 + +replace educy =0 if v0314==7 + +replace educy =0 if v0314==8 + +replace educy =0 if v0314==9 & v0312==1 +replace educy =1 if v0314==9 & v0312==2 +replace educy =2 if v0314==9 & v0312==3 +replace educy =3 if v0314==9 & v0312==4 +replace educy =4 if v0314==9 & v0312==5 +replace educy =5 if v0314==9 & v0312==6 +replace educy =6 if v0314==9 & v0312==7 +replace educy =7 if v0314==9 & v0312==8 + +replace educy =8 if v0314==10 & v0312==1 +replace educy =9 if v0314==10 & v0312==2 +replace educy =10 if v0314==10 & v0312==3 + +replace educy =0 if v0314==11 & v0312==1 +replace educy =1 if v0314==11 & v0312==2 +replace educy =2 if v0314==11 & v0312==3 +replace educy =3 if v0314==11 & v0312==4 +replace educy =4 if v0314==11 & v0312==5 +replace educy =5 if v0314==11 & v0312==6 +replace educy =6 if v0314==11 & v0312==7 +replace educy =7 if v0314==11 & v0312==8 + +replace educy =8 if v0314==12 & v0312==1 +replace educy =9 if v0314==12 & v0312==2 +replace educy =10 if v0314==12 & v0312==3 + +replace educy =11 if v0314==14 + +replace educy =15 if v0314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if v0317==1 & v0315==1 +replace educy =2 if v0317==1 & v0315==2 +replace educy =3 if v0317==1 & v0315==3 +replace educy =4 if v0317==1 & v0315==4 +replace educy =4 if v0317==1 & v0315==5 + +replace educy =5 if v0317==2 & v0315==1 +replace educy =6 if v0317==2 & v0315==2 +replace educy =7 if v0317==2 & v0315==3 +replace educy =8 if v0317==2 & v0315==4 +replace educy =8 if v0317==2 & v0315==5 + +replace educy =9 if v0317==3 & v0315==1 +replace educy =10 if v0317==3 & v0315==2 +replace educy =11 if v0317==3 & v0315==3 +replace educy =11 if v0317==3 & v0315==4 + +replace educy =1 if v0317==4 & v0315==1 +replace educy =2 if v0317==4 & v0315==2 +replace educy =3 if v0317==4 & v0315==3 +replace educy =4 if v0317==4 & v0315==4 +replace educy =5 if v0317==4 & v0315==5 +replace educy =6 if v0317==4 & v0315==6 +replace educy =7 if v0317==4 & v0315==7 +replace educy =8 if v0317==4 & v0315==8 + +replace educy =9 if v0317==5 & v0315==1 +replace educy =10 if v0317==5 & v0315==2 +replace educy =11 if v0317==5 & v0315==3 +replace educy =11 if v0317==5 & v0315==4 + +replace educy =12 if v0317==6 & v0315==1 +replace educy =13 if v0317==6 & v0315==2 +replace educy =14 if v0317==6 & v0315==3 +replace educy =15 if v0317==6 & v0315==4 +replace educy =16 if v0317==6 & v0315==5 +replace educy =17 if v0317==6 & v0315==6 + +replace educy =17 if v0317==7 & v0315==2 +replace educy =18 if v0317==7 & v0315==3 +replace educy =19 if v0317==7 & v0315>=4 +replace educy =0 if v0312==0 & v0314==0 & v0315==0 & v0317==0 + + + recast float educy + label variable educy "Years of education" + drop v0312 v0315 v0317 v0318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (v0314 == 1 | v0314 == 2 | v0314 == 4 | v0314 == 7 | v0314 == 8 | v0314 == 9 | v0314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (v0314 == 14 | v0314 == 12 | v0314 == 10 | v0314 == 5 | v0314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (v0314 == 13 | v0314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1981 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode v0537 (9999999=.) if year >= 1981 & year <= 1984 +recode v0537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode v0538 (9999999=.) if year >= 1981 & year <= 1984 +recode v0538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode v0549 (9999999=.) if year >= 1981 & year <= 1984 +recode v0549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode v0550 (9999999=.) if year >= 1981 & year <= 1984 +recode v0550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode v0578 (9999999=.) if year >= 1981 & year <= 1984 +recode v0578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode v0579 (9999999=.) if year >= 1981 & year <= 1984 +recode v0579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode v0580 (9999999=.) if year >= 1981 & year <= 1984 +recode v0580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode v0581 (9999999=.) if year >= 1981 & year <= 1984 +recode v0581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode v0582 (9999999=.) if year >= 1981 & year <= 1984 +recode v0582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode v0600 (9999999=.) if year >= 1981 & year <= 1984 +recode v0600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode v0601 (9999999=.) if year >= 1981 & year <= 1984 +recode v0601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode v0602 (9999999=.) if year >= 1981 & year <= 1984 +recode v0602 (999999999=.) if year >= 1985 & year <= 1990 + +replace v5010 =. if v5010>=9999999 + +/* CONVERTING NOMINAL VALUES TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1981 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1981: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (v0501 == 1 | v0501 == 2) & age >= minlaborage + replace lstatus = 2 if (v0501 == 3 | v0513 == 1) & age >= minlaborage + replace lstatus = 3 if (v0501 == 4 | v0501 == 5 | v0501 == 6 | v0501 == 7) & v0513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop v0513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = v0501 - 3 if v0501 >= 4 & v0501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop v0501 +* + +*<_unempldur_l_> + gen unempldur_l = v0516 if v0516 >= 0 & v0516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check; A: Don't worry about that + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4756 is V4756 + + */ + rename v5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(v0504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(v0503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring v0503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0503 = "00`i'" if v0503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0503 = "0`i'" if v0503 == "`i'" + } + + + } + +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "." +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename v0600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename v0508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename v0506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename v0511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = . + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace v0601 = 0 if v0601 ==. + g v0600 = wage_no_compen + replace v0600 = 0 if v0600 ==. + + gen wage_no_compen_2 = v0601 - v0600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop v0600 v0601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace v5100 = 0 if v5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = v5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop v5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1988_PNAD/BRA_1988_PNAD_V01_M_V03_A_GLD/Programs/BRA_1988_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1988_PNAD/BRA_1988_PNAD_V01_M_V03_A_GLD/Programs/BRA_1988_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..27f4592ab --- /dev/null +++ b/GLD/BRA/BRA_1988_PNAD/BRA_1988_PNAD_V01_M_V03_A_GLD/Programs/BRA_1988_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2444 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1988_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1988 +<_Study ID_> BRA_1988_PNAD_v01_M +<_Data collection from_> 09/1988 +<_Data collection to_> 09/1988 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023-02-21 Correct whours +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear all + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1988" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1988 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + + use "`path_in_stata'\pnad1988.dta",clear + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = v9991] + + * 0 instances where HH weight is missing + count if v9991 == . + + * 259,054 cases family weight ≠ individual weight + egen tag = diff(v9981 v9991) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + + distinct id_dom id_pes, joint + + * 0 non-distinct household identifiers (never more than one duplicate) + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + +*/ + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" + +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + rename id_dom hhid + label variable hhid "Household ID" + + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + + tostring id_pes, replace + cap drop __000000 __000001 __000002 __000003 __000004 + + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" //check +* + +*<_weight_> + +sum v9981, de + + rename v9981 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* drop v9981 +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +*<_urban_> + recode v0003 (5=0) + rename v0003 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + + destring uf, replace + + recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + +/* CENSUS AREA */ +rename v0005 census_area + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1981: contains "-1", which should be changed to missing (.) + + */ + + rename v0107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename v0805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename v0303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + + +gen relationcs = . +gen relationharm = . +gen marital = . + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab +cap drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab +cap drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = . +* recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty +* replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +cap drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + */ + gen school = (v0314 !=0) if v0314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode v0311 (3 = 0) (1 = 1) (9 = .) + rename v0311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = v0318 - 1 if v0318 >= 1 & v0318 < 9 + + replace educy =1 if v0314==1 & v0312==2 +replace educy =2 if v0314==1 & v0312==3 +replace educy =3 if v0314==1 & v0312==4 + +replace educy =4 if v0314==2 & v0312==1 +replace educy =5 if v0314==2 & v0312==2 +replace educy =6 if v0314==2 & v0312==3 +replace educy =7 if v0314==2 & v0312==4 + +replace educy =8 if v0314==3 & v0312==1 +replace educy =9 if v0314==3 & v0312==2 +replace educy =10 if v0314==3 & v0312==3 + +replace educy =0 if v0314==4 & v0312==1 +replace educy =1 if v0314==4 & v0312==2 +replace educy =2 if v0314==4 & v0312==3 +replace educy =3 if v0314==4 & v0312==4 +replace educy =4 if v0314==4 & v0312==5 +replace educy =5 if v0314==4 & v0312==6 +replace educy =6 if v0314==4 & v0312==7 +replace educy =7 if v0314==4 & v0312==8 + +replace educy =8 if v0314==5 & v0312==1 +replace educy =9 if v0314==5 & v0312==2 +replace educy =10 if v0314==5 & v0312==3 +replace educy =11 if v0314==5 & v0312==4 + +replace educy =11 if v0314==6 & v0312==1 +replace educy =12 if v0314==6 & v0312==2 +replace educy =13 if v0314==6 & v0312==3 +replace educy =14 if v0314==6 & v0312==4 +replace educy =15 if v0314==6 & v0312==5 +replace educy =16 if v0314==6 & v0312==6 + +replace educy =0 if v0314==7 + +replace educy =0 if v0314==8 + +replace educy =0 if v0314==9 & v0312==1 +replace educy =1 if v0314==9 & v0312==2 +replace educy =2 if v0314==9 & v0312==3 +replace educy =3 if v0314==9 & v0312==4 +replace educy =4 if v0314==9 & v0312==5 +replace educy =5 if v0314==9 & v0312==6 +replace educy =6 if v0314==9 & v0312==7 +replace educy =7 if v0314==9 & v0312==8 + +replace educy =8 if v0314==10 & v0312==1 +replace educy =9 if v0314==10 & v0312==2 +replace educy =10 if v0314==10 & v0312==3 + +replace educy =0 if v0314==11 & v0312==1 +replace educy =1 if v0314==11 & v0312==2 +replace educy =2 if v0314==11 & v0312==3 +replace educy =3 if v0314==11 & v0312==4 +replace educy =4 if v0314==11 & v0312==5 +replace educy =5 if v0314==11 & v0312==6 +replace educy =6 if v0314==11 & v0312==7 +replace educy =7 if v0314==11 & v0312==8 + +replace educy =8 if v0314==12 & v0312==1 +replace educy =9 if v0314==12 & v0312==2 +replace educy =10 if v0314==12 & v0312==3 + +replace educy =11 if v0314==14 + +replace educy =15 if v0314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if v0317==1 & v0315==1 +replace educy =2 if v0317==1 & v0315==2 +replace educy =3 if v0317==1 & v0315==3 +replace educy =4 if v0317==1 & v0315==4 +replace educy =4 if v0317==1 & v0315==5 + +replace educy =5 if v0317==2 & v0315==1 +replace educy =6 if v0317==2 & v0315==2 +replace educy =7 if v0317==2 & v0315==3 +replace educy =8 if v0317==2 & v0315==4 +replace educy =8 if v0317==2 & v0315==5 + +replace educy =9 if v0317==3 & v0315==1 +replace educy =10 if v0317==3 & v0315==2 +replace educy =11 if v0317==3 & v0315==3 +replace educy =11 if v0317==3 & v0315==4 + +replace educy =1 if v0317==4 & v0315==1 +replace educy =2 if v0317==4 & v0315==2 +replace educy =3 if v0317==4 & v0315==3 +replace educy =4 if v0317==4 & v0315==4 +replace educy =5 if v0317==4 & v0315==5 +replace educy =6 if v0317==4 & v0315==6 +replace educy =7 if v0317==4 & v0315==7 +replace educy =8 if v0317==4 & v0315==8 + +replace educy =9 if v0317==5 & v0315==1 +replace educy =10 if v0317==5 & v0315==2 +replace educy =11 if v0317==5 & v0315==3 +replace educy =11 if v0317==5 & v0315==4 + +replace educy =12 if v0317==6 & v0315==1 +replace educy =13 if v0317==6 & v0315==2 +replace educy =14 if v0317==6 & v0315==3 +replace educy =15 if v0317==6 & v0315==4 +replace educy =16 if v0317==6 & v0315==5 +replace educy =17 if v0317==6 & v0315==6 + +replace educy =17 if v0317==7 & v0315==2 +replace educy =18 if v0317==7 & v0315==3 +replace educy =19 if v0317==7 & v0315>=4 +replace educy =0 if v0312==0 & v0314==0 & v0315==0 & v0317==0 + + + recast float educy + label variable educy "Years of education" + drop v0312 v0315 v0317 v0318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (v0314 == 1 | v0314 == 2 | v0314 == 4 | v0314 == 7 | v0314 == 8 | v0314 == 9 | v0314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (v0314 == 14 | v0314 == 12 | v0314 == 10 | v0314 == 5 | v0314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (v0314 == 13 | v0314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1981 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode v0537 (9999999=.) if year >= 1981 & year <= 1984 +recode v0537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode v0538 (9999999=.) if year >= 1981 & year <= 1984 +recode v0538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode v0549 (9999999=.) if year >= 1981 & year <= 1984 +recode v0549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode v0550 (9999999=.) if year >= 1981 & year <= 1984 +recode v0550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode v0578 (9999999=.) if year >= 1981 & year <= 1984 +recode v0578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode v0579 (9999999=.) if year >= 1981 & year <= 1984 +recode v0579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode v0580 (9999999=.) if year >= 1981 & year <= 1984 +recode v0580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode v0581 (9999999=.) if year >= 1981 & year <= 1984 +recode v0581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode v0582 (9999999=.) if year >= 1981 & year <= 1984 +recode v0582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode v0600 (9999999=.) if year >= 1981 & year <= 1984 +recode v0600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode v0601 (9999999=.) if year >= 1981 & year <= 1984 +recode v0601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode v0602 (9999999=.) if year >= 1981 & year <= 1984 +recode v0602 (999999999=.) if year >= 1985 & year <= 1990 + +replace v5010 =. if v5010>=9999999 + +/* CONVERTING NOMINAL VALUES TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1981 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1981: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (v0501 == 1 | v0501 == 2) & age >= minlaborage + replace lstatus = 2 if (v0501 == 3 | v0513 == 1) & age >= minlaborage + replace lstatus = 3 if (v0501 == 4 | v0501 == 5 | v0501 == 6 | v0501 == 7) & v0513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop v0513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = v0501 - 3 if v0501 >= 4 & v0501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop v0501 +* + +*<_unempldur_l_> + gen unempldur_l = v0516 if v0516 >= 0 & v0516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check; A: Don't worry about that + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4756 is V4756 + + */ + rename v5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(v0504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(v0503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring v0503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0503 = "00`i'" if v0503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0503 = "0`i'" if v0503 == "`i'" + } + + + } + +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename v0600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename v0508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename v0506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename v0511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = . + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace v0601 = 0 if v0601 ==. + g v0600 = wage_no_compen + replace v0600 = 0 if v0600 ==. + + gen wage_no_compen_2 = v0601 - v0600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop v0600 v0601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace v5100 = 0 if v5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = v5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop v5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + clear + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1989_PNAD/BRA_1989_PNAD_V01_M_V03_A_GLD/Programs/BRA_1989_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1989_PNAD/BRA_1989_PNAD_V01_M_V03_A_GLD/Programs/BRA_1989_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..fe9621022 --- /dev/null +++ b/GLD/BRA/BRA_1989_PNAD/BRA_1989_PNAD_V01_M_V03_A_GLD/Programs/BRA_1989_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2443 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1989_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1989 +<_Study ID_> BRA_1989_PNAD_v01_M +<_Data collection from_> 09/1989 +<_Data collection to_> 09/1989 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1989 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023-02-21 Correct whours +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear all + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1989" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1989 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\pnad1989.dta",clear + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = v9991] + + * 0 instances where HH weight is missing + count if v9991 == . + + * 259,054 cases family weight ≠ individual weight + egen tag = diff(v9981 v9991) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + + distinct id_dom id_pes, joint + + * 0 non-distinct household identifiers (never more than one duplicate) + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1989" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + +*/ + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" + +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + rename id_dom hhid + label variable hhid "Household ID" + + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + + tostring id_pes, replace + cap drop __000000 __000001 __000002 __000003 __000004 + + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" //check +* + +*<_weight_> + +sum v9981, de + + rename v9981 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* drop v9981 +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +*<_urban_> + recode v0003 (5=0) + rename v0003 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + + + destring uf, replace + + recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + +/* CENSUS AREA */ +rename v0005 census_area + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1989 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1981: contains "-1", which should be changed to missing (.) + + */ + + rename v0107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename v0805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename v0303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + + +gen relationcs = . +gen relationharm = . +gen marital = . + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab +cap drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab +cap drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = . +* recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty +* replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +cap drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + */ + gen school = (v0314 !=0) if v0314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode v0311 (3 = 0) (1 = 1) (9 = .) + rename v0311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = v0318 - 1 if v0318 >= 1 & v0318 < 9 + + replace educy =1 if v0314==1 & v0312==2 +replace educy =2 if v0314==1 & v0312==3 +replace educy =3 if v0314==1 & v0312==4 + +replace educy =4 if v0314==2 & v0312==1 +replace educy =5 if v0314==2 & v0312==2 +replace educy =6 if v0314==2 & v0312==3 +replace educy =7 if v0314==2 & v0312==4 + +replace educy =8 if v0314==3 & v0312==1 +replace educy =9 if v0314==3 & v0312==2 +replace educy =10 if v0314==3 & v0312==3 + +replace educy =0 if v0314==4 & v0312==1 +replace educy =1 if v0314==4 & v0312==2 +replace educy =2 if v0314==4 & v0312==3 +replace educy =3 if v0314==4 & v0312==4 +replace educy =4 if v0314==4 & v0312==5 +replace educy =5 if v0314==4 & v0312==6 +replace educy =6 if v0314==4 & v0312==7 +replace educy =7 if v0314==4 & v0312==8 + +replace educy =8 if v0314==5 & v0312==1 +replace educy =9 if v0314==5 & v0312==2 +replace educy =10 if v0314==5 & v0312==3 +replace educy =11 if v0314==5 & v0312==4 + +replace educy =11 if v0314==6 & v0312==1 +replace educy =12 if v0314==6 & v0312==2 +replace educy =13 if v0314==6 & v0312==3 +replace educy =14 if v0314==6 & v0312==4 +replace educy =15 if v0314==6 & v0312==5 +replace educy =16 if v0314==6 & v0312==6 + +replace educy =0 if v0314==7 + +replace educy =0 if v0314==8 + +replace educy =0 if v0314==9 & v0312==1 +replace educy =1 if v0314==9 & v0312==2 +replace educy =2 if v0314==9 & v0312==3 +replace educy =3 if v0314==9 & v0312==4 +replace educy =4 if v0314==9 & v0312==5 +replace educy =5 if v0314==9 & v0312==6 +replace educy =6 if v0314==9 & v0312==7 +replace educy =7 if v0314==9 & v0312==8 + +replace educy =8 if v0314==10 & v0312==1 +replace educy =9 if v0314==10 & v0312==2 +replace educy =10 if v0314==10 & v0312==3 + +replace educy =0 if v0314==11 & v0312==1 +replace educy =1 if v0314==11 & v0312==2 +replace educy =2 if v0314==11 & v0312==3 +replace educy =3 if v0314==11 & v0312==4 +replace educy =4 if v0314==11 & v0312==5 +replace educy =5 if v0314==11 & v0312==6 +replace educy =6 if v0314==11 & v0312==7 +replace educy =7 if v0314==11 & v0312==8 + +replace educy =8 if v0314==12 & v0312==1 +replace educy =9 if v0314==12 & v0312==2 +replace educy =10 if v0314==12 & v0312==3 + +replace educy =11 if v0314==14 + +replace educy =15 if v0314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if v0317==1 & v0315==1 +replace educy =2 if v0317==1 & v0315==2 +replace educy =3 if v0317==1 & v0315==3 +replace educy =4 if v0317==1 & v0315==4 +replace educy =4 if v0317==1 & v0315==5 + +replace educy =5 if v0317==2 & v0315==1 +replace educy =6 if v0317==2 & v0315==2 +replace educy =7 if v0317==2 & v0315==3 +replace educy =8 if v0317==2 & v0315==4 +replace educy =8 if v0317==2 & v0315==5 + +replace educy =9 if v0317==3 & v0315==1 +replace educy =10 if v0317==3 & v0315==2 +replace educy =11 if v0317==3 & v0315==3 +replace educy =11 if v0317==3 & v0315==4 + +replace educy =1 if v0317==4 & v0315==1 +replace educy =2 if v0317==4 & v0315==2 +replace educy =3 if v0317==4 & v0315==3 +replace educy =4 if v0317==4 & v0315==4 +replace educy =5 if v0317==4 & v0315==5 +replace educy =6 if v0317==4 & v0315==6 +replace educy =7 if v0317==4 & v0315==7 +replace educy =8 if v0317==4 & v0315==8 + +replace educy =9 if v0317==5 & v0315==1 +replace educy =10 if v0317==5 & v0315==2 +replace educy =11 if v0317==5 & v0315==3 +replace educy =11 if v0317==5 & v0315==4 + +replace educy =12 if v0317==6 & v0315==1 +replace educy =13 if v0317==6 & v0315==2 +replace educy =14 if v0317==6 & v0315==3 +replace educy =15 if v0317==6 & v0315==4 +replace educy =16 if v0317==6 & v0315==5 +replace educy =17 if v0317==6 & v0315==6 + +replace educy =17 if v0317==7 +replace educy =0 if v0312==0 & v0314==0 & v0315==0 & v0317==0 + + + recast float educy + label variable educy "Years of education" + drop v0312 v0315 v0317 v0318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (v0314 == 1 | v0314 == 2 | v0314 == 4 | v0314 == 7 | v0314 == 8 | v0314 == 9 | v0314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (v0314 == 14 | v0314 == 12 | v0314 == 10 | v0314 == 5 | v0314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (v0314 == 13 | v0314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + As of 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1981 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1981: "Pre-school" and "School" are considered separately + + 1981: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode v0537 (9999999=.) if year >= 1981 & year <= 1984 +recode v0537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode v0538 (9999999=.) if year >= 1981 & year <= 1984 +recode v0538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode v0549 (9999999=.) if year >= 1981 & year <= 1984 +recode v0549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode v0550 (9999999=.) if year >= 1981 & year <= 1984 +recode v0550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode v0578 (9999999=.) if year >= 1981 & year <= 1984 +recode v0578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode v0579 (9999999=.) if year >= 1981 & year <= 1984 +recode v0579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode v0580 (9999999=.) if year >= 1981 & year <= 1984 +recode v0580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode v0581 (9999999=.) if year >= 1981 & year <= 1984 +recode v0581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode v0582 (9999999=.) if year >= 1981 & year <= 1984 +recode v0582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode v0600 (9999999=.) if year >= 1981 & year <= 1984 +recode v0600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode v0601 (9999999=.) if year >= 1981 & year <= 1984 +recode v0601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode v0602 (9999999=.) if year >= 1981 & year <= 1984 +recode v0602 (999999999=.) if year >= 1985 & year <= 1990 + +replace v5010 =. if v5010>=9999999 + +/* CONVERTING NOMINAL VALUES TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1981 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1981: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (v0501 == 1 | v0501 == 2) & age >= minlaborage + replace lstatus = 2 if (v0501 == 3 | v0513 == 1) & age >= minlaborage + replace lstatus = 3 if (v0501 == 4 | v0501 == 5 | v0501 == 6 | v0501 == 7) & v0513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop v0513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = v0501 - 3 if v0501 >= 4 & v0501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop v0501 +* + +*<_unempldur_l_> + gen unempldur_l = v0516 if v0516 >= 0 & v0516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check; A: Don't worry about that + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4756 is V4756 + + */ + rename v5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(v0504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(v0503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring v0503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0503 = "00`i'" if v0503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0503 = "0`i'" if v0503 == "`i'" + } + + + } + +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "." +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename v0600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename v0508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename v0506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename v0511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = . + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace v0601 = 0 if v0601 ==. + g v0600 = wage_no_compen + replace v0600 = 0 if v0600 ==. + + gen wage_no_compen_2 = v0601 - v0600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop v0600 v0601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace v5100 = 0 if v5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = v5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop v5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + +* + + +*<_% COMPRESS_> + +compress + +* + + + +*<_% SAVE_> + + save "`path_output'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1990_PNAD/BRA_1990_PNAD_V01_M_V03_A_GLD/Programs/BRA_1990_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1990_PNAD/BRA_1990_PNAD_V01_M_V03_A_GLD/Programs/BRA_1990_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..196b978a0 --- /dev/null +++ b/GLD/BRA/BRA_1990_PNAD/BRA_1990_PNAD_V01_M_V03_A_GLD/Programs/BRA_1990_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2492 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1990_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1990 +<_Study ID_> BRA_1990_PNAD_V1_M +<_Data collection from_> 09/1990 +<_Data collection to_> 09/1990 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023-02-21 Correct whours +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1990" + local survey "PNAD" + local vermast "V01" + local veralt "V03" + + * From the definitions, set path chunks + local level_1 "`country'_`year'_`survey'" + local level_2_mast "`level_1'_`vermast'_M" + local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + + * From chunks, define path_in, path_output folder + local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" + local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" + local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + + * Define Output file name + local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1990 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'/individuals_1990.dta" + + keep if V100 == 3 + + preserve + + use "`path_in_stata'/households_1990.dta", clear + + keep if V100 == 1 + + tempfile hhs + + save `hhs', replace + + restore + + merge m:1 V102 V103 using `hhs', nogen keep(1 3) + + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + + egen id_dom = concat(V102 V103) + + bys id_dom: gen id_pes = _n + + lab var id_pes "Individual id" + + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = V3091] + + * 0 instances where HH weight is missing + count if V3091 == . + + * 259,054 cases family weight ≠ individual weight + egen tag = diff(V1091 V3091) + tab tag, missing + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + + distinct id_dom id_pes, joint + + * 0 non-distinct household identifiers (never more than one duplicate) + egen id_pnad = concat(id_dom id_pes) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + gen year = `year' + + + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS Version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V101 represents HH number + 1983 & 1990: doesn't exist + +*/ + +*<_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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + gen int_month = 9 + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V101 is hhid + 1983 & 1990: V101 doesn't exist; V102 & V103 do + 1992-2012: V102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + cap drop __000000 __000001 __000002 __000003 __000004 + tostring id_pes, replace + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> + +sum V1091, de + + rename V1091 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" // Check +* drop V9981 +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + + + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +*<_urban_> + recode V3 (5=0) + rename V3 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + +rename V10 uf + + destring uf, replace + + + +recode uf (11/14=33) (20/29=35) (30/31 37=41) (32=42) (33/35=43) /// +(41/42=31) (43=32) (51=21) (52=22) (53=23) (54=24) (55=25) /// +(56=26) (57=27) (58=28) (59/60=29) (61=53) (71=11) (72=12) /// +(73=13) (74=14) (75=15) (76=16) (81=50) (82=51) (83=52) + + + +/* CENSUS AREA */ +rename V5 census_area + + + + + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(uf), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(uf), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(uf), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(uf), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(uf), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + + gen subnatid2 = uf + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + area_censit: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if uf == 15 & census_area == 1 + replace subnatid3 = 2 if uf == 23 & census_area == 1 + replace subnatid3 = 3 if uf == 26 & census_area == 1 + replace subnatid3 = 4 if uf == 29 & census_area == 1 + replace subnatid3 = 5 if uf == 31 & census_area == 1 + replace subnatid3 = 6 if uf == 33 & census_area == 1 + replace subnatid3 = 7 if uf == 35 & census_area == 1 + replace subnatid3 = 8 if uf == 41 & census_area == 1 + replace subnatid3 = 9 if uf == 43 & census_area == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop uf census_area +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + + + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1990: contains "-1", which should be changed to missing (.) + + */ + + rename V107 hsize + label variable hsize "Household size" + + replace hsize = . if hsize == -1 +* + +/* DATE OF BIRTH */ +* Year of birth reports age when age is assumed. +* Replacing with missing. +recode V310 (0/98=.) if V309 == 20 | V309 == 30 + +* In some cases, year of birth and age are interchanged. +gen x1 = V310 if V310 < 800 +gen x2 = V805 if V805 > 800 +replace V310 = x2 if x1 ~= . +replace V805 = x1 if x2 ~= . +drop x1 x2 +recode V310 (999=.) + +* Adding the 1 in the year of birth +* People of presumed age do not have year of birth +gene x1 = 1 +egen birth_year = concat(x1 V310) if V310 ~= . +drop x1 V310 +destring birth_year, replace +label var birth_year "year of birth" + +recode V308 (0 99=.) +rename V308 birth_day +* 0 (zero) would be presumed age, 99 without declaration + +recode V309 (20 30 99 =.) +rename V309 birth_month +* 20 and 30 would be presumed age, 99 without declaration + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V805 age + sum age, de + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V303 male + recode male (1 = 1) (3 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + + +gen relationcs = . +gen relationharm = . +gen marital = . + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values eye_dsablty eye_dsablty_lab +cap drop v6501 +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "Cannot do at all" 9 "No Information" + label values hear_dsablty hear_dsablty_lab +cap drop v6511 +* + +*<_walk_dsablty_> + gen walk_dsablty = . +* recode walk_dsablty (6 = 4) (. = 1) + recast byte walk_dsablty +* replace walk_dsablty = 3 if v6561 == 7 + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +cap drop v6551 +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + + + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1990: "Pre-school" and "School" are considered separately + + */ + gen school = (V314 !=0) if V314 !=. + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V311 (3 = 0) (1 = 1) (9 = .) + rename V311 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V318 - 1 if V318 >= 1 & V318 < 9 + + replace educy =1 if V314==1 & V312==2 +replace educy =2 if V314==1 & V312==3 +replace educy =3 if V314==1 & V312==4 + +replace educy =4 if V314==2 & V312==1 +replace educy =5 if V314==2 & V312==2 +replace educy =6 if V314==2 & V312==3 +replace educy =7 if V314==2 & V312==4 + +replace educy =8 if V314==3 & V312==1 +replace educy =9 if V314==3 & V312==2 +replace educy =10 if V314==3 & V312==3 + +replace educy =0 if V314==4 & V312==1 +replace educy =1 if V314==4 & V312==2 +replace educy =2 if V314==4 & V312==3 +replace educy =3 if V314==4 & V312==4 +replace educy =4 if V314==4 & V312==5 +replace educy =5 if V314==4 & V312==6 +replace educy =6 if V314==4 & V312==7 +replace educy =7 if V314==4 & V312==8 + +replace educy =8 if V314==5 & V312==1 +replace educy =9 if V314==5 & V312==2 +replace educy =10 if V314==5 & V312==3 +replace educy =11 if V314==5 & V312==4 + +replace educy =11 if V314==6 & V312==1 +replace educy =12 if V314==6 & V312==2 +replace educy =13 if V314==6 & V312==3 +replace educy =14 if V314==6 & V312==4 +replace educy =15 if V314==6 & V312==5 +replace educy =16 if V314==6 & V312==6 + +replace educy =0 if V314==7 + +replace educy =0 if V314==8 + +replace educy =0 if V314==9 & V312==1 +replace educy =1 if V314==9 & V312==2 +replace educy =2 if V314==9 & V312==3 +replace educy =3 if V314==9 & V312==4 +replace educy =4 if V314==9 & V312==5 +replace educy =5 if V314==9 & V312==6 +replace educy =6 if V314==9 & V312==7 +replace educy =7 if V314==9 & V312==8 + +replace educy =8 if V314==10 & V312==1 +replace educy =9 if V314==10 & V312==2 +replace educy =10 if V314==10 & V312==3 + +replace educy =0 if V314==11 & V312==1 +replace educy =1 if V314==11 & V312==2 +replace educy =2 if V314==11 & V312==3 +replace educy =3 if V314==11 & V312==4 +replace educy =4 if V314==11 & V312==5 +replace educy =5 if V314==11 & V312==6 +replace educy =6 if V314==11 & V312==7 +replace educy =7 if V314==11 & V312==8 + +replace educy =8 if V314==12 & V312==1 +replace educy =9 if V314==12 & V312==2 +replace educy =10 if V314==12 & V312==3 + +replace educy =11 if V314==14 + +replace educy =15 if V314==15 + +/* pessoas que não freqüentam */ +replace educy =1 if V317==1 & V315==1 +replace educy =2 if V317==1 & V315==2 +replace educy =3 if V317==1 & V315==3 +replace educy =4 if V317==1 & V315==4 +replace educy =4 if V317==1 & V315==5 + +replace educy =5 if V317==2 & V315==1 +replace educy =6 if V317==2 & V315==2 +replace educy =7 if V317==2 & V315==3 +replace educy =8 if V317==2 & V315==4 +replace educy =8 if V317==2 & V315==5 + +replace educy =9 if V317==3 & V315==1 +replace educy =10 if V317==3 & V315==2 +replace educy =11 if V317==3 & V315==3 +replace educy =11 if V317==3 & V315==4 + +replace educy =1 if V317==4 & V315==1 +replace educy =2 if V317==4 & V315==2 +replace educy =3 if V317==4 & V315==3 +replace educy =4 if V317==4 & V315==4 +replace educy =5 if V317==4 & V315==5 +replace educy =6 if V317==4 & V315==6 +replace educy =7 if V317==4 & V315==7 +replace educy =8 if V317==4 & V315==8 + +replace educy =9 if V317==5 & V315==1 +replace educy =10 if V317==5 & V315==2 +replace educy =11 if V317==5 & V315==3 +replace educy =11 if V317==5 & V315==4 + +replace educy =12 if V317==6 & V315==1 +replace educy =13 if V317==6 & V315==2 +replace educy =14 if V317==6 & V315==3 +replace educy =15 if V317==6 & V315==4 +replace educy =16 if V317==6 & V315==5 +replace educy =17 if V317==6 & V315==6 + +replace educy =17 if V317==7 & V315==2 +replace educy =18 if V317==7 & V315==3 +replace educy =19 if V317==7 & V315>=4 +replace educy =0 if V312==0 & V314==0 & V315==0 & V317==0 + + + recast float educy + label variable educy "Years of education" + drop V312 V315 V317 V318 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1990: "Pre-school" and "School" are considered separately + + As of 1990: "Classe de alfabetização" category is added + 1990 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V314 == 1 | V314 == 2 | V314 == 4 | V314 == 7 | V314 == 8 | V314 == 9 | V314 == 11) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V314 == 14 | V314 == 12 | V314 == 10 | V314 == 5 | V314 == 3) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V314 == 13 | V314 == 6) + + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1990: "Pre-school" and "School" are considered separately + + As of 1990: "Classe de alfabetização" category is added + 1990 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1990: "Pre-school" and "School" are considered separately + + As of 1990: "Classe de alfabetização" category is added + 1990 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1990 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1990: "Pre-school" and "School" are considered separately + + 1990: "Classe de alfabetização" category is added + 1990 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + + + +*<_vocational_> + gen Vocational = . + recast byte Vocational + label variable Vocational "Ever received Vocational training" + label define Vocational_lab 0 "No" 1 "Yes" + label values Vocational Vocational_lab +* + +*<_vocational_type_> + gen Vocational_type = . + recast byte Vocational_type + label variable Vocational_type "Type of Vocational training" + label define Vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values Vocational_type Vocational_type_lab +* + +*<_vocational_length_l_> + gen Vocational_length_l = . + recast float Vocational_length_l + label variable Vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen Vocational_length_u = . + recast float Vocational_length_u + label variable Vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen Vocational_field = . + label variable Vocational_field "Field of training" +* + +*<_vocational_financed_> + gen Vocational_financed = . + recast byte Vocational_financed + label variable Vocational_financed "How training was financed" + label define Vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values Vocational_financed Vocational_financed_lab +* + + + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + +/* <__note> + + Correcting Missings + + */ +/* INCOME */ + +/* RECODE: MONTHLY INCOME IN CASH */ +recode V537 (9999999=.) if year >= 1990 & year <= 1984 +recode V537 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS */ +recode V538 (9999999=.) if year >= 1990 & year <= 1984 +recode V538 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN CASH OTHER */ +recode V549 (9999999=.) if year >= 1990 & year <= 1984 +recode V549 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME IN PRODUCTS/GOODS OTHER */ +recode V550 (9999999=.) if year >= 1990 & year <= 1984 +recode V550 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RETIREMENT PENSIONS */ +recode V578 (9999999=.) if year >= 1990 & year <= 1984 +recode V578 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHER PENSIONS */ +recode V579 (9999999=.) if year >= 1990 & year <= 1984 +recode V579 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: PERMANENT ALLOWANCE */ +recode V580 (9999999=.) if year >= 1990 & year <= 1984 +recode V580 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: RENTAL AMOUNT RECEIVED */ +recode V581 (9999999=.) if year >= 1990 & year <= 1984 +recode V581 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: OTHERS */ +recode V582 (9999999=.) if year >= 1990 & year <= 1984 +recode V582 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME MAIN OCCUPATION */ +recode V600 (9999999=.) if year >= 1990 & year <= 1984 +recode V600 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL JOBS */ +recode V601 (9999999=.) if year >= 1990 & year <= 1984 +recode V601 (999999999=.) if year >= 1985 & year <= 1990 + +/* RECODE: MONTHLY INCOME ALL SOURCES */ +recode V602 (9999999=.) if year >= 1990 & year <= 1984 +recode V602 (999999999=.) if year >= 1985 & year <= 1990 + +replace V5010 =. if V5010>=9999999 + +/* CONVERTING NOMINAL valueS TO REAIS (MONETARY UNIT) */ +/* AND DEFLATIONING (OCT/2012) */ +gen double deflator = 0.807544/100000 if year == 1990 +format deflator %26.25f +replace deflator = 0.269888/1000000 if year == 1989 +replace deflator = 0.196307/10000000 if year == 1988 +replace deflator = 0.241162/100000000 if year == 1987 +replace deflator = 0.602708/1000000000 if year == 1986 +replace deflator = 0.304402/1000000000 if year == 1985 +replace deflator = 0.962506/10000000000 if year == 1984 +replace deflator = 0.330205/10000000000 if year == 1983 +replace deflator = 0.133929/10000000000 if year == 1982 +replace deflator = 0.636330/100000000000 if year == 1990 + +label var deflator "deflator - price level: Oct/2012" + +gen double converter = 2750000 if year >= 1989 +replace converter = 2750000000 if year >= 1986 & year <= 1988 +replace converter = 2750000000000 if year <= 1985 + +label var converter "currency converter" + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1990: 10 <- It is not 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1990: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if (V501 == 1 | V501 == 2) & age >= minlaborage + replace lstatus = 2 if (V501 == 3 | V513 == 1) & age >= minlaborage + replace lstatus = 3 if (V501 == 4 | V501 == 5 | V501 == 6 | V501 == 7) & V513 == 3 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V513 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = V501 - 3 if V501 >= 4 & V501 <= 7 + recode nlfreason (4 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab + drop V501 +* + +*<_unempldur_l_> + gen unempldur_l = V516 if V516 >= 0 & V516 <= 24 + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l // Check + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1990: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1990: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1990: V4756 is V4756 + + */ + rename V5050 empstat + recode empstat (1 = 1) (2 = 4) (3 = 3) (4 = 2) (5 = 5) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V504, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + tostring V504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace V504 = "00`i'" if V504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace V504 = "0`i'" if V504 == "`i'" + } + + + } + + gen v0504 = V504 + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + drop _merge V504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4756 is V4756 + + */ + gen str4 occup_orig = string(V503, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ +tostring V503, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace V503 = "00`i'" if V503 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace V503 = "0`i'" if V503 == "`i'" + } + + + } + + gen v0503 = V503 +merge m:1 v0503 using "`path_in_stata'\isco_88_cbo_80_DD.dta" +drop if _merge == 2 +gen occup_isco = isco_88+"00" +replace occup_isco = "0100" if occup_isco == "100" +label variable occup_isco "ISCO code of primary job 7 day recall" +drop _merge +replace occup_isco = "" if occup_isco == "." +replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + + gen ocusec = . + + + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab + +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V600 wage_no_compen // Check; A: Total Labor Income + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V508 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V506 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 * check; A: Ignore that + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V511 socialsec // [1981: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + +// check; A: Everything should be missing on _2 + + gen empstat_2 = . + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = "" + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + + gen cnae_91 = industry_orig_2 + gen industrycat_isic_2 = . + cap label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + + /* +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_2 +cap drop _merge cnae_91 +cap replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* +*/ +*<_industrycat10_2_> + gen industrycat10_2 =. + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = "" + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + gen occup_isco_2 = . + /* +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_2 +cap drop _merge cbo_91 +*/ +cap label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + +cap replace occup_isco_2 = "" if occup_isco_2 == "" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2 = . + *recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + replace V601 = 0 if V601 ==. + g V600 = wage_no_compen + replace V600 = 0 if V600 ==. + + gen wage_no_compen_2 = V601 - V600 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" + drop V600 V601 +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + replace V5100 = 0 if V5100 ==. + gen hours_aux = whours + replace hours_aux = 0 if hours_aux ==. + gen whours_2 = V5100-hours_aux + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" + drop V5100 hours_aux +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* + + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_> + gen t_hours_others = . + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" +* drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 +* replace V1022 = . if V1022 > 999000000000 +* format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ +* replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 +* replace V1025 = . if V1025 > 999000000000 +* format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* drop V1025 +* + + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist +* check; A: Ignore that + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* drop V4769 +* + + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1981: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1981: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1981: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1981: V4765 is V4765 + + */ + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + label variable industry_orig_year "Original survey industry code, main job 12 month recall" +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ +gen industrycat_isic_year = . +cap label variable industrycat_isic_year "ISIC code of primary job 12 month recall" +/* + gen cnae_91 = industry_orig_year +cap merge m:1 cnae_91 using "`path_in_stata'\isic_3_cnae_91.dta" +cap drop if _merge==2 +cap rename isic_3 industrycat_isic_year +cap drop _merge cnae_91 +cap replace industrycat_isic_year = "" if industrycat_isic_year == "" +* +*/ +*<_industrycat10_year_> + gen industrycat10_year = . + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1981: V4765 is V4765 + + */ + gen occup_orig_year = . + label variable occup_orig_year "Original occupation record primary job 12 month recall" +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ +gen occup_isco_year =. +label variable occup_isco_year "ISCO code of secondary job 12 month recall" +/* + gen cbo_91 = occup_orig_year +cap merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91.dta" +cap drop if _merge == 2 +cap rename isco_88 occup_isco_year +cap drop _merge cbo_91 +cap replace occup_isco_year = "" if occup_isco_year == "" +* +*/ +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1981: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + + + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + *label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* + + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* + + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + gen njobs = 1 if whours_2 != . + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + clear + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1992_PNAD/BRA_1992_PNAD_V01_M_V02_A_GLD/Programs/BRA_1992_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_1992_PNAD/BRA_1992_PNAD_V01_M_V02_A_GLD/Programs/BRA_1992_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..f45b173c6 --- /dev/null +++ b/GLD/BRA/BRA_1992_PNAD/BRA_1992_PNAD_V01_M_V02_A_GLD/Programs/BRA_1992_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2638 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1992_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1992 +<_Study ID_> BRA_1992_PNAD_v01_M +<_Data collection from_> 09/1992 +<_Data collection to_> 09/1992 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1992" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + local year = 1992 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'/individuals_1992.dta" + + + preserve + + use "`path_in_stata'/households_1992.dta", clear + + + tempfile hhs + + save `hhs', replace + + restore + + merge m:1 UF CONTROL V0103 using `hhs', nogen keep(1 3) + + + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +tostring CONTROL, replace format(%05.0f) force + +tostring V0103, replace format(%02.0f) force + +egen id_dom = concat(UF CONTROL V0103) + + sort id_dom + + lab var id_dom "Household id" + + rename V0301 id_pes + + lab var id_pes "Individual id" + +bys id_dom: egen n_ind_1 = max(id_pes) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pes = id_pes2 if n_ind_same != 0 + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = V4729] + + * 0 instances where HH weight is missing + count if V4729 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + + distinct id_dom id_pes, joint + + * 0 non-distinct household identifiers (never more than one duplicate) + egen id_pnad = concat(id_dom id_pes), format(%24.2g) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + sort dup id_pnad + + gen year = `year' + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_1992" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + + label variable 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 variable harmonization "Type of harmonization" +* + + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-1992: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* + +*<_psu_> + gen psu = . +* tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> +* rename V4602 strata +* tostring strata, replace +* label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ +/* A. RIGHT STATES CODE */ +* ADD TOCANTINS WITH GOIÁS + +/* A.1 IN VARIABLE UF AND CREATE VARIABLE OF REGION */ +destring UF, replace +recode UF (17=52) +gen region = int(UF/10) +label var region "region" +tostring UF, replace + + +/* B. CONTROL AND SERIAL NUMBER */ +drop CONTROL V0103 + +/* C. RECODE AND RENAME OF VARIABLES */ + + +/* C.2 CENSITRY AREA */ +rename V4107 area_censit + +/* C.3 RECODE: WEIGHTS */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode weight (-1=.) + +/* C.4 RECODE: TOTAL PEOPLE, TOTAL PEOPLE 10 YEARS OR MORE AND 5 YEARS OR MORE */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode V0105 (-1=.) +recode V0106 (-1=.) +* IN THE YEAR 2001 THERE IS NO TOTAL varIABLE OF PEOPLE 10 YEARS OR MORE, +* BUT TOTAL PEOPLE 5 YEARS OR MORE +replace V0106 = . if year==2001 + +rename V0105 tot_pess +rename V0106 tot_pess_10_more + +/* C.5 RENAME: TYPE OF DOMICILE */ +rename V0201 species_dom + +/* C.6 RENAME: HOUSEHOLD TYPE */ +rename V0202 type_dom + +/* C.7 RECODE: WALL */ +recode V0203 (6=5) (9=.) +rename V0203 wall + +/* C.8 RECODE: COVERAGE */ +recode V0204 (7=6) (9=.) +rename V0204 coverage + +/* C.9 DUMMY: WATER SUPPLY */ +recode V0212 (2=1) (4 6=0) (9=.) +rename V0212 water_rede +replace water_rede = 1 if V0213==1 +replace water_rede = 0 if V0213==3 +label var water_rede "water comes from the network" + +/* C.10 RECODE: SEWER */ +recode V0217 (1=0) (3=2) (5 7=6) (9=.) +rename V0217 sewer +* sewer = 0 general network +* = 2 septic tank +* = 4 rudimentary pit +* = 6 other + +/* C.11 TOILET */ + +* C.11.1 DUMMY: THERE IS A TOILET +recode V0215 (3=0) (9=.) +rename V0215 sanit +label var sanit "has toilet" + +/* C.11.2 DUMMY: EXCLUSIVE TOILET */ +recode V0216 (2=1) (4=0) (9=.) +rename V0216 sanit_excl +label var sanit_excl "domicile sanit excl" + +/* C.12 DUMMY: GARBAGE */ +recode V0218 (2=1) (3/6=0) (9=.) +rename V0218 garbage +label var garbage "garbage is collected" + +/* C.13 DUMMY: ELECTRIC LIGHTING */ +recode V0219 (3 5=0) (9=.) +rename V0219 ilum_eletr +label var ilum_eletr "has electric ilum" + +/* C.14 RECODE: NUMBER OF ROOMS AND DORMITORIES */ +recode V0205 (-1 99=.) +rename V0205 comodos +recode V0206 (-1 99=.) +rename V0206 dormit + +/* C.15 DUMMY: OCCUPANCY CONDITION */ +recode V0207 (2 = 1) (3/6 = 0) (9 = .), gen(possession_dom) +label var possession_dom "domicile possession" +drop V0207 + +/* C.16 RENTAL VALUE / INSTALLMENT */ +recode V0208 V0209 (-1=.) +recode V0208 V0209 (99999999/max=.) +rename V0208 rent +rename V0209 installment + +/* C.17 DUMMY: FILTER */ +recode V0224 (2=1) (4=0) (9=.) +rename V0224 filter + +/* C.18 DUMMY: STOVE */ +recode V0221 (3=0) (9=.) +recode V0222 (2=1) (4=0) (9=.) +gen stove = 1 if V0221 == 1 | V0222 == 1 +replace stove = 0 if V0221 == 0 & V0222 == 0 +replace stove = . if V0221 == . & V0222 == . +label var stove "has stove" +drop V0221 V0222 + +/* C.19 DUMMY: REFRIGERATOR */ +recode V0228 (2 4=1) (6=0) (9=.) +rename V0228 refrigerator + +/* C.20 DUMMY: RADIO */ +recode V0225 (3=0) (9=.) +rename V0225 radio + +/* C.21 DUMMY: TELEVISION */ +recode V0226 (2=1) (4=0) (9=.) +recode V0227 (3=0) (9=.) +gen tv = 1 if V0226 == 1 | V0227 == 1 +replace tv = 0 if V0226 == 0 & V0227 == 0 +replace tv = . if V0226 == . & V0227 == . +label var tv "has television" +drop V0226 V0227 +{ + +*<_urban_> + recode V4105 (1 2 3=1) (4 5 6 7 8=0) + rename V4105 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr((UF), 1, 1) == "1" + replace subnatid1 = 2 if substr((UF), 1, 1) == "2" + replace subnatid1 = 3 if substr((UF), 1, 1) == "3" + replace subnatid1 = 4 if substr((UF), 1, 1) == "4" + replace subnatid1 = 5 if substr((UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ +destring UF, replace + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & area_censit == 1 + replace subnatid3 = 2 if UF == 23 & area_censit == 1 + replace subnatid3 = 3 if UF == 26 & area_censit == 1 + replace subnatid3 = 4 if UF == 29 & area_censit == 1 + replace subnatid3 = 5 if UF == 31 & area_censit == 1 + replace subnatid3 = 6 if UF == 33 & area_censit == 1 + replace subnatid3 = 7 if UF == 35 & area_censit == 1 + replace subnatid3 = 8 if UF == 41 & area_censit == 1 + replace subnatid3 = 9 if UF == 43 & area_censit == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-1992: contains "-1", which should be changed to missing (.) + + */ + rename tot_pess hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1992: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1992: "Pre-school" and "School" are considered separately + + As of 1992: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 ) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 9) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1992: "Pre-school" and "School" are considered separately + + As of 1992: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1992: "Pre-school" and "School" are considered separately + + As of 1992: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1992 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1992: "Pre-school" and "School" are considered separately + + 1992: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1992: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1992: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1992: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1992: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1992: V4756 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + gen v0504 = substr(industry_orig,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" + +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1992: V4756 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig,2,4) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88+"00" + replace occup_isco = "0100" if occup_isco == "100" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco = "" if occup_isco == ".00" + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 10 if lstatus == 1 & substr(occup_isco, 1, 2) == "01" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = 1 if V9034 == 2 | V9035 == 1 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1992: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [1992: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." +* replace industry_orig_2 = "45000" if industry_orig_2 == "45999" +* replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_2,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_2 = floor(v9997/10) *100 + tostring industrycat_isic_2, replace + replace industrycat_isic_2 = "0100" if industrycat_isic_2 == "100" + replace industrycat_isic_2 = "0200" if industrycat_isic_2 == "200" + replace industrycat_isic_2 = "0300" if industrycat_isic_2 == "300" + replace industrycat_isic_2 = "0400" if industrycat_isic_2 == "400" + replace industrycat_isic_2 = "0500" if industrycat_isic_2 == "500" + replace industrycat_isic_2 = "5100" if v0504 == "410" + replace industrycat_isic_2 = "5000" if v0504 == "419" + replace industrycat_isic_2 = "5200" if industrycat_isic_2 == "5300" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "." + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + drop _merge v0504 + replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = occup_orig_2 + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + replace occup_isco_2 = "0100" if occup_isco_2 == "100" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == ".00" + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 2) == "01" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1992: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + cap drop V4769 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1992: V4763 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 1992: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1992: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1992: V4765 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_year,3,3) + + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_year = floor(v9997/10) *100 + tostring industrycat_isic_year, replace + replace industrycat_isic_year = "0100" if industrycat_isic_year == "100" + replace industrycat_isic_year = "0200" if industrycat_isic_year == "200" + replace industrycat_isic_year = "0300" if industrycat_isic_year == "300" + replace industrycat_isic_year = "0400" if industrycat_isic_year == "400" + replace industrycat_isic_year = "0500" if industrycat_isic_year == "500" + replace industrycat_isic_year = "5100" if v0504 == "410" + replace industrycat_isic_year = "5000" if v0504 == "419" + replace industrycat_isic_year = "5200" if industrycat_isic_year == "5300" + replace industrycat_isic_year = "" if industrycat_isic_year == "." + replace industrycat_isic_year = "" if industrycat_isic_year == "00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + drop _merge v0504 + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1992: V4765 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_year,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_year = isco_88 + "00" + replace occup_isco_year = "0100" if occup_isco_year == "100" + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + drop _merge cbo_91 isco_88 + replace occup_isco_year = "" if occup_isco_year == "00" + replace occup_isco_year = "" if occup_isco_year == ".00" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1992: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 +============================================================================%%*/ + +if `year' >= 1995 { + +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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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' +} + +* +} + +else if `year' < 1995 { + + +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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1993_PNAD/BRA_1993_PNAD_V01_M_V02_A_GLD/Programs/BRA_1993_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_1993_PNAD/BRA_1993_PNAD_V01_M_V02_A_GLD/Programs/BRA_1993_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..74c0d6a6c --- /dev/null +++ b/GLD/BRA/BRA_1993_PNAD/BRA_1993_PNAD_V01_M_V02_A_GLD/Programs/BRA_1993_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2636 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1993_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1993 +<_Study ID_> BRA_1993_PNAD_v01_M +<_Data collection from_> 09/1993 +<_Data collection to_> 09/1993 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1993" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + local year = 1993 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\individuals_1993.dta" + + + preserve + + use "`path_in_stata'\households_1993.dta", clear + + + tempfile hhs + + save `hhs', replace + + restore + + merge m:1 UF CONTROL V0103 using `hhs', nogen keep(1 3) + + + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +tostring CONTROL, replace format(%05.0f) force + +tostring V0103, replace format(%02.0f) force + +egen id_dom = concat(UF CONTROL V0103) + + sort id_dom + + lab var id_dom "Household id" + + rename V0301 id_pes + + lab var id_pes "Individual id" + +bys id_dom: egen n_ind_1 = max(id_pes) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pes = id_pes2 if n_ind_same != 0 + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = V4729] + + * 0 instances where HH weight is missing + count if V4729 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + + distinct id_dom id_pes, joint + + * 0 non-distinct household identifiers (never more than one duplicate) + egen id_pnad = concat(id_dom id_pes), format(%24.2g) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + sort dup id_pnad + + gen year = `year' + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_1993" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1993-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1993: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1993-1993: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* + +*<_psu_> + gen psu =. +* tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> +* rename V4602 strata +* tostring strata, replace +* label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ +/* A. RIGHT STATES CODE */ +* ADD TOCANTINS WITH GOIÁS + +/* A.1 IN VARIABLE UF AND CREATE VARIABLE OF REGION */ +destring UF, replace +recode UF (17=52) +gen region = int(UF/10) +label var region "region" +tostring UF, replace + + +/* B. CONTROL AND SERIAL NUMBER */ +drop CONTROL V0103 + +/* C. RECODE AND RENAME OF VARIABLES */ + +/* C.2 CENSITRY AREA */ +rename V4107 area_censit + +/* C.3 RECODE: WEIGHTS */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode weight (-1=.) + +/* C.4 RECODE: TOTAL PEOPLE, TOTAL PEOPLE 10 YEARS OR MORE AND 5 YEARS OR MORE */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode V0105 (-1=.) +recode V0106 (-1=.) +* IN THE YEAR 2001 THERE IS NO TOTAL varIABLE OF PEOPLE 10 YEARS OR MORE, +* BUT TOTAL PEOPLE 5 YEARS OR MORE +replace V0106 = . if year==2001 + +rename V0105 tot_pess +rename V0106 tot_pess_10_more + +/* C.5 RENAME: TYPE OF DOMICILE */ +rename V0201 species_dom + +/* C.6 RENAME: HOUSEHOLD TYPE */ +rename V0202 type_dom + +/* C.7 RECODE: WALL */ +recode V0203 (6=5) (9=.) +rename V0203 wall + +/* C.8 RECODE: COVERAGE */ +recode V0204 (7=6) (9=.) +rename V0204 coverage + +/* C.9 DUMMY: WATER SUPPLY */ +recode V0212 (2=1) (4 6=0) (9=.) +rename V0212 water_rede +replace water_rede = 1 if V0213==1 +replace water_rede = 0 if V0213==3 +label var water_rede "water comes from the network" + +/* C.10 RECODE: SEWER */ +recode V0217 (1=0) (3=2) (5 7=6) (9=.) +rename V0217 sewer +* sewer = 0 general network +* = 2 septic tank +* = 4 rudimentary pit +* = 6 other + +/* C.11 TOILET */ + +* C.11.1 DUMMY: THERE IS A TOILET +recode V0215 (3=0) (9=.) +rename V0215 sanit +label var sanit "has toilet" + +/* C.11.2 DUMMY: EXCLUSIVE TOILET */ +recode V0216 (2=1) (4=0) (9=.) +rename V0216 sanit_excl +label var sanit_excl "domicile sanit excl" + +/* C.12 DUMMY: GARBAGE */ +recode V0218 (2=1) (3/6=0) (9=.) +rename V0218 garbage +label var garbage "garbage is collected" + +/* C.13 DUMMY: ELECTRIC LIGHTING */ +recode V0219 (3 5=0) (9=.) +rename V0219 ilum_eletr +label var ilum_eletr "has electric ilum" + +/* C.14 RECODE: NUMBER OF ROOMS AND DORMITORIES */ +recode V0205 (-1 99=.) +rename V0205 comodos +recode V0206 (-1 99=.) +rename V0206 dormit + +/* C.15 DUMMY: OCCUPANCY CONDITION */ +recode V0207 (2 = 1) (3/6 = 0) (9 = .), gen(possession_dom) +label var possession_dom "domicile possession" +drop V0207 + +/* C.16 RENTAL VALUE / INSTALLMENT */ +recode V0208 V0209 (-1=.) +recode V0208 V0209 (99999999/max=.) +rename V0208 rent +rename V0209 installment + +/* C.17 DUMMY: FILTER */ +recode V0224 (2=1) (4=0) (9=.) +rename V0224 filter + +/* C.18 DUMMY: STOVE */ +recode V0221 (3=0) (9=.) +recode V0222 (2=1) (4=0) (9=.) +gen stove = 1 if V0221 == 1 | V0222 == 1 +replace stove = 0 if V0221 == 0 & V0222 == 0 +replace stove = . if V0221 == . & V0222 == . +label var stove "has stove" +drop V0221 V0222 + +/* C.19 DUMMY: REFRIGERATOR */ +recode V0228 (2 4=1) (6=0) (9=.) +rename V0228 refrigerator + +/* C.20 DUMMY: RADIO */ +recode V0225 (3=0) (9=.) +rename V0225 radio + +/* C.21 DUMMY: TELEVISION */ +recode V0226 (2=1) (4=0) (9=.) +recode V0227 (3=0) (9=.) +gen tv = 1 if V0226 == 1 | V0227 == 1 +replace tv = 0 if V0226 == 0 & V0227 == 0 +replace tv = . if V0226 == . & V0227 == . +label var tv "has television" +drop V0226 V0227 +{ + +*<_urban_> + recode V4105 (1 2 3=1) (4 5 6 7 8=0) + rename V4105 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1993: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr((UF), 1, 1) == "1" + replace subnatid1 = 2 if substr((UF), 1, 1) == "2" + replace subnatid1 = 3 if substr((UF), 1, 1) == "3" + replace subnatid1 = 4 if substr((UF), 1, 1) == "4" + replace subnatid1 = 5 if substr((UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1993: not standardised + Until 1993: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ +destring UF, replace + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & area_censit == 1 + replace subnatid3 = 2 if UF == 23 & area_censit == 1 + replace subnatid3 = 3 if UF == 26 & area_censit == 1 + replace subnatid3 = 4 if UF == 29 & area_censit == 1 + replace subnatid3 = 5 if UF == 31 & area_censit == 1 + replace subnatid3 = 6 if UF == 33 & area_censit == 1 + replace subnatid3 = 7 if UF == 35 & area_censit == 1 + replace subnatid3 = 8 if UF == 41 & area_censit == 1 + replace subnatid3 = 9 if UF == 43 & area_censit == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1993-1993: contains "-1", which should be changed to missing (.) + + */ + rename tot_pess hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1993: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1993: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1993: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1993: one set of values for each of 0-8, 9-11 and 12+ + As of 1993: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1993: "Pre-school" and "School" are considered separately + + As of 1993: "Classe de alfabetização" category is added + 1981 & 1993: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 ) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 9) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1993: "Pre-school" and "School" are considered separately + + As of 1993: "Classe de alfabetização" category is added + 1981 & 1993: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1993: "Pre-school" and "School" are considered separately + + As of 1993: "Classe de alfabetização" category is added + 1981 & 1993: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1993 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1993: "Pre-school" and "School" are considered separately + + 1993: "Classe de alfabetização" category is added + 1981 & 1993: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1993: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1993: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1993: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1993: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1993: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1993: "trabalhadores domésticos" (domestic workers) inexisted + Until 1993: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1993: "production for own consumption" and "construction for own use" exist + As of 1993: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1993: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1993: V4756 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + gen v0504 = substr(industry_orig,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" + + +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1993: V4756 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig,2,4) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88+"00" + replace occup_isco = "0100" if occup_isco == "100" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco = "" if occup_isco == ".00" + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 10 if lstatus == 1 & substr(occup_isco, 1, 2) == "01" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1993: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = 1 if V9034 == 2 | V9035 == 1 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1993: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [1993: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." +* replace industry_orig_2 = "45000" if industry_orig_2 == "45999" +* replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_2,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_2 = floor(v9997/10) *100 + tostring industrycat_isic_2, replace + replace industrycat_isic_2 = "0100" if industrycat_isic_2 == "100" + replace industrycat_isic_2 = "0200" if industrycat_isic_2 == "200" + replace industrycat_isic_2 = "0300" if industrycat_isic_2 == "300" + replace industrycat_isic_2 = "0400" if industrycat_isic_2 == "400" + replace industrycat_isic_2 = "0500" if industrycat_isic_2 == "500" + replace industrycat_isic_2 = "5100" if v0504 == "410" + replace industrycat_isic_2 = "5000" if v0504 == "419" + replace industrycat_isic_2 = "5200" if industrycat_isic_2 == "5300" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "." + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + drop _merge v0504 + replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_2,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + replace occup_isco_2 = "0100" if occup_isco_2 == "100" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == ".00" + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 2) == "01" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1993: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + cap drop V4769 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1993: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1993: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1993: V4763 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1993: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1993: "trabalhadores domésticos" (domestic workers) inexisted + Until 1993: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1993: "production for own consumption" and "construction for own use" exist + As of 1993: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1993: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1993: V4765 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_year,3,3) + + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_year = floor(v9997/10) *100 + tostring industrycat_isic_year, replace + replace industrycat_isic_year = "0100" if industrycat_isic_year == "100" + replace industrycat_isic_year = "0200" if industrycat_isic_year == "200" + replace industrycat_isic_year = "0300" if industrycat_isic_year == "300" + replace industrycat_isic_year = "0400" if industrycat_isic_year == "400" + replace industrycat_isic_year = "0500" if industrycat_isic_year == "500" + replace industrycat_isic_year = "5100" if v0504 == "410" + replace industrycat_isic_year = "5000" if v0504 == "419" + replace industrycat_isic_year = "5200" if industrycat_isic_year == "5300" + replace industrycat_isic_year = "" if industrycat_isic_year == "." + replace industrycat_isic_year = "" if industrycat_isic_year == "00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + drop _merge v0504 + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1993: V4765 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_year,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_year = isco_88 + "00" + replace occup_isco_year = "0100" if occup_isco_year == "100" + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + drop _merge cbo_91 isco_88 + replace occup_isco_year = "" if occup_isco_year == ".00" + replace occup_isco_year = "" if occup_isco_year == "00" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1993: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1993: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 +============================================================================%%*/ + +if `year' >= 1995 { + +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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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' +} + +* +} + +else if `year' < 1995 { + + +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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1995_PNAD/BRA_1995_PNAD_V01_M_V02_A_GLD/Programs/BRA_1995_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_1995_PNAD/BRA_1995_PNAD_V01_M_V02_A_GLD/Programs/BRA_1995_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..e35ed8999 --- /dev/null +++ b/GLD/BRA/BRA_1995_PNAD/BRA_1995_PNAD_V01_M_V02_A_GLD/Programs/BRA_1995_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2637 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1995_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1995 +<_Study ID_> BRA_1995_PNAD_v01_M +<_Data collection from_> 09/1995 +<_Data collection to_> 09/1995 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- + +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1995" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + local year = 1995 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\individuals_1995.dta" + + + preserve + + use "`path_in_stata'\households_1995.dta", clear + + + tempfile hhs + + save `hhs', replace + + restore + + merge m:1 UF V0102 V0103 using `hhs', nogen keep(1 3) + + + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +tostring V0102, replace format(%05.0f) force + +tostring V0103, replace format(%02.0f) force + +egen id_dom = concat(UF V0102 V0103) + + sort id_dom + + lab var id_dom "Household id" + + rename V0301 id_pes + + lab var id_pes "Individual id" + +bys id_dom: egen n_ind_1 = max(id_pes) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pes = id_pes2 if n_ind_same != 0 + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = V4729] + + * 0 instances where HH weight is missing + count if V4729 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + + distinct id_dom id_pes, joint + + * 0 non-distinct household identifiers (never more than one duplicate) + egen id_pnad = concat(id_dom id_pes), format(%24.2g) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + sort dup id_pnad + + gen year = `year' + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_1995" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1995-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1995: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1995-1995: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* + +*<_psu_> + gen psu = . + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ +/* A. RIGHT STATES CODE */ +* ADD TOCANTINS WITH GOIÁS + +/* A.1 IN VARIABLE UF AND CREATE VARIABLE OF REGION */ +destring UF, replace +recode UF (17=52) +gen region = int(UF/10) +label var region "region" +tostring UF, replace + + +/* B. V0102 AND SERIAL NUMBER */ +drop V0103 + +/* C. RECODE AND RENAME OF VARIABLES */ + + +/* C.2 CENSITRY AREA */ +rename V4107 area_censit + +/* C.3 RECODE: WEIGHTS */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode weight (-1=.) + +/* C.4 RECODE: TOTAL PEOPLE, TOTAL PEOPLE 10 YEARS OR MORE AND 5 YEARS OR MORE */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode V0105 (-1=.) +recode V0106 (-1=.) +* IN THE YEAR 2001 THERE IS NO TOTAL varIABLE OF PEOPLE 10 YEARS OR MORE, +* BUT TOTAL PEOPLE 5 YEARS OR MORE +replace V0106 = . if year==2001 + +rename V0105 tot_pess +rename V0106 tot_pess_10_more + +/* C.5 RENAME: TYPE OF DOMICILE */ +rename V0201 species_dom + +/* C.6 RENAME: HOUSEHOLD TYPE */ +rename V0202 type_dom + +/* C.7 RECODE: WALL */ +recode V0203 (6=5) (9=.) +rename V0203 wall + +/* C.8 RECODE: COVERAGE */ +recode V0204 (7=6) (9=.) +rename V0204 coverage + +/* C.9 DUMMY: WATER SUPPLY */ +recode V0212 (2=1) (4 6=0) (9=.) +rename V0212 water_rede +replace water_rede = 1 if V0213==1 +replace water_rede = 0 if V0213==3 +label var water_rede "water comes from the network" + +/* C.10 RECODE: SEWER */ +recode V0217 (1=0) (3=2) (5 7=6) (9=.) +rename V0217 sewer +* sewer = 0 general network +* = 2 septic tank +* = 4 rudimentary pit +* = 6 other + +/* C.11 TOILET */ + +* C.11.1 DUMMY: THERE IS A TOILET +recode V0215 (3=0) (9=.) +rename V0215 sanit +label var sanit "has toilet" + +/* C.11.2 DUMMY: EXCLUSIVE TOILET */ +recode V0216 (2=1) (4=0) (9=.) +rename V0216 sanit_excl +label var sanit_excl "domicile sanit excl" + +/* C.12 DUMMY: GARBAGE */ +recode V0218 (2=1) (3/6=0) (9=.) +rename V0218 garbage +label var garbage "garbage is collected" + +/* C.13 DUMMY: ELECTRIC LIGHTING */ +recode V0219 (3 5=0) (9=.) +rename V0219 ilum_eletr +label var ilum_eletr "has electric ilum" + +/* C.14 RECODE: NUMBER OF ROOMS AND DORMITORIES */ +recode V0205 (-1 99=.) +rename V0205 comodos +recode V0206 (-1 99=.) +rename V0206 dormit + +/* C.15 DUMMY: OCCUPANCY CONDITION */ +recode V0207 (2 = 1) (3/6 = 0) (9 = .), gen(possession_dom) +label var possession_dom "domicile possession" +drop V0207 + +/* C.16 RENTAL VALUE / INSTALLMENT */ +recode V0208 V0209 (-1=.) +recode V0208 V0209 (99999999/max=.) +rename V0208 rent +rename V0209 installment + +/* C.17 DUMMY: FILTER */ +recode V0224 (2=1) (4=0) (9=.) +rename V0224 filter + +/* C.18 DUMMY: STOVE */ +recode V0221 (3=0) (9=.) +recode V0222 (2=1) (4=0) (9=.) +gen stove = 1 if V0221 == 1 | V0222 == 1 +replace stove = 0 if V0221 == 0 & V0222 == 0 +replace stove = . if V0221 == . & V0222 == . +label var stove "has stove" +drop V0221 V0222 + +/* C.19 DUMMY: REFRIGERATOR */ +recode V0228 (2 4=1) (6=0) (9=.) +rename V0228 refrigerator + +/* C.20 DUMMY: RADIO */ +recode V0225 (3=0) (9=.) +rename V0225 radio + +/* C.21 DUMMY: TELEVISION */ +recode V0226 (2=1) (4=0) (9=.) +recode V0227 (3=0) (9=.) +gen tv = 1 if V0226 == 1 | V0227 == 1 +replace tv = 0 if V0226 == 0 & V0227 == 0 +replace tv = . if V0226 == . & V0227 == . +label var tv "has television" +drop V0226 V0227 +{ + +*<_urban_> + recode V4105 (1 2 3=1) (4 5 6 7 8=0) + rename V4105 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1995: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr((UF), 1, 1) == "1" + replace subnatid1 = 2 if substr((UF), 1, 1) == "2" + replace subnatid1 = 3 if substr((UF), 1, 1) == "3" + replace subnatid1 = 4 if substr((UF), 1, 1) == "4" + replace subnatid1 = 5 if substr((UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1995: not standardised + Until 1995: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ +destring UF, replace + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & area_censit == 1 + replace subnatid3 = 2 if UF == 23 & area_censit == 1 + replace subnatid3 = 3 if UF == 26 & area_censit == 1 + replace subnatid3 = 4 if UF == 29 & area_censit == 1 + replace subnatid3 = 5 if UF == 31 & area_censit == 1 + replace subnatid3 = 6 if UF == 33 & area_censit == 1 + replace subnatid3 = 7 if UF == 35 & area_censit == 1 + replace subnatid3 = 8 if UF == 41 & area_censit == 1 + replace subnatid3 = 9 if UF == 43 & area_censit == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1995-1995: contains "-1", which should be changed to missing (.) + + */ + rename tot_pess hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1995: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1995: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1995: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1995: one set of values for each of 0-8, 9-11 and 12+ + As of 1995: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1995: "Pre-school" and "School" are considered separately + + As of 1995: "Classe de alfabetização" category is added + 1981 & 1995: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 ) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 9) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1995: "Pre-school" and "School" are considered separately + + As of 1995: "Classe de alfabetização" category is added + 1981 & 1995: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1995: "Pre-school" and "School" are considered separately + + As of 1995: "Classe de alfabetização" category is added + 1981 & 1995: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1995 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1995: "Pre-school" and "School" are considered separately + + 1995: "Classe de alfabetização" category is added + 1981 & 1995: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1995: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1995: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1995: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1995: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1995: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1995: "trabalhadores domésticos" (domestic workers) inexisted + Until 1995: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1995: "production for own consumption" and "construction for own use" exist + As of 1995: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1995: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1995: V4756 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + gen v0504 = substr(industry_orig,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" + + +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1995: V4756 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig,2,4) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 +"00" + replace occup_isco = "0100" if occup_isco == "100" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco = "" if occup_isco == ".00" + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 10 if lstatus == 1 & substr(occup_isco, 1, 2) == "01" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1995: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = 1 if V9034 == 2 | V9035 == 1 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1995: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [1995: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." +* replace industry_orig_2 = "45000" if industry_orig_2 == "45999" +* replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_2,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_2 = floor(v9997/10) *100 + tostring industrycat_isic_2, replace + replace industrycat_isic_2 = "0100" if industrycat_isic_2 == "100" + replace industrycat_isic_2 = "0200" if industrycat_isic_2 == "200" + replace industrycat_isic_2 = "0300" if industrycat_isic_2 == "300" + replace industrycat_isic_2 = "0400" if industrycat_isic_2 == "400" + replace industrycat_isic_2 = "0500" if industrycat_isic_2 == "500" + replace industrycat_isic_2 = "5100" if v0504 == "410" + replace industrycat_isic_2 = "5000" if v0504 == "419" + replace industrycat_isic_2 = "5200" if industrycat_isic_2 == "5300" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "." + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + drop _merge v0504 + replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_2,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + + replace occup_isco_2 = "0100" if occup_isco_2 == "100" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == ".00" + replace occup_isco_2 = "" if occup_isco_2 == "00" + * + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 2) == "01" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1995: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + cap drop V4769 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1995: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1995: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1995: V4763 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1995: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1995: "trabalhadores domésticos" (domestic workers) inexisted + Until 1995: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1995: "production for own consumption" and "construction for own use" exist + As of 1995: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1995: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1995: V4765 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_year,3,3) + + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_year = floor(v9997/10) *100 + tostring industrycat_isic_year, replace + replace industrycat_isic_year = "0100" if industrycat_isic_year == "100" + replace industrycat_isic_year = "0200" if industrycat_isic_year == "200" + replace industrycat_isic_year = "0300" if industrycat_isic_year == "300" + replace industrycat_isic_year = "0400" if industrycat_isic_year == "400" + replace industrycat_isic_year = "0500" if industrycat_isic_year == "500" + replace industrycat_isic_year = "5100" if v0504 == "410" + replace industrycat_isic_year = "5000" if v0504 == "419" + replace industrycat_isic_year = "5200" if industrycat_isic_year == "5300" + replace industrycat_isic_year = "" if industrycat_isic_year == "." + replace industrycat_isic_year = "" if industrycat_isic_year == "00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + drop _merge v0504 + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1995: V4765 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_year,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_year = isco_88 +"00" + replace occup_isco_year = "0100" if occup_isco_year == "100" + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + drop _merge cbo_91 isco_88 + replace occup_isco_year = "" if occup_isco_year == ".00" + replace occup_isco_year = "" if occup_isco_year == "00" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1995: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1995: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 +============================================================================%%*/ + +if `year' >= 1995 { + +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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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' +} + +* +} + +else if `year' < 1995 { + + +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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1996_PNAD/BRA_1996_PNAD_V01_M_V02_A_GLD/Programs/BRA_1996_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_1996_PNAD/BRA_1996_PNAD_V01_M_V02_A_GLD/Programs/BRA_1996_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..615204011 --- /dev/null +++ b/GLD/BRA/BRA_1996_PNAD/BRA_1996_PNAD_V01_M_V02_A_GLD/Programs/BRA_1996_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2633 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1996_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1996 +<_Study ID_> BRA_1996_PNAD_v01_M +<_Data collection from_> 09/1996 +<_Data collection to_> 09/1996 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 84,948 +<_Sample size (IND)_> 331,264 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1996" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + local year = 1996 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\individuals_1996.dta" + + + preserve + + use "`path_in_stata'\households_1996.dta", clear + + + tempfile hhs + + save `hhs', replace + + restore + + merge m:1 UF V0102 V0103 using `hhs', nogen keep(1 3) + + + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +tostring V0102, replace format(%05.0f) force + +tostring V0103, replace format(%02.0f) force + +egen id_dom = concat(UF V0102 V0103) + + sort id_dom + + lab var id_dom "Household id" + + rename V0301 id_pes + + lab var id_pes "Individual id" + +bys id_dom: egen n_ind_1 = max(id_pes) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pes = id_pes2 if n_ind_same != 0 + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + tab count [iweight = V4729] + + * 0 instances where HH weight is missing + count if V4729 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + + distinct id_dom id_pes, joint + + egen id_pnad = concat(id_dom id_pes), format(%24.2g) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + sort dup id_pnad + + gen year = `year' + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_1996" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1996-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1996: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1996-1996: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* + +*<_psu_> + gen psu = . + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ +/* A. RIGHT STATES CODE */ +* ADD TOCANTINS WITH GOIÁS + +/* A.1 IN VARIABLE UF AND CREATE VARIABLE OF REGION */ +destring UF, replace +recode UF (17=52) +gen region = int(UF/10) +label var region "region" +tostring UF, replace + + +/* B. V0102 AND SERIAL NUMBER */ +drop V0103 + +/* C. RECODE AND RENAME OF VARIABLES */ + + + +/* C.2 CENSITRY AREA */ +rename V4107 area_censit + +/* C.3 RECODE: WEIGHTS */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode weight (-1=.) + +/* C.4 RECODE: TOTAL PEOPLE, TOTAL PEOPLE 10 YEARS OR MORE AND 5 YEARS OR MORE */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode V0105 (-1=.) +recode V0106 (-1=.) +* IN THE YEAR 2001 THERE IS NO TOTAL varIABLE OF PEOPLE 10 YEARS OR MORE, +* BUT TOTAL PEOPLE 5 YEARS OR MORE +replace V0106 = . if year==2001 + +rename V0105 tot_pess +rename V0106 tot_pess_10_more + +/* C.5 RENAME: TYPE OF DOMICILE */ +rename V0201 species_dom + +/* C.6 RENAME: HOUSEHOLD TYPE */ +rename V0202 type_dom + +/* C.7 RECODE: WALL */ +recode V0203 (6=5) (9=.) +rename V0203 wall + +/* C.8 RECODE: COVERAGE */ +recode V0204 (7=6) (9=.) +rename V0204 coverage + +/* C.9 DUMMY: WATER SUPPLY */ +recode V0212 (2=1) (4 6=0) (9=.) +rename V0212 water_rede +replace water_rede = 1 if V0213==1 +replace water_rede = 0 if V0213==3 +label var water_rede "water comes from the network" + +/* C.10 RECODE: SEWER */ +recode V0217 (1=0) (3=2) (5 7=6) (9=.) +rename V0217 sewer +* sewer = 0 general network +* = 2 septic tank +* = 4 rudimentary pit +* = 6 other + +/* C.11 TOILET */ + +* C.11.1 DUMMY: THERE IS A TOILET +recode V0215 (3=0) (9=.) +rename V0215 sanit +label var sanit "has toilet" + +/* C.11.2 DUMMY: EXCLUSIVE TOILET */ +recode V0216 (2=1) (4=0) (9=.) +rename V0216 sanit_excl +label var sanit_excl "domicile sanit excl" + +/* C.12 DUMMY: GARBAGE */ +recode V0218 (2=1) (3/6=0) (9=.) +rename V0218 garbage +label var garbage "garbage is collected" + +/* C.13 DUMMY: ELECTRIC LIGHTING */ +recode V0219 (3 5=0) (9=.) +rename V0219 ilum_eletr +label var ilum_eletr "has electric ilum" + +/* C.14 RECODE: NUMBER OF ROOMS AND DORMITORIES */ +recode V0205 (-1 99=.) +rename V0205 comodos +recode V0206 (-1 99=.) +rename V0206 dormit + +/* C.15 DUMMY: OCCUPANCY CONDITION */ +recode V0207 (2 = 1) (3/6 = 0) (9 = .), gen(possession_dom) +label var possession_dom "domicile possession" +drop V0207 + +/* C.16 RENTAL VALUE / INSTALLMENT */ +recode V0208 V0209 (-1=.) +recode V0208 V0209 (99999999/max=.) +rename V0208 rent +rename V0209 installment + +/* C.17 DUMMY: FILTER */ +recode V0224 (2=1) (4=0) (9=.) +rename V0224 filter + +/* C.18 DUMMY: STOVE */ +recode V0221 (3=0) (9=.) +recode V0222 (2=1) (4=0) (9=.) +gen stove = 1 if V0221 == 1 | V0222 == 1 +replace stove = 0 if V0221 == 0 & V0222 == 0 +replace stove = . if V0221 == . & V0222 == . +label var stove "has stove" +drop V0221 V0222 + +/* C.19 DUMMY: REFRIGERATOR */ +recode V0228 (2 4=1) (6=0) (9=.) +rename V0228 refrigerator + +/* C.20 DUMMY: RADIO */ +recode V0225 (3=0) (9=.) +rename V0225 radio + +/* C.21 DUMMY: TELEVISION */ +recode V0226 (2=1) (4=0) (9=.) +recode V0227 (3=0) (9=.) +gen tv = 1 if V0226 == 1 | V0227 == 1 +replace tv = 0 if V0226 == 0 & V0227 == 0 +replace tv = . if V0226 == . & V0227 == . +label var tv "has television" +drop V0226 V0227 +{ + +*<_urban_> + recode V4105 (1 2 3=1) (4 5 6 7 8=0) + rename V4105 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1996: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr((UF), 1, 1) == "1" + replace subnatid1 = 2 if substr((UF), 1, 1) == "2" + replace subnatid1 = 3 if substr((UF), 1, 1) == "3" + replace subnatid1 = 4 if substr((UF), 1, 1) == "4" + replace subnatid1 = 5 if substr((UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1996: not standardised + Until 1996: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ +destring UF, replace + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & area_censit == 1 + replace subnatid3 = 2 if UF == 23 & area_censit == 1 + replace subnatid3 = 3 if UF == 26 & area_censit == 1 + replace subnatid3 = 4 if UF == 29 & area_censit == 1 + replace subnatid3 = 5 if UF == 31 & area_censit == 1 + replace subnatid3 = 6 if UF == 33 & area_censit == 1 + replace subnatid3 = 7 if UF == 35 & area_censit == 1 + replace subnatid3 = 8 if UF == 41 & area_censit == 1 + replace subnatid3 = 9 if UF == 43 & area_censit == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1996-1996: contains "-1", which should be changed to missing (.) + + */ + rename tot_pess hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1996: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1996: asked to all ages + + Comparability throughout the years is compromised: + 1996: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1996: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1996: one set of values for each of 0-8, 9-11 and 12+ + As of 1996: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1996: "Pre-school" and "School" are considered separately + + As of 1996: "Classe de alfabetização" category is added + 1981 & 1996: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 ) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 9) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1996: "Pre-school" and "School" are considered separately + + As of 1996: "Classe de alfabetização" category is added + 1981 & 1996: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1996: "Pre-school" and "School" are considered separately + + As of 1996: "Classe de alfabetização" category is added + 1981 & 1996: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1996 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1996: "Pre-school" and "School" are considered separately + + 1996: "Classe de alfabetização" category is added + 1981 & 1996: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1996: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1996: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1996: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1996: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1996: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1996: "trabalhadores domésticos" (domestic workers) inexisted + Until 1996: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1996: "production for own consumption" and "construction for own use" exist + As of 1996: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1996: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1996: V4756 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + gen v0504 = substr(industry_orig,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" + +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1996: V4756 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig,2,4) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 +"00" + replace occup_isco = "0100" if occup_isco == "100" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco = "" if occup_isco == ".00" + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 10 if lstatus == 1 & substr(occup_isco, 1, 2) == "01" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1996: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = 1 if V9034 == 2 | V9035 == 1 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1996: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [1996: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." +* replace industry_orig_2 = "45000" if industry_orig_2 == "45999" +* replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_2,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_2 = floor(v9997/10) *100 + tostring industrycat_isic_2, replace + replace industrycat_isic_2 = "0100" if industrycat_isic_2 == "100" + replace industrycat_isic_2 = "0200" if industrycat_isic_2 == "200" + replace industrycat_isic_2 = "0300" if industrycat_isic_2 == "300" + replace industrycat_isic_2 = "0400" if industrycat_isic_2 == "400" + replace industrycat_isic_2 = "0500" if industrycat_isic_2 == "500" + replace industrycat_isic_2 = "5100" if v0504 == "410" + replace industrycat_isic_2 = "5000" if v0504 == "419" + replace industrycat_isic_2 = "5200" if industrycat_isic_2 == "5300" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "." + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + drop _merge v0504 + replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_2,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + + replace occup_isco_2 = "0100" if occup_isco_2 == "100" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == ".00" + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 2) == "01" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1996: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + cap drop V4769 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1996: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1996: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 1996: V4763 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1996: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1996: "trabalhadores domésticos" (domestic workers) inexisted + Until 1996: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1996: "production for own consumption" and "construction for own use" exist + As of 1996: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1996: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1996: V4765 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_year,3,3) + + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_year = floor(v9997/10) *100 + tostring industrycat_isic_year, replace + replace industrycat_isic_year = "0100" if industrycat_isic_year == "100" + replace industrycat_isic_year = "0200" if industrycat_isic_year == "200" + replace industrycat_isic_year = "0300" if industrycat_isic_year == "300" + replace industrycat_isic_year = "0400" if industrycat_isic_year == "400" + replace industrycat_isic_year = "0500" if industrycat_isic_year == "500" + replace industrycat_isic_year = "5100" if v0504 == "410" + replace industrycat_isic_year = "5000" if v0504 == "419" + replace industrycat_isic_year = "5200" if industrycat_isic_year == "5300" + replace industrycat_isic_year = "" if industrycat_isic_year == "." + replace industrycat_isic_year = "" if industrycat_isic_year == "00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + drop _merge v0504 + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1996: V4765 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_year,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_year = isco_88 +"00" + replace occup_isco_year = "0100" if occup_isco_year == "100" + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + drop _merge cbo_91 isco_88 + replace occup_isco_year = "" if occup_isco_year == ".00" + replace occup_isco_year = "" if occup_isco_year == "00" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1996: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1996: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 +============================================================================%%*/ + +if `year' >= 1996 { + +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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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' +} + +* +} + +else if `year' < 1995 { + + +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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1997_PNAD/BRA_1997_PNAD_V01_M_V02_A_GLD/Programs/BRA_1997_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_1997_PNAD/BRA_1997_PNAD_V01_M_V02_A_GLD/Programs/BRA_1997_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..7b0774a11 --- /dev/null +++ b/GLD/BRA/BRA_1997_PNAD/BRA_1997_PNAD_V01_M_V02_A_GLD/Programs/BRA_1997_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2636 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1997_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1997 +<_Study ID_> BRA_1997_PNAD_v01_M +<_Data collection from_> 09/1997 +<_Data collection to_> 09/1997 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1997" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + local year = 1997 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\individuals_1997.dta" + + + preserve + + use "`path_in_stata'\households_1997.dta", clear + + + tempfile hhs + + save `hhs', replace + + restore + + merge m:1 UF V0102 V0103 using `hhs', nogen keep(1 3) + + + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +tostring V0102, replace format(%05.0f) force + +tostring V0103, replace format(%02.0f) force + +egen id_dom = concat(UF V0102 V0103) + + sort id_dom + + lab var id_dom "Household id" + + rename V0301 id_pes + + lab var id_pes "Individual id" + +bys id_dom: egen n_ind_1 = max(id_pes) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pes = id_pes2 if n_ind_same != 0 + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = V4729] + + * 0 instances where HH weight is missing + count if V4729 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + + distinct id_dom id_pes, joint + + * 0 non-distinct household identifiers (never more than one duplicate) + egen id_pnad = concat(id_dom id_pes), format(%24.2g) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + sort dup id_pnad + + gen year = `year' + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_1997" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1997-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1997: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1997-1997: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* + +*<_psu_> + gen psu = . + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ +/* A. RIGHT STATES CODE */ +* ADD TOCANTINS WITH GOIÁS + +/* A.1 IN VARIABLE UF AND CREATE VARIABLE OF REGION */ +destring UF, replace +recode UF (17=52) +gen region = int(UF/10) +label var region "region" +tostring UF, replace + + +/* B. V0102 AND SERIAL NUMBER */ +drop V0103 + +/* C. RECODE AND RENAME OF VARIABLES */ + + + +/* C.2 CENSITRY AREA */ +rename V4107 area_censit + +/* C.3 RECODE: WEIGHTS */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode weight (-1=.) + +/* C.4 RECODE: TOTAL PEOPLE, TOTAL PEOPLE 10 YEARS OR MORE AND 5 YEARS OR MORE */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode V0105 (-1=.) +recode V0106 (-1=.) +* IN THE YEAR 2001 THERE IS NO TOTAL varIABLE OF PEOPLE 10 YEARS OR MORE, +* BUT TOTAL PEOPLE 5 YEARS OR MORE +replace V0106 = . if year==2001 + +rename V0105 tot_pess +rename V0106 tot_pess_10_more + +/* C.5 RENAME: TYPE OF DOMICILE */ +rename V0201 species_dom + +/* C.6 RENAME: HOUSEHOLD TYPE */ +rename V0202 type_dom + +/* C.7 RECODE: WALL */ +recode V0203 (6=5) (9=.) +rename V0203 wall + +/* C.8 RECODE: COVERAGE */ +recode V0204 (7=6) (9=.) +rename V0204 coverage + +/* C.9 DUMMY: WATER SUPPLY */ +recode V0212 (2=1) (4 6=0) (9=.) +rename V0212 water_rede +replace water_rede = 1 if V0213==1 +replace water_rede = 0 if V0213==3 +label var water_rede "water comes from the network" + +/* C.10 RECODE: SEWER */ +recode V0217 (1=0) (3=2) (5 7=6) (9=.) +rename V0217 sewer +* sewer = 0 general network +* = 2 septic tank +* = 4 rudimentary pit +* = 6 other + +/* C.11 TOILET */ + +* C.11.1 DUMMY: THERE IS A TOILET +recode V0215 (3=0) (9=.) +rename V0215 sanit +label var sanit "has toilet" + +/* C.11.2 DUMMY: EXCLUSIVE TOILET */ +recode V0216 (2=1) (4=0) (9=.) +rename V0216 sanit_excl +label var sanit_excl "domicile sanit excl" + +/* C.12 DUMMY: GARBAGE */ +recode V0218 (2=1) (3/6=0) (9=.) +rename V0218 garbage +label var garbage "garbage is collected" + +/* C.13 DUMMY: ELECTRIC LIGHTING */ +recode V0219 (3 5=0) (9=.) +rename V0219 ilum_eletr +label var ilum_eletr "has electric ilum" + +/* C.14 RECODE: NUMBER OF ROOMS AND DORMITORIES */ +recode V0205 (-1 99=.) +rename V0205 comodos +recode V0206 (-1 99=.) +rename V0206 dormit + +/* C.15 DUMMY: OCCUPANCY CONDITION */ +recode V0207 (2 = 1) (3/6 = 0) (9 = .), gen(possession_dom) +label var possession_dom "domicile possession" +drop V0207 + +/* C.16 RENTAL VALUE / INSTALLMENT */ +recode V0208 V0209 (-1=.) +recode V0208 V0209 (99999999/max=.) +rename V0208 rent +rename V0209 installment + +/* C.17 DUMMY: FILTER */ +recode V0224 (2=1) (4=0) (9=.) +rename V0224 filter + +/* C.18 DUMMY: STOVE */ +recode V0221 (3=0) (9=.) +recode V0222 (2=1) (4=0) (9=.) +gen stove = 1 if V0221 == 1 | V0222 == 1 +replace stove = 0 if V0221 == 0 & V0222 == 0 +replace stove = . if V0221 == . & V0222 == . +label var stove "has stove" +drop V0221 V0222 + +/* C.19 DUMMY: REFRIGERATOR */ +recode V0228 (2 4=1) (6=0) (9=.) +rename V0228 refrigerator + +/* C.20 DUMMY: RADIO */ +recode V0225 (3=0) (9=.) +rename V0225 radio + +/* C.21 DUMMY: TELEVISION */ +recode V0226 (2=1) (4=0) (9=.) +recode V0227 (3=0) (9=.) +gen tv = 1 if V0226 == 1 | V0227 == 1 +replace tv = 0 if V0226 == 0 & V0227 == 0 +replace tv = . if V0226 == . & V0227 == . +label var tv "has television" +drop V0226 V0227 +{ + +*<_urban_> + recode V4105 (1 2 3=1) (4 5 6 7 8=0) + rename V4105 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1997: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr((UF), 1, 1) == "1" + replace subnatid1 = 2 if substr((UF), 1, 1) == "2" + replace subnatid1 = 3 if substr((UF), 1, 1) == "3" + replace subnatid1 = 4 if substr((UF), 1, 1) == "4" + replace subnatid1 = 5 if substr((UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1997: not standardised + Until 1997: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ +destring UF, replace + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & area_censit == 1 + replace subnatid3 = 2 if UF == 23 & area_censit == 1 + replace subnatid3 = 3 if UF == 26 & area_censit == 1 + replace subnatid3 = 4 if UF == 29 & area_censit == 1 + replace subnatid3 = 5 if UF == 31 & area_censit == 1 + replace subnatid3 = 6 if UF == 33 & area_censit == 1 + replace subnatid3 = 7 if UF == 35 & area_censit == 1 + replace subnatid3 = 8 if UF == 41 & area_censit == 1 + replace subnatid3 = 9 if UF == 43 & area_censit == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1997-1997: contains "-1", which should be changed to missing (.) + + */ + rename tot_pess hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1997: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1997: asked to all ages + + Comparability throughout the years is compromised: + 1997: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1997: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1997: one set of values for each of 0-8, 9-11 and 12+ + As of 1997: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1997: "Pre-school" and "School" are considered separately + + As of 1997: "Classe de alfabetização" category is added + 1981 & 1997: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 ) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 9) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1997: "Pre-school" and "School" are considered separately + + As of 1997: "Classe de alfabetização" category is added + 1981 & 1997: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1997: "Pre-school" and "School" are considered separately + + As of 1997: "Classe de alfabetização" category is added + 1981 & 1997: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1997 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1997: "Pre-school" and "School" are considered separately + + 1997: "Classe de alfabetização" category is added + 1981 & 1997: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1997: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1997: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1997: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1997 & 1997): "employed" could be answered by people 5 years or older + + 1997: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1997: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1997: "trabalhadores domésticos" (domestic workers) inexisted + Until 1997: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1997: "production for own consumption" and "construction for own use" exist + As of 1997: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1997: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1997: V4756 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1997 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + + gen v0504 = substr(industry_orig,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1997: V4756 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig,2,4) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 +"00" + replace occup_isco = "0100" if occup_isco == "100" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco = "" if occup_isco == ".00" + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 10 if lstatus == 1 & substr(occup_isco, 1, 2) == "01" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1997: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = 1 if V9034 == 2 | V9035 == 1 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1997: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [1997: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." +* replace industry_orig_2 = "45000" if industry_orig_2 == "45999" +* replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_2,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_2 = floor(v9997/10) *100 + tostring industrycat_isic_2, replace + replace industrycat_isic_2 = "0100" if industrycat_isic_2 == "100" + replace industrycat_isic_2 = "0200" if industrycat_isic_2 == "200" + replace industrycat_isic_2 = "0300" if industrycat_isic_2 == "300" + replace industrycat_isic_2 = "0400" if industrycat_isic_2 == "400" + replace industrycat_isic_2 = "0500" if industrycat_isic_2 == "500" + replace industrycat_isic_2 = "5100" if v0504 == "410" + replace industrycat_isic_2 = "5000" if v0504 == "419" + replace industrycat_isic_2 = "5200" if industrycat_isic_2 == "5300" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "." + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + drop _merge v0504 + replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_2,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + + replace occup_isco_2 = "0100" if occup_isco_2 == "100" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == ".00" + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 2) == "01" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1997: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + cap drop V4769 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1997: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1997: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1997 & 1997): "employed" could be answered by people 5 years or older + + 1997: V4763 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1997: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1997: "trabalhadores domésticos" (domestic workers) inexisted + Until 1997: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1997: "production for own consumption" and "construction for own use" exist + As of 1997: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1997: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1997: V4765 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1997 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_year,3,3) + + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_year = floor(v9997/10) *100 + tostring industrycat_isic_year, replace + replace industrycat_isic_year = "0100" if industrycat_isic_year == "100" + replace industrycat_isic_year = "0200" if industrycat_isic_year == "200" + replace industrycat_isic_year = "0300" if industrycat_isic_year == "300" + replace industrycat_isic_year = "0400" if industrycat_isic_year == "400" + replace industrycat_isic_year = "0500" if industrycat_isic_year == "500" + replace industrycat_isic_year = "5100" if v0504 == "410" + replace industrycat_isic_year = "5000" if v0504 == "419" + replace industrycat_isic_year = "5200" if industrycat_isic_year == "5300" + replace industrycat_isic_year = "" if industrycat_isic_year == "." + replace industrycat_isic_year = "" if industrycat_isic_year == "00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + drop _merge v0504 + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1997: V4765 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_year,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_year = isco_88 +"00" + replace occup_isco_year = "0100" if occup_isco_year == "100" + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + drop _merge cbo_91 isco_88 + replace occup_isco_year = "" if occup_isco_year == ".00" + replace occup_isco_year = "" if occup_isco_year == "00" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1997: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1997: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 +============================================================================%%*/ + +if `year' >= 1997 { + +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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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' +} + +* +} + +else if `year' < 1997 { + + +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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1998_PNAD/BRA_1998_PNAD_V01_M_V03_A_GLD/Programs/BRA_1998_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_1998_PNAD/BRA_1998_PNAD_V01_M_V03_A_GLD/Programs/BRA_1998_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..4a3797850 --- /dev/null +++ b/GLD/BRA/BRA_1998_PNAD/BRA_1998_PNAD_V01_M_V03_A_GLD/Programs/BRA_1998_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2634 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1998_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1998 +<_Study ID_> BRA_1998_PNAD_v01_M +<_Data collection from_> 09/1998 +<_Data collection to_> 09/1998 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023 / 01 / 11 - Correct out of range values 8, 14 for empstat +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "BRA" +local year "1998" +local survey "PNAD" +local vermast "V01" + local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + +*----------1.3 Merge Household and People files--------------------------------* + + local year = 1998 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\individuals_1998.dta" + + + preserve + + use "`path_in_stata'\households_1998.dta", clear + + + tempfile hhs + + save `hhs', replace + + restore + + merge m:1 UF V0102 V0103 using `hhs', nogen keep(1 3) + + + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +tostring V0102, replace format(%05.0f) force + +tostring V0103, replace format(%02.0f) force + +egen id_dom = concat(UF V0102 V0103) + + sort id_dom + + lab var id_dom "Household id" + + rename V0301 id_pes + + lab var id_pes "Individual id" + +bys id_dom: egen n_ind_1 = max(id_pes) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pes = id_pes2 if n_ind_same != 0 + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = V4729] + + * 0 instances where HH weight is missing + count if V4729 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + + distinct id_dom id_pes, joint + + * 0 non-distinct household identifiers (never more than one duplicate) + egen id_pnad = concat(id_dom id_pes), format(%24.2g) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + sort dup id_pnad + + gen year = `year' + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_1998" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1998-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1998: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1998-1998: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ +/* A. RIGHT STATES CODE */ +* ADD TOCANTINS WITH GOIÁS + +/* A.1 IN VARIABLE UF AND CREATE VARIABLE OF REGION */ +destring UF, replace +recode UF (17=52) +gen region = int(UF/10) +label var region "region" +tostring UF, replace + + +/* B. V0102 AND SERIAL NUMBER */ +drop V0103 + +/* C. RECODE AND RENAME OF VARIABLES */ + + +/* C.2 CENSITRY AREA */ +rename V4107 area_censit + +/* C.3 RECODE: WEIGHTS */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode weight (-1=.) + +/* C.4 RECODE: TOTAL PEOPLE, TOTAL PEOPLE 10 YEARS OR MORE AND 5 YEARS OR MORE */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode V0105 (-1=.) +recode V0106 (-1=.) +* IN THE YEAR 2001 THERE IS NO TOTAL varIABLE OF PEOPLE 10 YEARS OR MORE, +* BUT TOTAL PEOPLE 5 YEARS OR MORE +replace V0106 = . if year==2001 + +rename V0105 tot_pess +rename V0106 tot_pess_10_more + +/* C.5 RENAME: TYPE OF DOMICILE */ +rename V0201 species_dom + +/* C.6 RENAME: HOUSEHOLD TYPE */ +rename V0202 type_dom + +/* C.7 RECODE: WALL */ +recode V0203 (6=5) (9=.) +rename V0203 wall + +/* C.8 RECODE: COVERAGE */ +recode V0204 (7=6) (9=.) +rename V0204 coverage + +/* C.9 DUMMY: WATER SUPPLY */ +recode V0212 (2=1) (4 6=0) (9=.) +rename V0212 water_rede +replace water_rede = 1 if V0213==1 +replace water_rede = 0 if V0213==3 +label var water_rede "water comes from the network" + +/* C.10 RECODE: SEWER */ +recode V0217 (1=0) (3=2) (5 7=6) (9=.) +rename V0217 sewer +* sewer = 0 general network +* = 2 septic tank +* = 4 rudimentary pit +* = 6 other + +/* C.11 TOILET */ + +* C.11.1 DUMMY: THERE IS A TOILET +recode V0215 (3=0) (9=.) +rename V0215 sanit +label var sanit "has toilet" + +/* C.11.2 DUMMY: EXCLUSIVE TOILET */ +recode V0216 (2=1) (4=0) (9=.) +rename V0216 sanit_excl +label var sanit_excl "domicile sanit excl" + +/* C.12 DUMMY: GARBAGE */ +recode V0218 (2=1) (3/6=0) (9=.) +rename V0218 garbage +label var garbage "garbage is collected" + +/* C.13 DUMMY: ELECTRIC LIGHTING */ +recode V0219 (3 5=0) (9=.) +rename V0219 ilum_eletr +label var ilum_eletr "has electric ilum" + +/* C.14 RECODE: NUMBER OF ROOMS AND DORMITORIES */ +recode V0205 (-1 99=.) +rename V0205 comodos +recode V0206 (-1 99=.) +rename V0206 dormit + +/* C.15 DUMMY: OCCUPANCY CONDITION */ +recode V0207 (2 = 1) (3/6 = 0) (9 = .), gen(possession_dom) +label var possession_dom "domicile possession" +drop V0207 + +/* C.16 RENTAL VALUE / INSTALLMENT */ +recode V0208 V0209 (-1=.) +recode V0208 V0209 (99999999/max=.) +rename V0208 rent +rename V0209 installment + +/* C.17 DUMMY: FILTER */ +recode V0224 (2=1) (4=0) (9=.) +rename V0224 filter + +/* C.18 DUMMY: STOVE */ +recode V0221 (3=0) (9=.) +recode V0222 (2=1) (4=0) (9=.) +gen stove = 1 if V0221 == 1 | V0222 == 1 +replace stove = 0 if V0221 == 0 & V0222 == 0 +replace stove = . if V0221 == . & V0222 == . +label var stove "has stove" +drop V0221 V0222 + +/* C.19 DUMMY: REFRIGERATOR */ +recode V0228 (2 4=1) (6=0) (9=.) +rename V0228 refrigerator + +/* C.20 DUMMY: RADIO */ +recode V0225 (3=0) (9=.) +rename V0225 radio + +/* C.21 DUMMY: TELEVISION */ +recode V0226 (2=1) (4=0) (9=.) +recode V0227 (3=0) (9=.) +gen tv = 1 if V0226 == 1 | V0227 == 1 +replace tv = 0 if V0226 == 0 & V0227 == 0 +replace tv = . if V0226 == . & V0227 == . +label var tv "has television" +drop V0226 V0227 +{ + +*<_urban_> + recode V4105 (1 2 3=1) (4 5 6 7 8=0) + rename V4105 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1998: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr((UF), 1, 1) == "1" + replace subnatid1 = 2 if substr((UF), 1, 1) == "2" + replace subnatid1 = 3 if substr((UF), 1, 1) == "3" + replace subnatid1 = 4 if substr((UF), 1, 1) == "4" + replace subnatid1 = 5 if substr((UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1998: not standardised + Until 1998: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ +destring UF, replace + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & area_censit == 1 + replace subnatid3 = 2 if UF == 23 & area_censit == 1 + replace subnatid3 = 3 if UF == 26 & area_censit == 1 + replace subnatid3 = 4 if UF == 29 & area_censit == 1 + replace subnatid3 = 5 if UF == 31 & area_censit == 1 + replace subnatid3 = 6 if UF == 33 & area_censit == 1 + replace subnatid3 = 7 if UF == 35 & area_censit == 1 + replace subnatid3 = 8 if UF == 41 & area_censit == 1 + replace subnatid3 = 9 if UF == 43 & area_censit == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1998-1998: contains "-1", which should be changed to missing (.) + + */ + rename tot_pess hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1998: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1998: asked to all ages + + Comparability throughout the years is compromised: + 1998: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1998: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1998: one set of values for each of 0-8, 9-11 and 12+ + As of 1998: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1998: "Pre-school" and "School" are considered separately + + As of 1998: "Classe de alfabetização" category is added + 1981 & 1998: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 ) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 9) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1998: "Pre-school" and "School" are considered separately + + As of 1998: "Classe de alfabetização" category is added + 1981 & 1998: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1998: "Pre-school" and "School" are considered separately + + As of 1998: "Classe de alfabetização" category is added + 1981 & 1998: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1998 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1998: "Pre-school" and "School" are considered separately + + 1998: "Classe de alfabetização" category is added + 1981 & 1998: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1998: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1998: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1998: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1998 & 1998): "employed" could be answered by people 5 years or older + + 1998: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1998: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1998: "trabalhadores domésticos" (domestic workers) inexisted + Until 1998: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1998: "production for own consumption" and "construction for own use" exist + As of 1998: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1998: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1998: V4756 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1998 & 1998): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ +gen v0504 = substr(industry_orig,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1998: V4756 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig,2,4) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 +"00" + replace occup_isco = "0100" if occup_isco == "100" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco = "" if occup_isco == ".00" + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 10 if lstatus == 1 & substr(occup_isco, 1, 2) == "01" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1998: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = 1 if V9034 == 2 | V9035 == 1 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1998: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [1998: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." +* replace industry_orig_2 = "45000" if industry_orig_2 == "45999" +* replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_2,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_2 = floor(v9997/10) *100 + tostring industrycat_isic_2, replace + replace industrycat_isic_2 = "0100" if industrycat_isic_2 == "100" + replace industrycat_isic_2 = "0200" if industrycat_isic_2 == "200" + replace industrycat_isic_2 = "0300" if industrycat_isic_2 == "300" + replace industrycat_isic_2 = "0400" if industrycat_isic_2 == "400" + replace industrycat_isic_2 = "0500" if industrycat_isic_2 == "500" + replace industrycat_isic_2 = "5100" if v0504 == "410" + replace industrycat_isic_2 = "5000" if v0504 == "419" + replace industrycat_isic_2 = "5200" if industrycat_isic_2 == "5300" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "." + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + drop _merge v0504 + replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_2,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + + replace occup_isco_2 = "0100" if occup_isco_2 == "100" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == ".00" + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 2) == "01" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1998: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + cap drop V4769 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1998: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1998: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1998 & 1998): "employed" could be answered by people 5 years or older + + 1998: V4763 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1998: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1998: "trabalhadores domésticos" (domestic workers) inexisted + Until 1998: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1998: "production for own consumption" and "construction for own use" exist + As of 1998: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1998: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1998: V4765 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1998 & 1998): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_year,3,3) + + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_year = floor(v9997/10) *100 + tostring industrycat_isic_year, replace + replace industrycat_isic_year = "0100" if industrycat_isic_year == "100" + replace industrycat_isic_year = "0200" if industrycat_isic_year == "200" + replace industrycat_isic_year = "0300" if industrycat_isic_year == "300" + replace industrycat_isic_year = "0400" if industrycat_isic_year == "400" + replace industrycat_isic_year = "0500" if industrycat_isic_year == "500" + replace industrycat_isic_year = "5100" if v0504 == "410" + replace industrycat_isic_year = "5000" if v0504 == "419" + replace industrycat_isic_year = "5200" if industrycat_isic_year == "5300" + replace industrycat_isic_year = "" if industrycat_isic_year == "." + replace industrycat_isic_year = "" if industrycat_isic_year == "00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + drop _merge v0504 + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1998: V4765 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_year,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_year = isco_88 +"00" + replace occup_isco_year = "0100" if occup_isco_year == "100" + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + drop _merge cbo_91 isco_88 + replace occup_isco_year = "" if occup_isco_year == ".00" + replace occup_isco_year = "" if occup_isco_year == "00" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1998: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1998: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 +============================================================================%%*/ + +if `year' >= 1998 { + +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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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' +} + +* +} + +else if `year' < 1998 { + + +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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% DELETE MISSING VARIABLES_> + +quietly: describe, varlist +local kept_vars `r(varlist)' + +foreach var of local kept_vars { + capture assert missing(`var') + if !_rc drop `var' +} + + +*<_% COMPRESS_> + +compress + +* + + +} + +*<_% SAVE_> + + save "`path_output'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_1999_PNAD/BRA_1999_PNAD_V01_M_V02_A_GLD/Programs/BRA_1999_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_1999_PNAD/BRA_1999_PNAD_V01_M_V02_A_GLD/Programs/BRA_1999_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..928cdf364 --- /dev/null +++ b/GLD/BRA/BRA_1999_PNAD/BRA_1999_PNAD_V01_M_V02_A_GLD/Programs/BRA_1999_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2635 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_1999_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 1999 +<_Study ID_> BRA_1999_PNAD_v01_M +<_Data collection from_> 09/1999 +<_Data collection to_> 09/1999 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "1999" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + local year = 1999 + local digitos = substr("`year'", 3, 2) + +* Get some of what you did in the transformation and put it here + + use "`path_in_stata'\individuals_1999.dta" + + + preserve + + use "`path_in_stata'\households_1999.dta", clear + + + tempfile hhs + + save `hhs', replace + + restore + + merge m:1 UF V0102 V0103 using `hhs', nogen keep(1 3) + + + + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +tostring V0102, replace format(%05.0f) force + +tostring V0103, replace format(%02.0f) force + +egen id_dom = concat(UF V0102 V0103) + + sort id_dom + + lab var id_dom "Household id" + + rename V301 id_pes + + lab var id_pes "Individual id" + +bys id_dom: egen n_ind_1 = max(id_pes) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V401 + +bys id_dom: gen id_pes2 = _n + + replace id_pes = id_pes2 if n_ind_same != 0 + + + +*----------2.1.1.1: Checking weights & interview type--------------------------* + +cap gen count = 1 + + * population estimate of 119,7M + tab count [iweight = V4729] + + * 0 instances where HH weight is missing + count if V4729 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + + distinct id_dom id_pes, joint + + * 0 non-distinct household identifiers (never more than one duplicate) + egen id_pnad = concat(id_dom id_pes), format(%24.2g) + sort id_pnad + quietly by id_pnad: gen dup = cond(_N == 1, 0, _n) + count if dup > 1 + + sort dup id_pnad + + gen year = `year' + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_1999" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V101 represents HH number + 1983 & 1990: doesn't exist + + */ + + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V101 is hhid + 1983 & 1990: V101 doesn't exist; V102 & V103 do + 1999-2012: V102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1999: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1999-1999: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ +/* A. RIGHT STATES CODE */ +* ADD TOCANTINS WITH GOIÁS + +/* A.1 IN VARIABLE UF AND CREATE VARIABLE OF REGION */ +destring UF, replace +recode UF (17=52) +gen region = int(UF/10) +label var region "region" +tostring UF, replace + + +/* B. V102 AND SERIAL NUMBER */ +drop V0103 + +/* C. RECODE AND RENAME OF VARIABLES */ + + +/* C.2 CENSITRY AREA */ +rename V4107 area_censit + +/* C.3 RECODE: WEIGHTS */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode weight (-1=.) + +/* C.4 RECODE: TOTAL PEOPLE, TOTAL PEOPLE 10 YEARS OR MORE AND 5 YEARS OR MORE */ +* BETWEEN 92 AND 2001, "-1" SEEMS TO BE == MISSING +recode V0105 (-1=.) +recode V0106 (-1=.) +* IN THE YEAR 2001 THERE IS NO TOTAL varIABLE OF PEOPLE 10 YEARS OR MORE, +* BUT TOTAL PEOPLE 5 YEARS OR MORE +replace V0106 = . if year==2001 + +rename V0105 tot_pess +rename V0106 tot_pess_10_more + +/* C.5 RENAME: TYPE OF DOMICILE */ +rename V0201 species_dom + +/* C.6 RENAME: HOUSEHOLD TYPE */ +rename V0202 type_dom + +/* C.7 RECODE: WALL */ +recode V0203 (6=5) (9=.) +rename V0203 wall + +/* C.8 RECODE: COVERAGE */ +recode V0204 (7=6) (9=.) +rename V0204 coverage + +/* C.9 DUMMY: WATER SUPPLY */ +recode V0212 (2=1) (4 6=0) (9=.) +rename V0212 water_rede +replace water_rede = 1 if V0213==1 +replace water_rede = 0 if V0213==3 +label var water_rede "water comes from the network" + +/* C.10 RECODE: SEWER */ +recode V0217 (1=0) (3=2) (5 7=6) (9=.) +rename V0217 sewer +* sewer = 0 general network +* = 2 septic tank +* = 4 rudimentary pit +* = 6 other + +/* C.11 TOILET */ + +* C.11.1 DUMMY: THERE IS A TOILET +recode V0215 (3=0) (9=.) +rename V0215 sanit +label var sanit "has toilet" + +/* C.11.2 DUMMY: EXCLUSIVE TOILET */ +recode V0216 (2=1) (4=0) (9=.) +rename V0216 sanit_excl +label var sanit_excl "domicile sanit excl" + +/* C.12 DUMMY: GARBAGE */ +recode V0218 (2=1) (3/6=0) (9=.) +rename V0218 garbage +label var garbage "garbage is collected" + +/* C.13 DUMMY: ELECTRIC LIGHTING */ +recode V0219 (3 5=0) (9=.) +rename V0219 ilum_eletr +label var ilum_eletr "has electric ilum" + +/* C.14 RECODE: NUMBER OF ROOMS AND DORMITORIES */ +recode V0205 (-1 99=.) +rename V0205 comodos +recode V0206 (-1 99=.) +rename V0206 dormit + +/* C.15 DUMMY: OCCUPANCY CONDITION */ +recode V0207 (2 = 1) (3/6 = 0) (9 = .), gen(possession_dom) +label var possession_dom "domicile possession" +drop V0207 + +/* C.16 RENTAL VALUE / INSTALLMENT */ +recode V0208 V0209 (-1=.) +recode V0208 V0209 (99999999/max=.) +rename V0208 rent +rename V0209 installment + +/* C.17 DUMMY: FILTER */ +recode V0224 (2=1) (4=0) (9=.) +rename V0224 filter + +/* C.18 DUMMY: STOVE */ +recode V0221 (3=0) (9=.) +recode V0222 (2=1) (4=0) (9=.) +gen stove = 1 if V0221 == 1 | V0222 == 1 +replace stove = 0 if V0221 == 0 & V0222 == 0 +replace stove = . if V0221 == . & V0222 == . +label var stove "has stove" +drop V0221 V0222 + +/* C.19 DUMMY: REFRIGERATOR */ +recode V0228 (2 4=1) (6=0) (9=.) +rename V0228 refrigerator + +/* C.20 DUMMY: RADIO */ +recode V0225 (3=0) (9=.) +rename V0225 radio + +/* C.21 DUMMY: TELEVISION */ +recode V0226 (2=1) (4=0) (9=.) +recode V0227 (3=0) (9=.) +gen tv = 1 if V0226 == 1 | V0227 == 1 +replace tv = 0 if V0226 == 0 & V0227 == 0 +replace tv = . if V0226 == . & V0227 == . +label var tv "has television" +drop V0226 V0227 +{ + +*<_urban_> + recode V4105 (1 2 3=1) (4 5 6 7 8=0) + rename V4105 urban + label var urban "Location is urban" + la de lblurban 1 "Urban" 0 "Rural" + label values urban lblurban +* + + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1999: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr((UF), 1, 1) == "1" + replace subnatid1 = 2 if substr((UF), 1, 1) == "2" + replace subnatid1 = 3 if substr((UF), 1, 1) == "3" + replace subnatid1 = 4 if substr((UF), 1, 1) == "4" + replace subnatid1 = 5 if substr((UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1999: not standardised + Until 1999: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ +destring UF, replace + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & area_censit == 1 + replace subnatid3 = 2 if UF == 23 & area_censit == 1 + replace subnatid3 = 3 if UF == 26 & area_censit == 1 + replace subnatid3 = 4 if UF == 29 & area_censit == 1 + replace subnatid3 = 5 if UF == 31 & area_censit == 1 + replace subnatid3 = 6 if UF == 33 & area_censit == 1 + replace subnatid3 = 7 if UF == 35 & area_censit == 1 + replace subnatid3 = 8 if UF == 41 & area_censit == 1 + replace subnatid3 = 9 if UF == 43 & area_censit == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1999-1999: contains "-1", which should be changed to missing (.) + + */ + rename tot_pess hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1999: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V504 (2 = 0) (4 = 1) (9 = .) + recode V511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V504*V511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V511 == 1 + replace migrated_from_cat = 2 if V504 == 1 + replace migrated_from_cat = 3 if V504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V511 V504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1999: asked to all ages + + Comparability throughout the years is compromised: + 1999: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1999: "Pre-school" and "School" are considered separately + + */ + gen school = V602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V601 (3 = 0) (1 = 1) + rename V601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1999: one set of values for each of 0-8, 9-11 and 12+ + As of 1999: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V607 == 7 & V610 == 2 + replace educy = 18 if V607 == 7 & V610 == 3 + replace educy = 19 if V607 == 7 & V610 >= 4 & V610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1999: "Pre-school" and "School" are considered separately + + As of 1999: "Classe de alfabetização" category is added + 1981 & 1999: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V603 == 1 | V603 == 3 | V603 == 6 | V603 == 7 ) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V603 == 2 | V603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V603 == 5 | V603 == 9) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1999: "Pre-school" and "School" are considered separately + + As of 1999: "Classe de alfabetização" category is added + 1981 & 1999: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1999: "Pre-school" and "School" are considered separately + + As of 1999: "Classe de alfabetização" category is added + 1981 & 1999: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 1999 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 1999: "Pre-school" and "School" are considered separately + + 1999: "Classe de alfabetização" category is added + 1981 & 1999: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1999: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1999: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 1999: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1999 & 1999): "employed" could be answered by people 5 years or older + + 1999: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1999: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1999: "trabalhadores domésticos" (domestic workers) inexisted + Until 1999: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1999: "production for own consumption" and "construction for own use" exist + As of 1999: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1999: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1999: V4756 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1999 & 1999): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ +gen v0504 = substr(industry_orig,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1999: V4756 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig,2,4) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 +"00" + replace occup_isco = "0100" if occup_isco == "100" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco = "" if occup_isco == ".00" + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 10 if lstatus == 1 & substr(occup_isco, 1, 2) == "01" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1999: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = 1 if V9034 == 2 | V9035 == 1 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1999: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [1999: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." +* replace industry_orig_2 = "45000" if industry_orig_2 == "45999" +* replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_2,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_2 = floor(v9997/10) *100 + tostring industrycat_isic_2, replace + replace industrycat_isic_2 = "0100" if industrycat_isic_2 == "100" + replace industrycat_isic_2 = "0200" if industrycat_isic_2 == "200" + replace industrycat_isic_2 = "0300" if industrycat_isic_2 == "300" + replace industrycat_isic_2 = "0400" if industrycat_isic_2 == "400" + replace industrycat_isic_2 = "0500" if industrycat_isic_2 == "500" + replace industrycat_isic_2 = "5100" if v0504 == "410" + replace industrycat_isic_2 = "5000" if v0504 == "419" + replace industrycat_isic_2 = "5200" if industrycat_isic_2 == "5300" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "." + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + drop _merge v0504 + replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_2,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + + replace occup_isco_2 = "0100" if occup_isco_2 == "100" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == ".00" + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 2) == "01" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1999: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + cap drop V4769 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1999: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1999: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1999 & 1999): "employed" could be answered by people 5 years or older + + 1999: V4763 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1999: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1999: "trabalhadores domésticos" (domestic workers) inexisted + Until 1999: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1999: "production for own consumption" and "construction for own use" exist + As of 1999: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 1999: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 1999: V4765 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1999 & 1999): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_year,3,3) + + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_year = floor(v9997/10) *100 + tostring industrycat_isic_year, replace + replace industrycat_isic_year = "0100" if industrycat_isic_year == "100" + replace industrycat_isic_year = "0200" if industrycat_isic_year == "200" + replace industrycat_isic_year = "0300" if industrycat_isic_year == "300" + replace industrycat_isic_year = "0400" if industrycat_isic_year == "400" + replace industrycat_isic_year = "0500" if industrycat_isic_year == "500" + replace industrycat_isic_year = "5100" if v0504 == "410" + replace industrycat_isic_year = "5000" if v0504 == "419" + replace industrycat_isic_year = "5200" if industrycat_isic_year == "5300" + replace industrycat_isic_year = "" if industrycat_isic_year == "." + replace industrycat_isic_year = "" if industrycat_isic_year == "00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + drop _merge v0504 + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 1999: V4765 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_year,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_year = isco_88 +"00" + replace occup_isco_year = "0100" if occup_isco_year == "100" + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + drop _merge cbo_91 isco_88 + replace occup_isco_year = "" if occup_isco_year == ".00" + replace occup_isco_year = "" if occup_isco_year == "00" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 1999: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1999: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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 +============================================================================%%*/ + +if `year' >= 1999 { + +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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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' +} + +* +} + +else if `year' < 1999 { + + +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 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 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2001_PNAD/BRA_2001_PNAD_V01_M_V02_A_GLD/Programs/BRA_2001_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2001_PNAD/BRA_2001_PNAD_V01_M_V02_A_GLD/Programs/BRA_2001_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..9bc125c48 --- /dev/null +++ b/GLD/BRA/BRA_2001_PNAD/BRA_2001_PNAD_V01_M_V02_A_GLD/Programs/BRA_2001_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2386 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2001_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2001 +<_Study ID_> BRA_2001_PNAD_v01_M +<_Data collection from_> 09/2001 +<_Data collection to_> 09/2001 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "2001" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2001.dta" + merge 1:m id_dom using "`path_in_stata'\pp2001.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + +bys id_dom: egen n_ind_1 = max(id_pess) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename PSU psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 | V0603 == 8) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 10) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4764 == 1 & age >= minlaborage + replace lstatus = 2 if V4764 == 2 & age >= minlaborage + replace lstatus = 3 if V4754 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4754 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename V4756 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ +gen v0504 = substr(industry_orig,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic = floor(v9997/10) *100 + tostring industrycat_isic, replace + replace industrycat_isic = "0100" if industrycat_isic == "100" + replace industrycat_isic = "0200" if industrycat_isic == "200" + replace industrycat_isic = "0300" if industrycat_isic == "300" + replace industrycat_isic = "0400" if industrycat_isic == "400" + replace industrycat_isic = "0500" if industrycat_isic == "500" + replace industrycat_isic = "5100" if v0504 == "410" + replace industrycat_isic = "5000" if v0504 == "419" + replace industrycat_isic = "5200" if industrycat_isic == "5300" + replace industrycat_isic = "" if industrycat_isic == "." + replace industrycat_isic = "" if industrycat_isic == "00" + label variable industrycat_isic "ISIC code of primary job 7 day recall" + drop _merge v0504 + replace industrycat_isic = "" if industrycat_isic == "" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4756 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig,2,4) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 +"00" + replace occup_isco = "0100" if occup_isco == "100" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco = "" if occup_isco == ".00" + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_2,3,3) + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_2 = floor(v9997/10) *100 + tostring industrycat_isic_2, replace + replace industrycat_isic_2 = "0100" if industrycat_isic_2 == "100" + replace industrycat_isic_2 = "0200" if industrycat_isic_2 == "200" + replace industrycat_isic_2 = "0300" if industrycat_isic_2 == "300" + replace industrycat_isic_2 = "0400" if industrycat_isic_2 == "400" + replace industrycat_isic_2 = "0500" if industrycat_isic_2 == "500" + replace industrycat_isic_2 = "5100" if v0504 == "410" + replace industrycat_isic_2 = "5000" if v0504 == "419" + replace industrycat_isic_2 = "5200" if industrycat_isic_2 == "5300" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "." + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + drop _merge v0504 + replace industrycat_isic_2 = "" if industrycat_isic_2 == "" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_2,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + + replace occup_isco_2 = "0100" if occup_isco_2 == "100" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge cbo_91 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == ".00" + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4769 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4764 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4764 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4763 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4764 V4763 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4765 is V4765 + + */ + gen empstat_year = V4765 + recode empstat_year (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen v0504 = substr(industry_orig_year,3,3) + + + tostring v0504, replace + + forv i = 1(1)99 { + + if `i' >= 1 & `i' <= 9 { + replace v0504 = "00`i'" if v0504 == "`i'" + } + else if `i' >= 10 & `i' <= 99 { + replace v0504 = "0`i'" if v0504 == "`i'" + } + + + } + + merge m:1 v0504 using "`path_in_stata'\Ind_Corresp_198090s.dta" + drop if _merge == 2 + gen industrycat_isic_year = floor(v9997/10) *100 + tostring industrycat_isic_year, replace + replace industrycat_isic_year = "0100" if industrycat_isic_year == "100" + replace industrycat_isic_year = "0200" if industrycat_isic_year == "200" + replace industrycat_isic_year = "0300" if industrycat_isic_year == "300" + replace industrycat_isic_year = "0400" if industrycat_isic_year == "400" + replace industrycat_isic_year = "0500" if industrycat_isic_year == "500" + replace industrycat_isic_year = "5100" if v0504 == "410" + replace industrycat_isic_year = "5000" if v0504 == "419" + replace industrycat_isic_year = "5200" if industrycat_isic_year == "5300" + replace industrycat_isic_year = "" if industrycat_isic_year == "." + replace industrycat_isic_year = "" if industrycat_isic_year == "00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + drop _merge v0504 + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4765 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen cbo_91 = substr(occup_orig_year,2,3) + merge m:1 cbo_91 using "`path_in_stata'\isco_88_cbo_91_DD.dta" + drop if _merge == 2 + gen occup_isco_year = isco_88 +"00" + replace occup_isco_year = "0100" if occup_isco_year == "100" + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + drop _merge cbo_91 isco_88 + replace occup_isco_year = "" if occup_isco_year == ".00" + replace occup_isco_year = "" if occup_isco_year == "00" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4765 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + *replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + *replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + *replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + *replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + *replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + *replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + *replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + *replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + *replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + *replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + *replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + *replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + *replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2002_PNAD/BRA_2002_PNAD_V01_M_V02_A_GLD/Programs/BRA_2002_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2002_PNAD/BRA_2002_PNAD_V01_M_V02_A_GLD/Programs/BRA_2002_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..b556b6566 --- /dev/null +++ b/GLD/BRA/BRA_2002_PNAD/BRA_2002_PNAD_V01_M_V02_A_GLD/Programs/BRA_2002_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2291 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2002_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2003 +<_Study ID_> BRA_2003_PNAD_v01_M +<_Data collection from_> 09/2003 +<_Data collection to_> 09/2003 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "2002" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2002.dta" + merge 1:m id_dom using "`path_in_stata'\pp2002.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + +bys id_dom: egen n_ind_1 = max(id_pess) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2003" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename PSU psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2003: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 | V0603 == 8) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 10) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2003: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2003: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2003 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2003: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4705 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4704 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +{ +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2003: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2003: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4706 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + replace V9907 = 51000 if (V9907 == 53010 | V9907 == 53020 | V9907 == 53067 | V9907 == 53066) + replace V9907 = 52000 if V9907 != 51000 & floor(V9907/1000) == 53 + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic = substr(industry_orig,1,2)+"00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + replace industrycat_isic = "" if industrycat_isic == "00" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4706 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen v9996 = occup_orig + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88+"00" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + replace V9991 = 51000 if (V9991 == 53010 | V9991 == 53020 | V9991 == 53067 | V9991 == 53066) + replace V9991 = 52000 if V9991 != 51000 & floor(V9991/1000) == 53 + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2 = substr(industry_orig_2,1,2)+"00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen v9996 = occup_orig_2 + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4719*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4719 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4714 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4713 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2003: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2003: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4715 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_year = substr(industry_orig_year,1,2)+"00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + replace industrycat_isic_year = "" if industrycat_isic_year == "00" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4715 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen occup_isco_year = occup_isco + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + replace occup_isco_year = "" if occup_isco_year == "" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = occup_isco_2 + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2003_PNAD/BRA_2003_PNAD_V01_M_V02_A_GLD/Programs/BRA_2003_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2003_PNAD/BRA_2003_PNAD_V01_M_V02_A_GLD/Programs/BRA_2003_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..f27dbd9af --- /dev/null +++ b/GLD/BRA/BRA_2003_PNAD/BRA_2003_PNAD_V01_M_V02_A_GLD/Programs/BRA_2003_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2286 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2003_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2003 +<_Study ID_> BRA_2003_PNAD_v01_M +<_Data collection from_> 09/2003 +<_Data collection to_> 09/2003 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "2003" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2003.dta" + merge 1:m id_dom using "`path_in_stata'\pp2003.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + +bys id_dom: egen n_ind_1 = max(id_pess) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2003" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename V4618 psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2003: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 | V0603 == 8) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 10) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2003: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2003: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2003 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2003: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4705 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4704 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +{ +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2003: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2003: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4706 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + replace V9907 = 51000 if (V9907 == 53010 | V9907 == 53020 | V9907 == 53067 | V9907 == 53066) + replace V9907 = 52000 if V9907 != 51000 & floor(V9907/1000) == 53 + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic = substr(industry_orig,1,2)+"00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + replace industrycat_isic = "" if industrycat_isic == "00" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4706 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen v9996 = occup_orig + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88+"00" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + replace V9991 = 51000 if (V9991 == 53010 | V9991 == 53020 | V9991 == 53067 | V9991 == 53066) + replace V9991 = 52000 if V9991 != 51000 & floor(V9991/1000) == 53 + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2 = substr(industry_orig_2,1,2)+"00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen v9996 = occup_orig_2 + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4719*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4719 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4714 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4713 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2003: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2003: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4715 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (11 = 2) (10 = 3) (9 12/13 = 4) (14 = .) + + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_year = industrycat_isic + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4715 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen occup_isco_year = occup_isco + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + replace occup_isco_year = "" if occup_isco_year == "" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = occup_isco_2 + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2004_PNAD/BRA_2004_PNAD_V01_M_V02_A_GLD/Programs/BRA_2004_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2004_PNAD/BRA_2004_PNAD_V01_M_V02_A_GLD/Programs/BRA_2004_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..292bdb791 --- /dev/null +++ b/GLD/BRA/BRA_2004_PNAD/BRA_2004_PNAD_V01_M_V02_A_GLD/Programs/BRA_2004_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2288 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2004_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2004 +<_Study ID_> BRA_2004_PNAD_v01_M +<_Data collection from_> 09/2004 +<_Data collection to_> 09/2004 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "2004" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2004.dta" + merge 1:m id_dom using "`path_in_stata'\pp2004.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + +bys id_dom: egen n_ind_1 = max(id_pess) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2003" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename V4618 psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2004: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 | V0603 == 8) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 10) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2004: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2004: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2004 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2004: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4705 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4704 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +{ +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2004: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2004: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4706 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + replace V9907 = 51000 if (V9907 == 53010 | V9907 == 53020 | V9907 == 53067 | V9907 == 53066) + replace V9907 = 52000 if V9907 != 51000 & floor(V9907/1000) == 53 + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic = substr(industry_orig,1,2)+"00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + replace industrycat_isic = "" if industrycat_isic == "00" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4706 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen v9996 = occup_orig + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88+"00" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9=.) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + replace V9991 = 51000 if (V9991 == 53010 | V9991 == 53020 | V9991 == 53067 | V9991 == 53066) + replace V9991 = 52000 if V9991 != 51000 & floor(V9991/1000) == 53 + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + gen industrycat_isic_2 = substr(industry_orig_2,1,2)+"00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen v9996 = occup_orig_2 + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88 + "00" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4719*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4719 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4714 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4713 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2003: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2003: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4715 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (11 = 2) (10 = 3) (9 12/13 = 4) (14 = .) + + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_year = substr(industry_orig_year,1,2)+"00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + replace industrycat_isic_year = "" if industrycat_isic_year == "00" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4715 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen occup_isco_year = occup_isco + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + replace occup_isco_year = "" if occup_isco_year == "" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = occup_isco_2 + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2005_PNAD/BRA_2005_PNAD_V01_M_V03_A_GLD/Programs/BRA_2005_PNAD_V01_M_V03_A_GLD_ALL.do b/GLD/BRA/BRA_2005_PNAD/BRA_2005_PNAD_V01_M_V03_A_GLD/Programs/BRA_2005_PNAD_V01_M_V03_A_GLD_ALL.do new file mode 100644 index 000000000..dc6fa3697 --- /dev/null +++ b/GLD/BRA/BRA_2005_PNAD/BRA_2005_PNAD_V01_M_V03_A_GLD/Programs/BRA_2005_PNAD_V01_M_V03_A_GLD_ALL.do @@ -0,0 +1,2288 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2005_PNAD_V01_M_V03_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2005 +<_Study ID_> BRA_2005_PNAD_v01_M +<_Data collection from_> 09/2005 +<_Data collection to_> 09/2005 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2023 / 01 / 11 - Update educat7 (and thus educat5, 4) +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2: Set directories------------------------------* + +* Define path sections +local server "Y:/GLD" +local country "BRA" +local year "2005" +local survey "PNAD" +local vermast "v01" + local veralt "V03" + +* From the definitions, set path chunks +local level_1 "`country'_`year'_`survey'" +local level_2_mast "`level_1'_`vermast'_M" +local level_2_harm "`level_1'_`vermast'_M_`veralt'_A_GLD" + +* From chunks, define path_in, path_output folder +local path_in_stata "`server'/`country'/`level_1'/`level_2_mast'/Data/Stata" +local path_in_other "`server'/`country'/`level_1'/`level_2_mast'/Data/Original" +local path_output "`server'/`country'/`level_1'/`level_2_harm'/Data/Harmonized" + +* Define Output file name +local out_file "`level_2_harm'_ALL.dta" + + +*----------1.3 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2005.dta" + merge 1:m id_dom using "`path_in_stata'\pp2005.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + +bys id_dom: egen n_ind_1 = max(id_pess) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2003" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename V4618 psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2005: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 | V0603 == 8) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 10) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2005: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2005: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2005 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2005: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4705 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4704 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +{ +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2005: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2005: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4706 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + replace V9907 = 51000 if (V9907 == 53010 | V9907 == 53020 | V9907 == 53067 | V9907 == 53066) + replace V9907 = 52000 if V9907 != 51000 & floor(V9907/1000) == 53 + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic = substr(industry_orig,1,2)+"00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + replace industrycat_isic = "" if industrycat_isic == "00" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4706 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen v9996 = occup_orig + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88+"00" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + replace V9991 = 51000 if (V9991 == 53010 | V9991 == 53020 | V9991 == 53067 | V9991 == 53066) + replace V9991 = 52000 if V9991 != 51000 & floor(V9991/1000) == 53 + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + gen industrycat_isic_2 = substr(industry_orig_2,1,2)+"00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen v9996 = occup_orig_2 + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88 + "00" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4719*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4719 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4714 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4713 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2003: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2003: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4715 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (11 = 2) (10 = 3) (9 12/13 = 4) (14 = .) + + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_year = substr(industry_orig_year,1,2)+"00" + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + replace industrycat_isic_year = "" if industrycat_isic_year == "00" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4715 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + + gen occup_isco_year = occup_isco + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + replace occup_isco_year = "" if occup_isco_year == "" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = occup_isco_2 + *merge m:1 cbo using "`path_input'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + clear + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2006_PNAD/BRA_2006_PNAD_V01_M_V02_A_GLD/Programs/BRA_2006_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2006_PNAD/BRA_2006_PNAD_V01_M_V02_A_GLD/Programs/BRA_2006_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..ca803ac0f --- /dev/null +++ b/GLD/BRA/BRA_2006_PNAD/BRA_2006_PNAD_V01_M_V02_A_GLD/Programs/BRA_2006_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2286 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2006_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2006 +<_Study ID_> BRA_2006_PNAD_v01_M +<_Data collection from_> 09/2006 +<_Data collection to_> 09/2006 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "2006" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2006.dta" + merge 1:m id_dom using "`path_in_stata'\pp2006.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + +bys id_dom: egen n_ind_1 = max(id_pess) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2003" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename V4618 psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4703 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4703 + + replace educy = 17 if V0607 == 7 & V0610 == 2 + replace educy = 18 if V0607 == 7 & V0610 == 3 + replace educy = 19 if V0607 == 7 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2006: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V0603 == 1 | V0603 == 3 | V0603 == 6 | V0603 == 7 | V0603 == 8) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V0603 == 2 | V0603 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V0603 == 5 | V0603 == 10) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2006: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2006: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2006 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2006: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4705 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4704 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4705 == 1 & age >= minlaborage + replace lstatus = 2 if V4705 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +{ +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2006: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2006: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4706 is V4756 + + */ + rename V4706 empstat + recode empstat (1/8 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) (14 = .) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + replace V9907 = 51000 if (V9907 == 53010 | V9907 == 53020 | V9907 == 53067 | V9907 == 53066) + replace V9907 = 52000 if V9907 != 51000 & floor(V9907/1000) == 53 + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic = substr(industry_orig,1,2)+"00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + replace industrycat_isic = "" if industrycat_isic == "00" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4706 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen v9996 = occup_orig + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 + "00" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) (9 = .) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) (9 = .) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) (9 = .) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + replace V9991 = 51000 if (V9991 == 53010 | V9991 == 53020 | V9991 == 53067 | V9991 == 53066) + replace V9991 = 52000 if V9991 != 51000 & floor(V9991/1000) == 53 + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2 = substr(industry_orig_2,1,2)+"00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen v9996 = occup_orig_2 + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88+"00" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4719*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4719 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4714 was V4714 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4713 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4714 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4714 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4714 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2003: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2003: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4715 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/8 = 1) (11 = 2) (10 = 3) (9 12/13 = 4) (14 = .) + + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_year = industrycat_isic + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4715 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen occup_isco_year = occup_isco + label variable occup_isco_year "ISCO code of secondary job 12 month recall" + replace occup_isco_year = "" if occup_isco_year == "" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 6 = 1) (4 5 7 8/13 = 0) (14 = .) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) (9 = .) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = occup_isco_2 + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "1" | substr(occup_isco_2_year, 1, 1) == "2" | substr(occup_isco_2_year, 1, 1) == "3") + replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(occup_isco_2_year, 1, 1) == "4" | substr(occup_isco_2_year, 1, 1) == "5" | substr(occup_isco_2_year, 1, 1) == "6" | substr(occup_isco_2_year, 1, 1) == "7" | substr(occup_isco_2_year, 1, 1) == "8") + replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + replace occup_2_year = 1 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "1" + replace occup_2_year = 2 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "2" + replace occup_2_year = 3 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "3" + replace occup_2_year = 4 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "4" + replace occup_2_year = 5 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "5" + replace occup_2_year = 6 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "6" + replace occup_2_year = 7 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "7" + replace occup_2_year = 8 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "8" + replace occup_2_year = 9 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "9" + replace occup_2_year = 0 if lstatus_year == 1 & substr(occup_isco_2_year, 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2007_PNAD/BRA_2007_PNAD_V01_M_V02_A_GLD/Programs/BRA_2007_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2007_PNAD/BRA_2007_PNAD_V01_M_V02_A_GLD/Programs/BRA_2007_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..63ffb69ba --- /dev/null +++ b/GLD/BRA/BRA_2007_PNAD/BRA_2007_PNAD_V01_M_V02_A_GLD/Programs/BRA_2007_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2286 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2007_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2007 +<_Study ID_> BRA_2007_PNAD_v01_M +<_Data collection from_> 09/2007 +<_Data collection to_> 09/2007 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "2007" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2007.dta" + merge 1:m id_dom using "`path_in_stata'\pp2007.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + +bys id_dom: egen n_ind_1 = max(id_pess) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2007" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename V4618 psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + +{ + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4803 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4803 + + replace educy = 17 if V6007 == 9 & V0610 == 2 + replace educy = 18 if V6007 == 9 & V0610 == 3 + replace educy = 19 if V6007 == 9 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V6003 == 1 | V6003 == 3 | V6003 == 6 | V6003 == 7 | V6003 == 8 | V6003 == 9) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V6003 == 2 | V6003 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V6003 == 5 | V6003 == 11) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2007 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + +} + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4805 was V4705 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4704 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4805 == 1 & age >= minlaborage + replace lstatus = 2 if V4805 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4805 V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job---------------------------------------* + + +{ +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2007: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2007: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4706 is V4756 + + */ + rename V4706 empstat + recode empstat (1/7 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + replace V9907 = 51000 if (V9907 == 53010 | V9907 == 53020 | V9907 == 53067 | V9907 == 53066) + replace V9907 = 52000 if V9907 != 51000 & floor(V9907/1000) == 53 + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic = substr(industry_orig,1,2)+"00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + replace industrycat_isic = "" if industrycat_isic == "00" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4706 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen v9996 = occup_orig + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 + "00" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + replace V9991 = 51000 if (V9991 == 53010 | V9991 == 53020 | V9991 == 53067 | V9991 == 53066) + replace V9991 = 52000 if V9991 != 51000 & floor(V9991/1000) == 53 + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2 = substr(industry_orig_2,1,2)+"00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen v9996 = occup_orig_2 + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88 + "00" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4719*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4719 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4814 was V4714 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4713 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4814 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4814 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4814 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* +} + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2007: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2007: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4715 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/7 = 1) (11 = 2) (10 = 3) (9 12/13 = 4) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_year =industrycat_isic + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4715 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen occup_isco_year = occup_isco + + replace occup_isco_year = "" if occup_isco_year == "" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 = 1) (4 6/7 9/13 = 0) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(string(occup_isco_2_year), 1, 1) == "1" | substr(string(occup_isco_2_year), 1, 1) == "2" | substr(string(occup_isco_2_year), 1, 1) == "3") + replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(string(occup_isco_2_year), 1, 1) == "4" | substr(string(occup_isco_2_year), 1, 1) == "5" | substr(string(occup_isco_2_year), 1, 1) == "6" | substr(string(occup_isco_2_year), 1, 1) == "7" | substr(string(occup_isco_2_year), 1, 1) == "8") + replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + replace occup_2_year = 1 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "1" + replace occup_2_year = 2 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "2" + replace occup_2_year = 3 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "3" + replace occup_2_year = 4 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "4" + replace occup_2_year = 5 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "5" + replace occup_2_year = 6 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "6" + replace occup_2_year = 7 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "7" + replace occup_2_year = 8 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "8" + replace occup_2_year = 9 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "9" + replace occup_2_year = 0 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2008_PNAD/BRA_2008_PNAD_V01_M_V02_A_GLD/Programs/BRA_2008_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2008_PNAD/BRA_2008_PNAD_V01_M_V02_A_GLD/Programs/BRA_2008_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..4ee8ab1bb --- /dev/null +++ b/GLD/BRA/BRA_2008_PNAD/BRA_2008_PNAD_V01_M_V02_A_GLD/Programs/BRA_2008_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2287 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2008_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2008 +<_Study ID_> BRA_2008_PNAD_v01_M +<_Data collection from_> 09/2008 +<_Data collection to_> 09/2008 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,895 +<_Sample size (IND)_> 391,868 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "2008" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2008.dta" + merge 1:m id_dom using "`path_in_stata'\pp2008.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + +bys id_dom: egen n_ind_1 = max(id_pess) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2008" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename V4618 psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + +{ + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4803 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4803 + + replace educy = 17 if V6007 == 9 & V0610 == 2 + replace educy = 18 if V6007 == 9 & V0610 == 3 + replace educy = 19 if V6007 == 9 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V6003 == 1 | V6003 == 3 | V6003 == 6 | V6003 == 7 | V6003 == 8 | V6003 == 9) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V6003 == 2 | V6003 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V6003 == 5 | V6003 == 11) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2008 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + +} + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4805 was V4705 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4704 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4805 == 1 & age >= minlaborage + replace lstatus = 2 if V4805 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4805 V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job---------------------------------------* + + +{ +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2007: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2007: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4706 is V4756 + + */ + rename V4706 empstat + recode empstat (1/7 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + replace V9907 = 51000 if (V9907 == 53010 | V9907 == 53020 | V9907 == 53067 | V9907 == 53066) + replace V9907 = 52000 if V9907 != 51000 & floor(V9907/1000) == 53 + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic = substr(industry_orig,1,2)+"00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + replace industrycat_isic = "" if industrycat_isic == "00" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4706 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen v9996 = occup_orig + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 + "00" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + replace V9991 = 51000 if (V9991 == 53010 | V9991 == 53020 | V9991 == 53067 | V9991 == 53066) + replace V9991 = 52000 if V9991 != 51000 & floor(V9991/1000) == 53 + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + + gen industrycat_isic_2 = substr(industry_orig_2,1,2)+"00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen v9996 = occup_orig_2 + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88 + "00" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4719*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4719 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4814 was V4714 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4713 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4814 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4814 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4814 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* +} + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2007: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2007: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4715 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/7 = 1) (11 = 2) (10 = 3) (9 12/13 = 4) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_year = industrycat_isic + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4715 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen occup_isco_year = occup_isco + + replace occup_isco_year = "" if occup_isco_year == "" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 = 1) (4 6/7 9/13 = 0) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(string(occup_isco_2_year), 1, 1) == "1" | substr(string(occup_isco_2_year), 1, 1) == "2" | substr(string(occup_isco_2_year), 1, 1) == "3") + replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(string(occup_isco_2_year), 1, 1) == "4" | substr(string(occup_isco_2_year), 1, 1) == "5" | substr(string(occup_isco_2_year), 1, 1) == "6" | substr(string(occup_isco_2_year), 1, 1) == "7" | substr(string(occup_isco_2_year), 1, 1) == "8") + replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + replace occup_2_year = 1 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "1" + replace occup_2_year = 2 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "2" + replace occup_2_year = 3 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "3" + replace occup_2_year = 4 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "4" + replace occup_2_year = 5 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "5" + replace occup_2_year = 6 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "6" + replace occup_2_year = 7 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "7" + replace occup_2_year = 8 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "8" + replace occup_2_year = 9 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "9" + replace occup_2_year = 0 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2009_PNAD/BRA_2009_PNAD_V01_M_V02_A_GLD/Programs/BRA_2009_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2009_PNAD/BRA_2009_PNAD_V01_M_V02_A_GLD/Programs/BRA_2009_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..1ea287eb8 --- /dev/null +++ b/GLD/BRA/BRA_2009_PNAD/BRA_2009_PNAD_V01_M_V02_A_GLD/Programs/BRA_2009_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2286 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2009_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2009 +<_Study ID_> BRA_2009_PNAD_v01_M +<_Data collection from_> 09/2009 +<_Data collection to_> 09/2009 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 120,910 +<_Sample size (IND)_> 399,387 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "2009" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2009.dta" + merge 1:m id_dom using "`path_in_stata'\pp2009.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + +bys id_dom: egen n_ind_1 = max(id_pess) + +bys id_dom: egen n_ind_2 = max(_N) + +gen n_ind_same = n_ind_1 - n_ind_2 + +tab n_ind_same + + sort id_dom V0401 + +bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2009" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename V4618 psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + *rename V4011 marital + *recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + *replace marital = 3 if marital == . & V4111 == 1 + *recast byte marital + *label variable marital "Marital status" + *label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + *label values marital marital_lab + *drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + +{ + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4803 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4803 + + replace educy = 17 if V6007 == 9 & V0610 == 2 + replace educy = 18 if V6007 == 9 & V0610 == 3 + replace educy = 19 if V6007 == 9 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V6003 == 1 | V6003 == 3 | V6003 == 6 | V6003 == 7 | V6003 == 8 | V6003 == 9) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V6003 == 2 | V6003 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V6003 == 5 | V6003 == 11) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2009 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + +} + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4805 was V4705 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4704 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4805 == 1 & age >= minlaborage + replace lstatus = 2 if V4805 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4805 V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job---------------------------------------* + + +{ +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2007: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2007: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4706 is V4756 + + */ + rename V4706 empstat + recode empstat (1/7 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + replace V9907 = 51000 if (V9907 == 53010 | V9907 == 53020 | V9907 == 53067 | V9907 == 53066) + replace V9907 = 52000 if V9907 != 51000 & floor(V9907/1000) == 53 + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic = substr(industry_orig,1,2)+"00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + replace industrycat_isic = "" if industrycat_isic == "00" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4706 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen v9996 = occup_orig + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88 + "00" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + replace V9991 = 51000 if (V9991 == 53010 | V9991 == 53020 | V9991 == 53067 | V9991 == 53066) + replace V9991 = 52000 if V9991 != 51000 & floor(V9991/1000) == 53 + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2 = substr(industry_orig_2,1,2)+"00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen v9996 = occup_orig_2 + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88 + "00" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4719*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4719 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4814 was V4714 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4713 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4814 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4814 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4814 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* +} + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2007: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2007: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4715 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/7 = 1) (11 = 2) (10 = 3) (9 12/13 = 4) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_year = industrycat_isic + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4715 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen occup_isco_year = occup_isco + + replace occup_isco_year = "" if occup_isco_year == "" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 = 1) (4 6/7 9/13 = 0) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(string(occup_isco_2_year), 1, 1) == "1" | substr(string(occup_isco_2_year), 1, 1) == "2" | substr(string(occup_isco_2_year), 1, 1) == "3") + replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(string(occup_isco_2_year), 1, 1) == "4" | substr(string(occup_isco_2_year), 1, 1) == "5" | substr(string(occup_isco_2_year), 1, 1) == "6" | substr(string(occup_isco_2_year), 1, 1) == "7" | substr(string(occup_isco_2_year), 1, 1) == "8") + replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + replace occup_2_year = 1 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "1" + replace occup_2_year = 2 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "2" + replace occup_2_year = 3 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "3" + replace occup_2_year = 4 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "4" + replace occup_2_year = 5 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "5" + replace occup_2_year = 6 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "6" + replace occup_2_year = 7 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "7" + replace occup_2_year = 8 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "8" + replace occup_2_year = 9 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "9" + replace occup_2_year = 0 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2011_PNAD/BRA_2011_PNAD_V01_M_V02_A_GLD/Programs/BRA_2011_PNAD_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2011_PNAD/BRA_2011_PNAD_V01_M_V02_A_GLD/Programs/BRA_2011_PNAD_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..29163ce7c --- /dev/null +++ b/GLD/BRA/BRA_2011_PNAD/BRA_2011_PNAD_V01_M_V02_A_GLD/Programs/BRA_2011_PNAD_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2286 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2011_PNAD_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNAD +<_Survey Year_> 2011 +<_Study ID_> BRA_2011_PNAD_v01_M +<_Data collection from_> 09/2011 +<_Data collection to_> 09/2011 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 111,763 +<_Sample size (IND)_> 358,919 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-13 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 1988 +<_OCCUP National_> CBO Domiciliar +<_ISIC Version_> ISIC Rev. 3 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [YYYY-MM-DD] - [Description of changes] +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 1: Setting up of program environment, dataset +============================================================================%%*/ + +*----------1.1: Initial commands-----------------------------------------------* + + clear + set more 1 + +*----------1.2 Set directories-------------------------------------------------* + + * Define path sections + local server "Y:/GLD" + local country "BRA" + local year "2011" + local survey "PNAD" + 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 Merge Household and People files--------------------------------* + + use "`path_in_stata'\pd2011.dta" + merge 1:m id_dom using "`path_in_stata'\pp2011.dta" + keep if _merge==3 + drop _merge + + destring id_pess, replace + + bys id_dom: egen n_ind_1 = max(id_pess) + + bys id_dom: egen n_ind_2 = max(_N) + + gen n_ind_same = n_ind_1 - n_ind_2 + + tab n_ind_same + + sort id_dom V0401 + + bys id_dom: gen id_pes2 = _n + + replace id_pess = id_pes2 if n_ind_same != 0 + + tostring id_pess, replace format(%02.0f) + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNAD" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-13" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2011" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_1988" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_3" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename V0101 year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename V4601 int_month + label define int_month_lab 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 int_month_lab + label variable int_month "Month of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pess) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V4729 weight + replace weight = . if weight == -1 + label variable weight "Household sampling weight" + drop V4611 V4732 +* + +*<_psu_> + rename V4618 psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename V4602 strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = . + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V4105 urban + recode urban (1/3 = 1) (4/8 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 4107: Census area code + 1 = Metropolitan area + 2 = Autorepresentative + 3 = Not autorepresentative + + */ + gen subnatid3 = . + replace subnatid3 = 1 if UF == 15 & V4107 == 1 + replace subnatid3 = 2 if UF == 23 & V4107 == 1 + replace subnatid3 = 3 if UF == 26 & V4107 == 1 + replace subnatid3 = 4 if UF == 29 & V4107 == 1 + replace subnatid3 = 5 if UF == 31 & V4107 == 1 + replace subnatid3 = 6 if UF == 33 & V4107 == 1 + replace subnatid3 = 7 if UF == 35 & V4107 == 1 + replace subnatid3 = 8 if UF == 41 & V4107 == 1 + replace subnatid3 = 9 if UF == 43 & V4107 == 1 + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 1 "1 - Belem" 2 "2 - Fortaleza" 3 "3 - Recife" 4 "4 - Salvador" 5 "5 - Belo Horizonte" 6 "6 - Rio de Janeiro" 7 "7 - Sao Paulo" 8 "8 - Curitiba" 9 "9 - Porto Alegre" + label values subnatid3 subnatid3_lab + drop UF V4107 +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "subnatid3" + tostring subnatidsurvey, replace + replace subnatidsurvey = "subnatid2" if subnatid3 == . + label variable subnatidsurvey "Administrative level at which survey is representative" +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + +{ + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V0105 hsize + replace hsize = . if hsize == -1 + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V8005 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V0302 male + recode male (2 = 1) (4 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V0401 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa de referência" 2 "Cônjuge" 3 "Filho" 4 "Outro parente" 5 "Agregado" 6 "Pensionista" 7 "Empregado doméstico" 8 "Parente de empregado doméstico" + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2 = 2) (3 = 3) (4 = 5) (5/6 7/8 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + rename V4011 marital + recode marital (1 = 1) (0 = 2) (3/5 = 4) (7 = 5) + replace marital = 3 if marital == . & V4111 == 1 + recast byte marital + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab + drop V4111 +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + +} + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + recode V0504 (2 = 0) (4 = 1) (9 = .) + recode V0511 (1 = 0) (3 = 1) (9 = .) + gen migrated_binary = -(V0504*V0511 - 1) + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + recode V5065 (6 = 10) + recode V5125 (6 = 10) + egen migrated_years = rowmin(V5062 V5064 V5065 V5122 V5124 V5125) + label variable migrated_years "Years since latest migration" + drop V5062 V5064 V5065 V5122 V5124 V5125 +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + replace migrated_from_cat = 1 if V0511 == 1 + replace migrated_from_cat = 2 if V0504 == 1 + replace migrated_from_cat = 3 if V0504 == 0 & substr(string(V5090), 1, 1) == string(subnatid1) + replace migrated_from_cat = 4 if V0504 == 0 & V5090 != 88 & V5090 != 98 & V5090 != . & substr(string(V5090), 1, 1) != string(subnatid1) + replace migrated_from_cat = 5 if V5090 == 98 + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab + drop V0511 V0504 +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + replace migrated_from_code = subnatid2 if migrated_from_cat == 2 + replace migrated_from_code = V5090 if migrated_from_cat == 3 + replace migrated_from_code = floor(V5090/10) if migrated_from_cat == 4 + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab + drop V5090 +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + +{ + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V0602 + recode school (4 = 0) (2 = 1) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V0601 (3 = 0) (1 = 1) + rename V0601 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + */ + gen educy = V4803 - 1 + recode educy (16 = .) + recast float educy + label variable educy "Years of education" + drop V4803 + + replace educy = 17 if V6007 == 9 & V0610 == 2 + replace educy = 18 if V6007 == 9 & V0610 == 3 + replace educy = 19 if V6007 == 9 & V0610 >= 4 & V0610 <= 8 +* + +*<_educat7_> +/* <_educat7_note> + + GLD's category 6 "Higer than secondary but not university" has no equivalent + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat7 = . + replace educat7 = 1 if educy == 0 + replace educat7 = 2 if (educy >= 1 & educy <= 7) | (V6003 == 1 | V6003 == 3 | V6003 == 6 | V6003 == 7 | V6003 == 8 | V6003 == 9) + replace educat7 = 3 if educy == 8 + replace educat7 = 4 if (educy >= 9 & educy <= 10) | (V6003 == 2 | V6003 == 4 ) + replace educat7 = 5 if educy == 11 + replace educat7 = 7 if (educy >= 12 & educy <= 15) | (V6003 == 5 | V6003 == 11) + *recode educat7 (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6/7 = 7) (8 = .) + recast byte educat7 + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab +* + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2011 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2007: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + +} + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 10 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4805 was V4705 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4704 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if V4805 == 1 & age >= minlaborage + replace lstatus = 2 if V4805 == 2 & age >= minlaborage + replace lstatus = 3 if V4704 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop V4805 V4704 +* + +*<_potential_lf_> + gen potential_lf = . + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = . + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* +} + + +*----------8.2: 7 day reference main job---------------------------------------* + + +{ +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2007: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2007: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4706 is V4756 + + */ + rename V4706 empstat + recode empstat (1/7 = 1) (13 = 2) (10 = 3) (9 11/12 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + replace V9907 = 51000 if (V9907 == 53010 | V9907 == 53020 | V9907 == 53067 | V9907 == 53066) + replace V9907 = 52000 if V9907 != 51000 & floor(V9907/1000) == 53 + gen str5 industry_orig = string(V9907, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + replace industry_orig = "45000" if industry_orig == "45999" + replace industry_orig = "15050" if industry_orig == "15055" + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> +/* <_industrycat_isic_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic = substr(industry_orig,1,2)+"00" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" + replace industrycat_isic = "" if industrycat_isic == "00" +* + +*<_industrycat10_> + gen industrycat10 = substr(industrycat_isic, 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if industrycat10 < 10 + replace industrycat10 = 2 if (industrycat10 >= 10 & industrycat10 < 15) + replace industrycat10 = 3 if (industrycat10 >= 15 & industrycat10 < 37) + replace industrycat10 = 4 if (industrycat10 >= 37 & industrycat10 < 45) + replace industrycat10 = 5 if (industrycat10 >= 45 & industrycat10 < 50) + replace industrycat10 = 6 if (industrycat10 >= 50 & industrycat10 < 60) + replace industrycat10 = 7 if (industrycat10 >= 60 & industrycat10 < 65) + replace industrycat10 = 8 if (industrycat10 >= 65 & industrycat10 < 75) + replace industrycat10 = 9 if (industrycat10 >= 75 & industrycat10 < 80) + replace industrycat10 = 10 if (industrycat10 >= 80 & industrycat10 < 100) + recast byte industrycat10 + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> +/* <_occup_orig_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4706 is V4756 + + */ + gen str4 occup_orig = string(V9906, "%04.0f") + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + +*<_occup_isco_> +/* <_occup_isco_note> + + ISCO-88 + + */ + gen v9996 = occup_orig + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco = isco_88+"00" + label variable occup_isco "ISCO code of primary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco = "" if occup_isco == "00" +* + +*<_occup_skill_> +/* <_occup_skill_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill = . + replace occup_skill = 1 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9032 ocusec + recode ocusec (4 = 1) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V9532 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V9058 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + rename V9042 contract + recode contract (4 = 0) (2 = 1) + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + rename V9047 healthins + recode healthins (3 = 0) (1 = 1) + replace healthins = . if lstatus != 1 + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V9059 socialsec // [2001: 4761] + recode socialsec (3 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = firmsize_l + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + rename V9092 empstat_2 + recode empstat_2 (1/2 = 1) (5/6 = 2) (4 = 3) (3 = 4) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_2_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + replace V9991 = 51000 if (V9991 == 53010 | V9991 == 53020 | V9991 == 53067 | V9991 == 53066) + replace V9991 = 52000 if V9991 != 51000 & floor(V9991/1000) == 53 + gen str5 industry_orig_2 = string(V9991, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + replace industry_orig_2 = "45000" if industry_orig_2 == "45999" + replace industry_orig_2 = "15050" if industry_orig_2 == "15055" + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +*<_industrycat_isic_2_> +/* <_industrycat_isic_2_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2 = substr(industry_orig_2,1,2)+"00" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall" + replace industrycat_isic_2 = "" if industrycat_isic_2 == "00" +* + +*<_industrycat10_2_> + gen industrycat10_2 = substr(industrycat_isic_2, 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if industrycat10_2 < 10 + replace industrycat10_2 = 2 if (industrycat10_2 >= 10 & industrycat10_2 < 15) + replace industrycat10_2 = 3 if (industrycat10_2 >= 15 & industrycat10_2 < 37) + replace industrycat10_2 = 4 if (industrycat10_2 >= 37 & industrycat10_2 < 45) + replace industrycat10_2 = 5 if (industrycat10_2 >= 45 & industrycat10_2 < 50) + replace industrycat10_2 = 6 if (industrycat10_2 >= 50 & industrycat10_2 < 60) + replace industrycat10_2 = 7 if (industrycat10_2 >= 60 & industrycat10_2 < 65) + replace industrycat10_2 = 8 if (industrycat10_2 >= 65 & industrycat10_2 < 75) + replace industrycat10_2 = 9 if (industrycat10_2 >= 75 & industrycat10_2 < 80) + replace industrycat10_2 = 10 if (industrycat10_2 >= 80 & industrycat10_2 < 100) + recast byte industrycat10_2 + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> +/* <_occup_orig_2_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + gen str4 occup_orig_2 = string(V9990, "%04.0f") + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + replace occup_orig_2 = "" if occup_orig_2 == "." + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + +*<_occup_isco_2_> +/* <_occup_isco_2_note> + + ISCO-88 + + */ + gen v9996 = occup_orig_2 + merge m:1 v9996 using "`path_in_stata'\isco_88_cbo_dom_DD.dta" + drop if _merge == 2 + gen occup_isco_2 = isco_88 + "00" + label variable occup_isco_2 "ISCO code of secondary job 7 day recall" + drop _merge v9996 isco_88 + replace occup_isco_2 = "" if occup_isco_2 == "00" +* + +*<_occup_skill_2_> +/* <_occup_skill_2_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2 = . + replace occup_skill_2 = 1 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V9093 ocusec_2 + recode ocusec_2 (4 = 1) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V9982 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V9101 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V9105 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V9105 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1022 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + replace V1022 = . if V1022 > 999000000000 + format V1022 %12.0f + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" + drop V1022 +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V1025 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + replace V1025 = . if V1025 > 999000000000 + format V1025 %12.0f + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" + drop V1025 +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4719*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" + drop V4719 +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4814 was V4714 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4713 is V4763 + + */ + gen lstatus_year = . + replace lstatus_year = 1 if V4814 == 1 & age >= minlaborage + replace lstatus_year = 2 if V4814 == 2 & age >= minlaborage + replace lstatus_year = 3 if V4713 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab + drop V4814 V4713 +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* +} + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> +/* <_empstat_year_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2007: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2007: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4715 is V4765 + + */ + gen empstat_year = V4715 + recode empstat_year (1/7 = 1) (11 = 2) (10 = 3) (9 12/13 = 4) + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_industry_orig_year_> +/* <_industry_orig_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2000?: Adopted standardised set of codes (CNAE) + + */ + gen industry_orig_year = industry_orig + replace industry_orig_year = string(V9972, "%05.0f") if industry_orig == "" + replace industry_orig_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_year == "." + replace industry_orig_year = "45000" if industry_orig_year == "45999" + replace industry_orig_year = "15050" if industry_orig_year == "15055" + label variable industry_orig_year "Original survey industry code, main job 12 month recall" + drop V9972 V9907 +* + +*<_industrycat_isic_year_> +/* <_industrycat_isic_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_year = substr(industry_orig_year,1,2) + label variable industrycat_isic_year "ISIC code of primary job 12 month recall" + replace industrycat_isic_year = "" if industrycat_isic_year == "" +* + +*<_industrycat10_year_> + gen industrycat10_year = substr(industrycat_isic_year, 1, 2) + destring industrycat10_year, replace + replace industrycat10_year = 1 if industrycat10_year < 10 + replace industrycat10_year = 2 if (industrycat10_year >= 10 & industrycat10_year < 15) + replace industrycat10_year = 3 if (industrycat10_year >= 15 & industrycat10_year < 37) + replace industrycat10_year = 4 if (industrycat10_year >= 37 & industrycat10_year < 45) + replace industrycat10_year = 5 if (industrycat10_year >= 45 & industrycat10_year < 50) + replace industrycat10_year = 6 if (industrycat10_year >= 50 & industrycat10_year < 60) + replace industrycat10_year = 7 if (industrycat10_year >= 60 & industrycat10_year < 65) + replace industrycat10_year = 8 if (industrycat10_year >= 65 & industrycat10_year < 75) + replace industrycat10_year = 9 if (industrycat10_year >= 75 & industrycat10_year < 80) + replace industrycat10_year = 10 if (industrycat10_year >= 80 & industrycat10_year < 100) + recast byte industrycat10_year + label variable industrycat10_year "1 digit industry classification, primary job 12 month recall" + label values industrycat10_year industrycat10_lab +* + +*<_industrycat4_year_> + gen industrycat4_year = . + replace industrycat4_year = 1 if industrycat10_year == 1 + replace industrycat4_year = 2 if (industrycat10_year == 2 | industrycat10_year == 3 | industrycat10_year == 4 | industrycat10_year == 5) + replace industrycat4_year = 3 if (industrycat10_year == 6 | industrycat10_year == 7 | industrycat10_year == 8 | industrycat10_year == 9) + replace industrycat4_year = 4 if industrycat10_year == 10 + label variable industrycat4_year "Broad Economic Activities classification, primary job 7 day recall" + label values industrycat4_year industrycat4_lab +* + +*<_occup_orig_year_> +/* <_occup_orig_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CBO) + + 2001: V4715 is V4765 + + */ + gen occup_orig_year = occup_orig + replace occup_orig_year = string(V9971, "%04.0f") if occup_orig_year == "." + replace occup_orig_year = "" if lstatus_year != 1 | age < minlaborage + label variable occup_orig_year "Original occupation record primary job 12 month recall" + drop V9971 V9906 +* + +* +/* <_occup_isco_year_note> + + ISCO-88 + + */ + gen occup_isco_year = occup_isco + + replace occup_isco_year = "" if occup_isco_year == "" +* + +*<_occup_skill_year_> +/* <_occup_skill_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_year = . + replace occup_skill_year = 1 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "1" | substr(occup_isco_year, 1, 1) == "2" | substr(occup_isco_year, 1, 1) == "3") + replace occup_skill_year = 2 if lstatus_year == 1 & (substr(occup_isco_year, 1, 1) == "4" | substr(occup_isco_year, 1, 1) == "5" | substr(occup_isco_year, 1, 1) == "6" | substr(occup_isco_year, 1, 1) == "7" | substr(occup_isco_year, 1, 1) == "8") + replace occup_skill_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + recast byte occup_skill_year + label variable occup_skill_year "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_year occup_skill_lab +* + +*<_occup_year_> + gen occup_year = . + replace occup_year = 1 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "1" + replace occup_year = 2 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "2" + replace occup_year = 3 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "3" + replace occup_year = 4 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "4" + replace occup_year = 5 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "5" + replace occup_year = 6 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "6" + replace occup_year = 7 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "7" + replace occup_year = 8 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "8" + replace occup_year = 9 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "9" + replace occup_year = 0 if lstatus_year == 1 & substr(occup_isco_year, 1, 1) == "10" + recast byte occup_year + label variable occup_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_year occup_lab +* + +*<_ocusec_year_> +/* <_ocusec_year_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_year = . + recast byte ocusec_year + label variable ocusec_year "Sector of activity primary job 7 day recall" + label values ocusec_year ocusec_lab +* + +*<_wage_no_compen_year_> +/* <_wage_no_compen_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: [V4718] is [V4768] + + */ + gen wage_no_compen_year = . + format wage_no_compen_year %12.0f + label variable wage_no_compen_year "Last wage payment primary job 12 month recall" +* + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + rename V4715 contract_year + recode contract_year (1/3 = 1) (4 6/7 9/13 = 0) + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + rename V9087 union_year + recode union_year (3 = 0) (1 = 1) + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> +/* <_empstat_2_year_note> + + For all individuals + + */ + gen empstat_2_year = . + label variable empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year empstat_lab +* + +*<_industry_orig_2_year_> +/* <_industry_orig_2_year_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2_year = industry_orig_2 + replace industry_orig_2_year = "" if lstatus_year != 1 | age < minlaborage | industry_orig_2_year == "." + label variable industry_orig_2_year "Original survey industry code, secondary job 12 month recall" + drop V9991 +* + +*<_industrycat_isic_2_year_> +/* <_industrycat_isic_2_year_note> + + ISIC Rev. 3 + + */ + gen industrycat_isic_2_year = industrycat_isic_2 + tostring industrycat_isic_2_year, replace + label variable industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + +* + gen industrycat10_2_year = . + recast byte industrycat10_2_year + label variable industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year industrycat10_lab +* + +*<_industrycat4_2_year_> + gen industrycat4_2_year = . + label variable industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year industrycat4_lab +* + +*<_occup_orig_2_year_> +/* <_occup_orig_2_year_note> + + CBO-Domiciliar + *Classificação Brasileira de Ocupação (CBO) + + */ + *gen str4 occup_orig_2_year = . + gen occup_orig_2_year = occup_orig_2 + replace occup_orig_2_year = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2_year "Original occupational record secondary job 12 month recall" +* + +*<_occup_isco_2_year_> +/* <_occup_isco_2_year_note> + + ISCO-88 + + */ + *gen cbo = . // occup_orig_2_year + gen occup_isco_2_year = . + *merge m:1 cbo using "`path_in_stata'\isco_cbo.dta" + *drop if _merge == 2 + *rename isco occup_isco_2_year + label variable occup_isco_2_year "ISCO code of secondary job 12 month recall" + *drop _merge cbo + *replace occup_isco_2_year = "." if occup_isco_2_year == "" +* + +*<_occup_skill_2_year_> +/* <_occup_skill_2_year_note> + + ISCO + 1 = elementary occupations + 2 = clerks; service workers and ship and market sales workers; skilled agriculture and fischery workers; craft and related trades workers; plant and machine operators and assemblers + 3 = legislators, senior officials and managers; professionals; technicians and associate professionals + Armed Forces are missing & other classifications are missing (.) + + */ + gen occup_skill_2_year = . + replace occup_skill_2_year = 1 if lstatus_year == 1 & (substr(string(occup_isco_2_year), 1, 1) == "1" | substr(string(occup_isco_2_year), 1, 1) == "2" | substr(string(occup_isco_2_year), 1, 1) == "3") + replace occup_skill_2_year = 2 if lstatus_year == 1 & (substr(string(occup_isco_2_year), 1, 1) == "4" | substr(string(occup_isco_2_year), 1, 1) == "5" | substr(string(occup_isco_2_year), 1, 1) == "6" | substr(string(occup_isco_2_year), 1, 1) == "7" | substr(string(occup_isco_2_year), 1, 1) == "8") + replace occup_skill_2_year = 3 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "9" + recast byte occup_skill_2_year + label variable occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" + label values occup_skill_2_year occup_skill_lab +* + +*<_occup_2_year_> +/* <_occup_2_year_note> + + Do the dirty work + + */ + gen occup_2_year = . + replace occup_2_year = 1 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "1" + replace occup_2_year = 2 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "2" + replace occup_2_year = 3 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "3" + replace occup_2_year = 4 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "4" + replace occup_2_year = 5 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "5" + replace occup_2_year = 6 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "6" + replace occup_2_year = 7 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "7" + replace occup_2_year = 8 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "8" + replace occup_2_year = 9 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "9" + replace occup_2_year = 0 if lstatus_year == 1 & substr(string(occup_isco_2_year), 1, 1) == "10" + recast byte occup_2_year + label variable occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year occup_lab +* + +*<_ocusec_2_year_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + gen ocusec_2_year = . + recast byte ocusec_2_year + label variable ocusec_2_year "Sector of activity primary job 12 month recall" + label values ocusec_2_year ocusec_lab +* + +*<_wage_no_compen_2_year_> +/* <_wage_no_compen_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_no_compen_2_year = . + format wage_no_compen_2_year %12.0f + label variable wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V9005 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + + +*------------------------------------------------------------------------------- diff --git a/GLD/BRA/BRA_2012_PNADC/BRA_2012_PNADC_V01_M_V05_A_GLD/Programs/BRA_2012_PNADC_V01_M_V05_A_GLD_ALL.do b/GLD/BRA/BRA_2012_PNADC/BRA_2012_PNADC_V01_M_V05_A_GLD/Programs/BRA_2012_PNADC_V01_M_V05_A_GLD_ALL.do new file mode 100644 index 000000000..f7ecbe15a --- /dev/null +++ b/GLD/BRA/BRA_2012_PNADC/BRA_2012_PNADC_V01_M_V05_A_GLD/Programs/BRA_2012_PNADC_V01_M_V05_A_GLD_ALL.do @@ -0,0 +1,2030 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2012_PNADC_V01_M_V05_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2012 +<_Study ID_> BRA_2012_PNAD_v01_M +<_Data collection from_> 2012 +<_Data collection to_> 2012 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 137,938 +<_Sample size (IND)_> 446,445 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [2022-08-13] - Changed industry, occup info from ISIC Rev 3 to Rev 4 +and ISCO-88 to ISCO-08 respectively. Kept one off the old matchings just in case. +* Date 2022/10/24 - Update educat7, subnatidsurvey, industrycat10 +* Date: [2024-02-12] - Update firmsize, isco info, drop alternative isco, isic +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2012" +local survey "PNADC" +local vermast "V01" + local veralt "V05" + +* 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'\pnadc2012.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009 == 11 + replace educy = 20 if V3009 == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4023 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + diff --git a/GLD/BRA/BRA_2013_PNADC/BRA_2013_PNADC_V01_M_V05_A_GLD/Programs/BRA_2013_PNADC_V01_M_V05_A_GLD_ALL.do b/GLD/BRA/BRA_2013_PNADC/BRA_2013_PNADC_V01_M_V05_A_GLD/Programs/BRA_2013_PNADC_V01_M_V05_A_GLD_ALL.do new file mode 100644 index 000000000..cfdeb82d0 --- /dev/null +++ b/GLD/BRA/BRA_2013_PNADC/BRA_2013_PNADC_V01_M_V05_A_GLD/Programs/BRA_2013_PNADC_V01_M_V05_A_GLD_ALL.do @@ -0,0 +1,2031 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2013_PNADC_V01_M_V05_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2013 +<_Study ID_> BRA_2013_PNAD_v01_M +<_Data collection from_> 2013 +<_Data collection to_> 2013 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 145,074 +<_Sample size (IND)_> 461,033 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [2022-08-13] - Changed industry, occup info from ISIC Rev 3 to Rev 4 +and ISCO-88 to ISCO-08 respectively. Kept one off the old matchings just in case. +* Date 2022/10/24 - Update educat7, subnatidsurvey, industrycat10 +* Date: [2024-02-12] - Update firmsize, isco info, drop alternative isco, isic +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2013" +local survey "PNADC" +local vermast "V01" + local veralt "V05" + +* 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'\pnadc2013.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2013: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009 == 11 + replace educy = 20 if V3009 == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4023 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> + + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + diff --git a/GLD/BRA/BRA_2014_PNADC/BRA_2014_PNADC_V01_M_V05_A_GLD/Programs/BRA_2014_PNADC_V01_M_V05_A_GLD_ALL.do b/GLD/BRA/BRA_2014_PNADC/BRA_2014_PNADC_V01_M_V05_A_GLD/Programs/BRA_2014_PNADC_V01_M_V05_A_GLD_ALL.do new file mode 100644 index 000000000..5f26e1507 --- /dev/null +++ b/GLD/BRA/BRA_2014_PNADC/BRA_2014_PNADC_V01_M_V05_A_GLD/Programs/BRA_2014_PNADC_V01_M_V05_A_GLD_ALL.do @@ -0,0 +1,2032 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2014_PNADC_V01_M_V05_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2014 +<_Study ID_> BRA_2014_PNAD_v01_M +<_Data collection from_> 2014 +<_Data collection to_> 2014 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 117,601 +<_Sample size (IND)_> 399,964 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [2022-08-13] - Changed industry, occup info from ISIC Rev 3 to Rev 4 +and ISCO-88 to ISCO-08 respectively. Kept one off the old matchings just in case. +* Date 2022/10/24 - Update educat7, subnatidsurvey, industrycat10 +* Date: [2024-02-12] - Update firmsize, isco info, drop alternative isco, isic +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2014" +local survey "PNADC" +local vermast "V01" + local veralt "V05" + +* 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'\pnadc2014.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + * 0 non-distinct individual identifiers + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2014: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009 == 11 + replace educy = 20 if V3009 == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4023 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + diff --git a/GLD/BRA/BRA_2015_PNADC/BRA_2015_PNADC_V01_M_V05_A_GLD/Programs/BRA_2015_PNADC_V01_M_V05_A_GLD_ALL.do b/GLD/BRA/BRA_2015_PNADC/BRA_2015_PNADC_V01_M_V05_A_GLD/Programs/BRA_2015_PNADC_V01_M_V05_A_GLD_ALL.do new file mode 100644 index 000000000..c0db35d22 --- /dev/null +++ b/GLD/BRA/BRA_2015_PNADC/BRA_2015_PNADC_V01_M_V05_A_GLD/Programs/BRA_2015_PNADC_V01_M_V05_A_GLD_ALL.do @@ -0,0 +1,2041 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2015_PNADC_V01_M_V05_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2015 +<_Study ID_> BRA_2015_PNAD_v01_M +<_Data collection from_> 2015 +<_Data collection to_> 2015 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 149,423 +<_Sample size (IND)_> 459,273 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [2022-08-13] - Changed industry, occup info from ISIC Rev 3 to Rev 4 +and ISCO-88 to ISCO-08 respectively. Kept one off the old matchings just in case. +* Date 2022/10/24 - Update educat7, subnatidsurvey, industrycat10 +* Date: [2024-02-12] - Update firmsize, isco info, drop alternative isco, isic +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2015" +local survey "PNADC" +local vermast "V01" + local veralt "V05" + +* 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'\pnadc2015.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2014: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009 == 11 + replace educy = 20 if V3009 == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4023 + replace nlfreason = VD4030 if int_quarter == 4 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> + + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + diff --git a/GLD/BRA/BRA_2016_PNADC/BRA_2016_PNADC_V01_M_V05_A_GLD/Programs/BRA_2016_PNADC_V01_M_V05_A_GLD_ALL.do b/GLD/BRA/BRA_2016_PNADC/BRA_2016_PNADC_V01_M_V05_A_GLD/Programs/BRA_2016_PNADC_V01_M_V05_A_GLD_ALL.do new file mode 100644 index 000000000..7b775c520 --- /dev/null +++ b/GLD/BRA/BRA_2016_PNADC/BRA_2016_PNADC_V01_M_V05_A_GLD/Programs/BRA_2016_PNADC_V01_M_V05_A_GLD_ALL.do @@ -0,0 +1,2040 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2016_PNADC_V01_M_V05_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2016 +<_Study ID_> BRA_2016_PNAD_v01_M +<_Data collection from_> 2016 +<_Data collection to_> 2016 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 151,284 +<_Sample size (IND)_> 459,718 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [2022-08-13] - Changed industry, occup info from ISIC Rev 3 to Rev 4 +and ISCO-88 to ISCO-08 respectively. Kept one off the old matchings just in case. +* Date 2022/10/24 - Update educat7, subnatidsurvey, industrycat10 +* Date: [2024-02-12] - Update firmsize, isco info, drop alternative isco, isic +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2016" +local survey "PNADC" +local vermast "V01" + local veralt "V05" + +* 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'\pnadc2016.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009A == 11 + replace educy = 20 if V3009A == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4030 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + replace nlfreason = . if nlfreason == 3 & age >= 0 & age <= 29 + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> + + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + diff --git a/GLD/BRA/BRA_2017_PNADC/BRA_2017_PNADC_V01_M_V05_A_GLD/Programs/BRA_2017_PNADC_V01_M_V05_A_GLD_ALL.do b/GLD/BRA/BRA_2017_PNADC/BRA_2017_PNADC_V01_M_V05_A_GLD/Programs/BRA_2017_PNADC_V01_M_V05_A_GLD_ALL.do new file mode 100644 index 000000000..6865bd1f7 --- /dev/null +++ b/GLD/BRA/BRA_2017_PNADC/BRA_2017_PNADC_V01_M_V05_A_GLD/Programs/BRA_2017_PNADC_V01_M_V05_A_GLD_ALL.do @@ -0,0 +1,2041 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2017_PNADC_V01_M_V05_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2017 +<_Study ID_> BRA_2017_PNAD_v01_M +<_Data collection from_> 2017 +<_Data collection to_> 2017 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 151,655 +<_Sample size (IND)_> 457,992 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [2022-08-13] - Changed industry, occup info from ISIC Rev 3 to Rev 4 +and ISCO-88 to ISCO-08 respectively. Kept one off the old matchings just in case. +* Date 2022/10/24 - Update educat7, subnatidsurvey, industrycat10 +* Date: [2024-02-12] - Update firmsize, isco info, drop alternative isco, isic +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2017" +local survey "PNADC" +local vermast "V01" + local veralt "V05" + +* 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'\pnadc2017.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009A == 11 + replace educy = 20 if V3009A == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4030 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + replace nlfreason = . if nlfreason == 3 & age >= 0 & age <= 29 + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> + + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + diff --git a/GLD/BRA/BRA_2018_PNADC/BRA_2018_PNADC_V01_M_V05_A_GLD/Programs/BRA_2018_PNADC_V01_M_V05_A_GLD_ALL.do b/GLD/BRA/BRA_2018_PNADC/BRA_2018_PNADC_V01_M_V05_A_GLD/Programs/BRA_2018_PNADC_V01_M_V05_A_GLD_ALL.do new file mode 100644 index 000000000..a3e0f043f --- /dev/null +++ b/GLD/BRA/BRA_2018_PNADC/BRA_2018_PNADC_V01_M_V05_A_GLD/Programs/BRA_2018_PNADC_V01_M_V05_A_GLD_ALL.do @@ -0,0 +1,2045 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2018_PNADC_V01_M_V05_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2018 +<_Study ID_> BRA_2018_PNAD_v01_M +<_Data collection from_> 2018 +<_Data collection to_> 2018 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 151,979 +<_Sample size (IND)_> 452,654 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [2022-08-13] - Changed industry, occup info from ISIC Rev 3 to Rev 4 +and ISCO-88 to ISCO-08 respectively. Kept one off the old matchings just in case. +* Date 2022/10/24 - Update educat7, subnatidsurvey, industrycat10 +* Date: [2024-02-12] - Update firmsize, isco info, drop alternative isco, isic +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2018" +local survey "PNADC" +local vermast "V01" + local veralt "V05" + +* 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'\pnadc2018.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009A == 11 + replace educy = 20 if V3009A == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4030 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + replace nlfreason = . if nlfreason == 3 & age >= 0 & age <= 29 + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> +/* <_occup_2_note> + + Do the dirty work + + */ + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + + diff --git a/GLD/BRA/BRA_2019_PNADC/BRA_2019_PNADC_V01_M_V05_A_GLD/Programs/BRA_2019_PNADC_V01_M_V05_A_GLD_ALL.do b/GLD/BRA/BRA_2019_PNADC/BRA_2019_PNADC_V01_M_V05_A_GLD/Programs/BRA_2019_PNADC_V01_M_V05_A_GLD_ALL.do new file mode 100644 index 000000000..b2a54c0fd --- /dev/null +++ b/GLD/BRA/BRA_2019_PNADC/BRA_2019_PNADC_V01_M_V05_A_GLD/Programs/BRA_2019_PNADC_V01_M_V05_A_GLD_ALL.do @@ -0,0 +1,2041 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2019_PNADC_V01_M_V05_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2019 +<_Study ID_> BRA_2019_PNAD_v01_M +<_Data collection from_> 2019 +<_Data collection to_> 2019 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 150,667 +<_Sample size (IND)_> 443,790 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [2022-08-13] - Changed industry, occup info from ISIC Rev 3 to Rev 4 +and ISCO-88 to ISCO-08 respectively. Kept one off the old matchings just in case. +* Date 2022/10/24 - Update educat7, subnatidsurvey, industrycat10 +* Date: [2024-02-12] - Update firmsize, isco info, drop alternative isco, isic +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2019" +local survey "PNADC" +local vermast "V01" + local veralt "V05" + +* 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'\pnadc2019.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009A == 11 + replace educy = 20 if V3009A == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4030 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + replace nlfreason = . if nlfreason == 3 & age >= 0 & age <= 29 + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + diff --git a/GLD/BRA/BRA_2020_PNADC/BRA_2020_PNADC_V01_M_V05_A_GLD/Programs/BRA_2020_PNADC_V01_M_V05_A_GLD_ALL.do b/GLD/BRA/BRA_2020_PNADC/BRA_2020_PNADC_V01_M_V05_A_GLD/Programs/BRA_2020_PNADC_V01_M_V05_A_GLD_ALL.do new file mode 100644 index 000000000..d8203e5dc --- /dev/null +++ b/GLD/BRA/BRA_2020_PNADC/BRA_2020_PNADC_V01_M_V05_A_GLD/Programs/BRA_2020_PNADC_V01_M_V05_A_GLD_ALL.do @@ -0,0 +1,2041 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2020_PNADC_V01_M_V05_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2020 +<_Study ID_> BRA_2020_PNAD_v01_M +<_Data collection from_> 2020 +<_Data collection to_> 2020 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 150,667 +<_Sample size (IND)_> 443,790 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: [2022-08-13] - Changed industry, occup info from ISIC Rev 3 to Rev 4 +and ISCO-88 to ISCO-08 respectively. Kept one off the old matchings just in case. +* Date 2022/10/24 - Update educat7, subnatidsurvey, industrycat10 +* Date: [2024-02-12] - Update firmsize, isco info, drop alternative isco, isic +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2020" +local survey "PNADC" +local vermast "V01" + local veralt "V05" + +* 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'\pnadc2020.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009A == 11 + replace educy = 20 if V3009A == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4030 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + replace nlfreason = . if nlfreason == 3 & age >= 0 & age <= 29 + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* + diff --git a/GLD/BRA/BRA_2022_PNADC/BRA_2022_PNADC_V01_M_V02_A_GLD/Programs/BRA_2022_PNADC_V01_M_V02_A_GLD_ALL.do b/GLD/BRA/BRA_2022_PNADC/BRA_2022_PNADC_V01_M_V02_A_GLD/Programs/BRA_2022_PNADC_V01_M_V02_A_GLD_ALL.do new file mode 100644 index 000000000..b07173119 --- /dev/null +++ b/GLD/BRA/BRA_2022_PNADC/BRA_2022_PNADC_V01_M_V02_A_GLD/Programs/BRA_2022_PNADC_V01_M_V02_A_GLD_ALL.do @@ -0,0 +1,2036 @@ + +/*%%============================================================================ + 0: GLD Harmonization Preamble +============================================================================%%*/ + +/* ----------------------------------------------------------------------------- + +<_Program name_> BRA_2022_PNADC_V01_M_V02_A_GLD_ALL.do +<_Application_> STATA 17.0 <_Application_> +<_Author(s)_> World Bank Jobs Group (gld@worldbank.org) +<_Date created_> 2022-04-01 + +-------------------------------------------------------------------------------- + +<_Country_> BRA +<_Survey Title_> PNADC +<_Survey Year_> 2022 +<_Study ID_> BRA_2022_PNAD_v01_M +<_Data collection from_> 2022 +<_Data collection to_> 2022 +<_Source of dataset_> https://www.ibge.gov.br/estatisticas/sociais/trabalho/9127-pesquisa-nacional-por-amostra-de-domicilios.html?=&t=downloads +<_Sample size (HH)_> 132,587 +<_Sample size (IND)_> 376,821 +<_Sampling method_> Probabilistic sampling of households obtained in +three selection stages: primary units - municipalities; secondary units - +census sectors; tertiary units - domicile units +<_Geographic coverage_> Metropolitan Area +<_Currency_> Brazilian Real (R$) + +-------------------------------------------------------------------------------- + +<_ICLS Version_> ICLS-19 +<_ISCED Version_> isced_2011 +<_ISCO Version_> ISCO 2008 +<_OCCUP National_> COD +<_ISIC Version_> ISIC Rev. 4 +<_INDUS National_> CNAE Domiciliar + +-------------------------------------------------------------------------------- +<_Version Control_> + +* Date: 2024-11-04 - Update vars socialsec + + + +------------------------------------------------------------------------------*/ + + +/*%%============================================================================ + 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 "BRA" +local year "2022" +local survey "PNADC" +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 + + use "`path_in_stata'\pnadc2022.dta", clear + +*----------1.4.1: People file IDs & adjustments--------------------------------* +{ +*----------1.4.1.1: Comparing weights------------------------------------------* + + gen count = 1 + tab count [iweight = V1032] + + * 0 instances where HH weight is missing + count if V1032 == . + + +*----------2.2.1.2: Checking person id-----------------------------------------* + tostring UPA, format("%14.0f") gen(str_UPA) + tostring V1008, format("%02.0f") gen(str_V1008) + tostring V1014, format("%02.0f") gen(str_V1014) + egen id_dom = concat(str_UPA str_V1008 str_V1014) + gen id_pes = string(V2003, "%03.0f") + distinct id_dom id_pes, joint + +} +*----------2.2.2: Remove auxiliary variables-----------------------------------* +{ + drop count str_UPA V1008 str_V1008 V1014 str_V1014 V2003 +} + +/*%%============================================================================ + 2: Survey & ID +============================================================================%%*/ + +{ + +*<_countrycode_> + gen countrycode = "BRA" + label variable countrycode "Country code" +* + +*<_survname_> + gen survname = "PNADC" + label variable survname "Survey acronym" +* + +*<_survey_> + gen survey = "Other Household Survey" // https://microdatalib.worldbank.org/index.php/catalog/3342 + label variable survey "Survey type" +* + +*<_icls_v_> + gen icls_v = "ICLS-19" + label variable icls_v "ICLS version underlying questionnaire questions" +* + +*<_isced_version_> + gen isced_version = "isced_2001" + label variable isced_version "Version of ISCED used for educat_isced" +* + +*<_isco_version_> + gen isco_version = "isco_2008" + label variable isco_version "Version of ISCO used" +* + +*<_isic_version_> + gen isic_version = "isic_4" + label variable isic_version "Version of ISIC used" +* + +*<_year_> +/* <_year_note> + + 1980's: didn't exist + 1990's: had only 2-digits + + 1980's: V0101 represents HH number + 1983 & 1990: doesn't exist + + */ + rename Ano year + label variable 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 variable harmonization "Type of harmonization" +* + +*<_int_year_> + gen int_year = year + label variable int_year "Year of interview" +* + +*<_int_month_> + rename Trimestre int_month + label define int_month_lab 1 "March" 2 "June" 3 "September" 4 "December" + label value int_month int_month_lab + label variable int_month "Month of interview" +* + +*<_int_quarter_> + gen int_quarter = int_month + label define int_quarter_lab 1 "First Quarter" 2 "Second Quarter" 3 "Third Quarter" 4 "Fourth Quarter" + label value int_quarter int_quarter_lab + label variable int_month "Quarter of interview" +* + +*<_hhid_> +/* <_hhid_note> + + 1980's: V0101 is hhid + 1983 & 1990: V0101 doesn't exist; V0102 & V0103 do + 1992-2012: V0102 has 6-digits rather than 8-digits (lacking UF digits at begining) + + If inexists: avoid creating a sequential index (hhid = _n) + + */ + rename id_dom hhid + label variable hhid "Household ID" +* + +*<_pid_> +/* <_pid_note> + + 1980's: doesn't exist + As of 1992: name change + + */ + egen pid = concat(hhid id_pes) + label variable pid "Individual ID" +* + +*<_weight_> +/* <_weight_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + *gen count = 1 + *tab count [iweight = V4611] // dom + *tab count [iweight = V4729] // pes + *tab count [iweight = V4732] // fam + *egen tag1 = diff(V4611 V4732) + *tab tag1, missing + *egen tag2 = diff(V4729 V4732) + *tab tag2, missing + *egen tag3 = diff(V4611 V4729) + *tab tag3, missing + + rename V1032 weight + label variable weight "Household sampling weight" +* + +*<_psu_> + rename UPA psu + tostring psu, replace + label variable psu "Primary sampling units" +* + +*<_strata_> + rename Estrato strata + tostring strata, replace + label variable strata "Strata" +* + +*<_wave_> +/* <_wave_note> + + Exists in PNADc + + */ + gen wave = 1 + tostring wave, replace + label variable wave "Survey wave" +* + +} + + +/*%%============================================================================ + 3: Geography +============================================================================%%*/ + +{ + +*<_urban_> +/* <_urban_note> + + "semi-urban" & "mixed" = "urban" + + 1 = Urban - city or village, urban area + 2 = Urban - city of village, non-urban area + 3 = Urban - isolated urban area + 4 = Rural - rural aglomeration, urban extentionΩ + 5 = Rural - rural aglomeration, isolated, people + 6 = Rural - rural aglomeration, isolated, nucleus + 7 = Rural - rural aglomeration, isolated, other aglomerations + 8 = Rural - rural zone other than rural aglomeration + Until 1992; other categories + + */ + rename V1022 urban + recode urban (2 = 0) + label variable urban "Location is urban" + label define urban_lab 0 "Rural" 1 "Urban" + label values urban urban_lab +* + +*<_subnatid1_> +/* <_subnatid1_note> + + Until 1992: not standardised + + 1st digit of "UF" variable + + */ + gen subnatid1 = . + replace subnatid1 = 1 if substr(string(UF), 1, 1) == "1" + replace subnatid1 = 2 if substr(string(UF), 1, 1) == "2" + replace subnatid1 = 3 if substr(string(UF), 1, 1) == "3" + replace subnatid1 = 4 if substr(string(UF), 1, 1) == "4" + replace subnatid1 = 5 if substr(string(UF), 1, 1) == "5" + recast byte subnatid1 + label variable subnatid1 "Subnational ID at First Administrative Level" + label define subnatid1_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" + label values subnatid1 subnatid1_lab +* + +*<_subnatid2_> +/* <_subnatid2_note> + + Until 1992: not standardised + Until 1992: TO (17) part of GO (52), though created in 1988 (changes region/subnatid1) + + 2nd digit of "UF" variable + + */ + gen subnatid2 = UF + recast byte subnatid2 + label variable subnatid2 "Subnational ID at Second Administrative Level" + label define subnatid2_lab 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values subnatid2 subnatid2_lab +* + +*<_subnatid3_> +/* <_subnatid3_note> + + 1022: Census area code + 1 = Capital + 2 = Rest of the Metropolitan area + 3 = Rest of the State + + + */ + gen subnatid3 = . + replace subnatid3 = Capital + recast byte subnatid3 + label variable subnatid3 "Subnational ID at Third Administrative Level" + label define subnatid3_lab 11 "11 - Porto Velho" 12 " 12 - Rio Branco" 13 " 13 - Manaus" 14 "14 - Boa Vista" 15 "15 - Belem" 16 "16 - Macapa" 17 "17 - Palmas" 21 "21 - São Luis" 22 "22 - Teresina" 23 "23 - Fortaleza" 24 "24 - Natal" 25 "25 - João Pessoa" 26 "26 - Recife" 27 "27 - Maceió" 28 "28 - Aracaju" 29 "29 - Salvador" 31 "31 - Belo Horizonte" 32 "32 - Vitória" 33 "33 - Rio de Janeiro" 35 "35 - São Paulo" 41 "41 - Curitiba" 42 "42 - Florianópolis" 43 "43 - Porto Alegre" 50 "50 - Campo Grande" 51 "51 - Cuiabá" 52 "52 - Goiânia" 53 "53 - Brasilia" + label values subnatid3 subnatid3_lab +* + +*<_subnatidsurvey_> + gen subnatidsurvey = "" + decode subnatid2, gen(helper_1) + decode subnatid3, gen(helper_2) + replace subnatidsurvey = helper_1 + " - Urban" if urban == 1 & missing(subnatid3) + replace subnatidsurvey = helper_1 + " - Rural" if urban == 0 & missing(subnatid3) + replace subnatidsurvey = helper_2 + " (City)" if !missing(subnatid3) + drop helper_1 helper_2 +* + +*<_subnatid1_prev_> + gen subnatid1_prev = . + label variable subnatid1_prev "Classification used for subnatid1 from previous survey" +* + +*<_subnatid2_prev_> + gen subnatid2_prev = . + label variable subnatid2_prev "Classification used for subnatid2 from previous survey" +* + +*<_subnatid3_prev_> + gen subnatid3_prev = . + label variable subnatid3_prev "Classification used for subnatid3 from previous survey" +* + +*<_gen gaul_adm1_code_> +/* <_gaul_adm1_code_note> + + Brazil 37 + + */ + gen gaul_adm1_code = . + label variable gaul_adm1_code "Global Administrative Unit Layers (GAUL) Admin 1 code" +* + +*<_gen gaul_adm2_code_> + gen gaul_adm2_code = subnatid2 + recode gaul_adm2_code (11 = 686) (12 = 665) (13 = 668) (14 = 687) (15 = 678) (16 = 667) (17 = 691) (21 = 674) (22 = 682) (23 = 670) (24 = 684) (25 = 679) (26 = 681) (27 = 666) (28 = 690) (29 = 669) (31 = 677) (32 = 672) (33 = 683) (35 = 689) (41 = 680) (42 = 688) (43 = 685) (50 = 676) (51 = 675) (52 = 673) (53 = 671) + label variable gaul_adm2_code "Global Administrative Unit Layers (GAUL) Admin 2 code" + label define gaul_adm2_code_lab 686 "686 - Rondonia" 665 "665 - Acre" 668 "668 - Amazonas" 687 "687 - Roraima" 678 "678 - Pará" 667 "667 - Amapa" 691 "691 - Tocantins" 674 "674 - Maranhao"682 "682 - Piaui" 670 "670 - Ceara" 684 "684 - Rio Grande do Norte" 679 "679 - Paraiba" 681 "681 - Pernambuco" 666 "666 - Alagoas" 690 "690 - Sergipe" 669 "669 - Bahia" 677 "677 - Minas Gerais" 672 "672 - Espirito Santo" 683 "683 - Rio de Janeiro" 689 "689 - Sao Paulo" 680 "680 - Parana" 688 "688 - Santa Catarina" 685 "685 - Rio Grande do Sul" 676 "676 - Mato Grosso do Sul" 675 "675 - Mato Grosso" 673 "673 - Goias" 671 "671 - Distrito Federal" + label values gaul_adm2_code gaul_adm2_code_lab +* + +*<_gen gaul_adm3_code_> + gen gaul_adm3_code = . + label variable gaul_adm3_code "Global Administrative Unit Layers (GAUL) Admin 3 code" +* + +} + + +/*%%============================================================================ + 4: Demography +============================================================================%%*/ + + + +*<_hsize_> +/* <_hsize_note> + + 1992-2001: contains "-1", which should be changed to missing (.) + + */ + rename V2001 hsize + label variable hsize "Household size" +* + +*<_age_> +/* <_age_note> + + Check: <=5 years, age registered with decimals + + 1980's: simetimes age and YoB are switched + Contains 999", which should be changed to missing (.) + + Until 2000: YoB registered with only 3-digits + DoB = "00", MoB = "20" | "30" and YoB = "0"-"98" mean "deduced/estimated" + + */ + rename V2009 age + replace age = . if age == 999 + label variable age "Individual age" +* + +*<_male_> + rename V2007 male + recode male (2 = 0) + label variable male "Sex - Ind is male" + label define male_lab 0 "Female" 1 "Male" + label values male male_lab +* + +*<_relationcs_> + rename V2005 relationcs + recast byte relationcs + label variable relationcs "Relationship to the head of household - Country original" + label define relationcs_lab 1 "Pessoa responsável pelo domicílio " 2 "Cônjuge ou companheiro(a) de sexo diferente" 3 "Cônjuge ou companheiro(a) do mesmo sexo" 4 "Filho(a) do responsável e do cônjuge" 5 "Filho(a) somente do responsável" 6 "Enteado(a)" 7 "Genro ou nora" 8 "Pai, mãe, padrasto ou madrasta" 9 "Sogro(a)" 10 "Neto(a)" 11 "Bisneto(a)" 12 "Irmão ou irmã" 13 "Avô ou avó" 14 "Outro parente" 15 "Agregado(a) - Não parente que não compartilha despesas" 16 "Convivente - Não parente que compartilha despesas" 17 "Pensionista" 18 "Empregado(a) doméstico(a)" 19 "Parente do(a) empregado(a) doméstico(a)" + + label values relationcs relationcs_lab +* + +*<_relationharm_> +/* <_relationharm_note> + + If "head" not around, then "spouse" = "head"; if "spouse" not around, oldest member around = "hear" + GLD category 4 "Parents" does not exist + + */ + gen relationharm = relationcs + recode relationharm (1 = 1) (2/3 = 2) (4/5 = 3) (8/9 = 4) (6/7 10/14 = 5) (15/19 = 6) + recast byte relationharm + label variable relationharm "Relationship to the head of household - Harmonized" + label define relationharm_lab 1 "Head of household" 2 "Spouse" 3 "Children" 4 "Parents" 5 "Other relatives" 6 "Other and non-relatives" + label values relationharm relationharm_lab +* + +*<_marital_> +/* <_marital_note> + + Asked only to people 10 years or older + Children (age?) should be category 2 "never married"... but go with survey (Mario) + + */ + gen marital = . + label variable marital "Marital status" + label define marital_lab 1 "Married" 2 "Never Married" 3 "Living together" 4 "Divorced/Separated" 5 "Widowed" + label values marital marital_lab +* + +*<_eye_dsablty_> + gen eye_dsablty = . + recast byte eye_dsablty + label variable eye_dsablty "Difficulty related to eyesight" + label define eye_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values eye_dsablty eye_dsablty_lab +* + +*<_hear_dsablty_> + gen hear_dsablty = . + recast byte hear_dsablty + label variable hear_dsablty "Difficulty related to hearing" + label define hear_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values hear_dsablty hear_dsablty_lab +* + +*<_walk_dsablty_> + gen walk_dsablty = . + recast byte walk_dsablty + label variable walk_dsablty "Difficulty related to climbing stairs" + label define walk_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values walk_dsablty walk_dsablty_lab +* + +*<_conc_dsord_> + gen conc_dsord = . + recast byte conc_dsord + label variable conc_dsord "Difficulty related to concentration or remembering" + label define conc_dsord_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" + label values conc_dsord conc_dsord_lab +* + +*<_slfcre_dsablty_> + gen slfcre_dsablty = . + recast byte slfcre_dsablty + label variable slfcre_dsablty "Difficulty related to selfcare" + label define slfcre_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values slfcre_dsablty slfcre_dsablty_lab +* + +*<_comm_dsablty_> + gen comm_dsablty = . + recast byte comm_dsablty + label variable comm_dsablty "Difficulty related to communicating" + label define comm_dsablty_lab 1 "No - no difficulty" 2 "Yes - some difficulty" 3 "Yes - a lot of difficulty" 4 "Cannot do at all" 5 "Cannot at all" + label values comm_dsablty comm_dsablty_lab +* + + + + +/*%%============================================================================ + 5: Migration +============================================================================%%*/ + + +{ + +/* <__note> + + 1992: Introduced + + */ + + +*<_migrated_mod_age_> +/* <_migrated_mod_age_note> + + Exists in PNADc + + */ + gen migrated_mod_age = . + label variable migrated_mod_age "Migration module application age" +* + +*<_migrated_ref_time_> +/* <_migrated_ref_time_note> + + Time-reference: [1-9] years and "10 or more" + + */ + gen migrated_ref_time = . + label variable migrated_ref_time "Reference time applied to migration questions (in years)" +* + +*<_migrated_binary_> + gen migrated_binary = . + recast byte migrated_binary + label variable migrated_binary "Individual has migrated" + label define migrated_binary_lab 0 "No" 1 "Yes" + label values migrated_binary migrated_binary_lab +* + +*<_migrated_years_> +/* <_migrated_years_note> + + 0 = Less than a year ago; 1-9, years ago; 10 = 10 or more years ago (Mario) + For those people who migrated at different times from different administrative regions, we consider the most recent one! + + */ + gen migrated_years = . + label variable migrated_years "Years since latest migration" +* + +*<_migrated_from_urban_> + gen migrated_from_urban = . + recast byte migrated_from_urban + label variable migrated_from_urban "Migrated from area" + label define migrated_from_urban_lab 0 "Rural" 1 "Urban" + label values migrated_from_urban migrated_from_urban_lab +* + +*<_migrated_from_cat_> +/* <_migrated_from_cat_note> + + admin1 = Region + admin2 = State + admin3 = Municipality !!! + + */ + gen migrated_from_cat = . + recast byte migrated_from_cat + label variable migrated_from_cat "Category of migration area" + label define migrated_from_cat_lab 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 migrated_from_cat_lab +* + +*<_migrated_from_code_> +/* <_migrated_from_code_note> + + subnatid1 = Region + subnatid2 = State + subnatid3 = Municipality + + */ + gen migrated_from_code = . + recast byte migrated_from_code + label variable migrated_from_code "Code of migration area as subnatid level of migrated_from-cat" + label define migrated_from_code_lab 1 "1 - North" 2 "2 - Northeast" 3 "3 - Southeast" 4 "4 - South" 5 "5 - Central-West" 11 "11 - Rondonia" 12 "12 - Acre" 13 "13 - Amazonas" 14 "14 - Roraima" 15 "15 - Pará" 16 "16 - Amapa" 17 "17 - Tocantins" 21 "21 - Maranhao" 22 "22 - Piaui" 23 "23 - Ceara" 24 "24 - Rio Grande do Norte" 25 "25 - Paraiba" 26 "26 - Pernambuco" 27 "27 - Alagoas" 28 "28 - Sergipe" 29 "29 - Bahia" 31 "31 - Minas Gerais" 32 "32 - Espirito Santo" 33 "33 - Rio de Janeiro" 35 "35 - Sao Paulo" 41 "41 - Parana" 42 "42 - Santa Catarina" 43 "43 - Rio Grande do Sul" 50 "50 - Mato Grosso do Sul" 51 "51 - Mato Grosso" 52 "52 - Goias" 53 "53 - Distrito Federal" + label values migrated_from_code migrated_from_code_lab +* + +*<_migrated_from_country_> + gen migrated_from_country = "" + label variable migrated_from_country "Code of migration country (ISO 3 Letter Code)" +* + +*<_migrated_reason_> + gen migrated_reason = . + recast byte migrated_reason + label variable migrated_reason "Reason for migrating" + label define migrated_reason_lab 1 "Family reasons" 2 "Educational reasons" 3 "Employment" 4 "Forced (political reasons, natural disaster, ...)" 5 "Other reason" + label values migrated_reason migrated_reason_lab +* + +} + + +/*%%============================================================================ + 6: Education +============================================================================%%*/ + + + + +*<_ed_mod_age_> +/* <_ed_mod_age_note> + + Exists in PNADc + Until 1994: only asked to people 5 years or older + As of 1995: asked to all ages + + Comparability throughout the years is compromised: + 1992: skip pattern introduced + + */ + gen ed_mod_age = 0 + label variable ed_mod_age "Education module application age" +* + +*<_school_> +/* <_school_note> + + Comparability throughout the years is compromised: + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + */ + gen school = V3002 + recode school (2 = 0) + label variable school "Attending school" + label define school_lab 0 "No" 1 "Yes" + label values school school_lab +* + +*<_literacy_> + recode V3001 (2 = 0) + rename V3001 literacy + label variable literacy "Individual can read & write" + label define literacy_lab 0 "No" 1 "Yes" + label values literacy literacy_lab +* + +*<_educy_> +/* <_educy_note> + + PNAD: 1 = no or < 1y instruction + 2-15 = 1-14y, 16 = 15+y; 17 = undetermined + [1 ignored and "1" subtracted] + + Unti 1992: one set of values for each of 0-8, 9-11 and 12+ + As of 1992: 0-16 + + PNADC: 0 (no literacy) - 16 (university degree+) + + */ + gen educy = VD3005 + recast float educy + label variable educy "Years of education" + drop VD3005 + + replace educy = 18 if V3009A == 11 + replace educy = 20 if V3009A == 12 +* + +*<_educat7_> +/* <_educat7_note> + + Using the derived (but survey own, created by survey producer) VD3004 + + */ + gen educat7 = . + replace educat7 = 1 if VD3004 == 1 + replace educat7 = 2 if VD3004 == 2 + replace educat7 = 3 if VD3004 == 3 + replace educat7 = 4 if VD3004 == 4 + replace educat7 = 5 if VD3004 == 5 + replace educat7 = 7 if inrange(VD3004, 6, 7) + label variable educat7 "Level of education 1" + label define educat7_lab 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 educat7_lab + * + +*<_educat5_> +/* <_educat5_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat5 = educat7 + recode educat5 (1 = 1) (2 = 2) (3/4 = 3) (5 = 4) (6/7 = 5) (8 = .) + recast byte educat5 + label variable educat5 "Level of education 2" + label define educat5_lab 1 "No education" 2 "Primary incomplete" 3 "Primary complete but secondary incomplete" 4 "secondary complete" 5 "Some tertiary/post-secondary" + label values educat5 educat5_lab +* + +*<_educat4_> +/* <_educat4_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + As of 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + */ + gen educat4 = educat7 + recode educat4 (1 = 1) (2/4 = 2) (5 = 3) (6/7 = 4) (8 = .) + recast byte educat4 + label variable educat4 "Level of education 3" + label define educat4_lab 1 "No education" 2 "Primary" 3 "Secondary" 4 "Post-secondary" + label values educat4 educat4_lab +* + +*<_educat_isced_> + gen educat_isced = educat7 + recode educat_isced (1 8 = .) (2 = 102) (3 = 104) (4 = 302) (5 = 304) (6 = 602) (7 = 604) + recast float educat_isced + label variable educat_isced "ISCED 2001 standardised level of education" + label define educat_isced_lab 102 "Primary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 104 "Primary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 302 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 304 "Upper secondary education, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" 602 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for partial completion of ISCED level but without direct access to programmes at higher ISCED levels" 604 "Bachelor's or equivalent level, not further defined, recognised successful completion of programme is sufficient for completion of ISCED level and with direct access to programmes at higher ISCED levels" + label values educat_isced educat_isced_lab +* + +*<_educat_orig_> +/* <_educat_orig_note> + + 1980's: "Pre-school" not considered + 1990's: "Pre-school" considered, but not separate from "School" + As of 2001: "Pre-school" and "School" are considered separately + + 2001: "Classe de alfabetização" category is added + 1981 & 1992: "Alfabetização de adultos" exists + + 1980's: old nomenclature ("primeiro grau", instead of "ensino fundamental") + + */ + gen educat_orig = . +* rename V4745 educat_orig +* recode educat_orig (8 = .) +* recast byte educat_orig +* label variable educat_orig "Original survey education code" +* label define educat_orig_lab 1 "Sem instrução" 2 "Fundamental incompleto ou equivalente" 3 "Fundamental completo ou equivalente" 4 "Médio incompleto ou equivalente" 5 "Médio completo ou equivalente" 6 "Superior incompleto ou equivalente" 7 "Superior completo" +* label values educat_orig educat_orig_lab +* + + + + +/*%%============================================================================ + 7: Training +============================================================================%%*/ + + +{ + +*<_vocational_> + gen vocational = . + recast byte vocational + label variable vocational "Ever received vocational training" + label define vocational_lab 0 "No" 1 "Yes" + label values vocational vocational_lab +* + +*<_vocational_type_> + gen vocational_type = . + recast byte vocational_type + label variable vocational_type "Type of vocational training" + label define vocational_type_lab 1 "Inside Enterprise" 2 "External" + label values vocational_type vocational_type_lab +* + +*<_vocational_length_l_> + gen vocational_length_l = . + recast float vocational_length_l + label variable vocational_length_l "Length of training in months, lower limit" +* + +*<_vocational_length_u_> + gen vocational_length_u = . + recast float vocational_length_u + label variable vocational_length_u "Length of training in months, upper limit" +* + +*<_vocational_field_> + gen vocational_field = . + label variable vocational_field "Field of training" +* + +*<_vocational_financed_> + gen vocational_financed = . + recast byte vocational_financed + label variable vocational_financed "How training was financed" + label define vocational_financed_lab 1 "Employer" 2 "Government" 3 "Mixed Emploer/Government" 4 "Own funds" 5 "Other" + label values vocational_financed vocational_financed_lab +* + +} + + +/*%%============================================================================ + 8: Labour +============================================================================%%*/ + + + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + + +*<_minlaborage_> +/* <_minlaborage_note> + + 2001: 5 + PNADc: 14 + + */ + gen minlaborage = 14 + label variable minlaborage "Labor module application age" +* + +*----------8.1: 7 day reference overall----------------------------------------* + +*<_lstatus_> +/* <_lstatus_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4755 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4754 is V4754 + + */ + gen lstatus = . + replace lstatus = 1 if VD4002 == 1 & age >= minlaborage + replace lstatus = 2 if VD4002 == 2 & age >= minlaborage + replace lstatus = 3 if VD4001 == 2 & age >= minlaborage + recast byte lstatus + label variable lstatus "Labor status" + label define lstatus_lab 1 "Employed" 2 "Unemployed" 3 "Non-LF" + label values lstatus lstatus_lab + drop VD4002 VD4001 +* + +*<_potential_lf_> + gen potential_lf = VD4003 + recode potential_lf (2 = 0) + recast byte potential_lf + label variable potential_lf "Potential labour force status" + label define potential_lf_lab 0 "No" 1 "Yes" + label values potential_lf potential_lf_lab +* + +*<_underemployment_> + gen underemployment = . // Check + recast byte underemployment + label variable underemployment "Underemployment status" + label define underemployment_lab 0 "No" 1 "Yes" + label values underemployment underemployment_lab +* + +*<_nlfreason_> + gen nlfreason = VD4030 + recode nlfreason (2 = 1) (1 = 2) (4 = 3) (3 = 4) (5/6 = 5) + replace nlfreason = . if nlfreason == 3 & age >= 0 & age <= 29 + recast byte nlfreason + label variable nlfreason "Reason not in the labor force" + label define nlfreason_lab 1 "Student" 2 "Housekeeper" 3 "Retired" 4 "Disabled" 5 "Other" + label values nlfreason nlfreason_lab +* + +*<_unempldur_l_> + gen unempldur_l = . + label variable unempldur_l "Unemployment duration (months) lower bracket" +* + +*<_unempldur_u_> + gen unempldur_u = unempldur_l + label variable unempldur_u "Unemployment duration (months) upper bracket" +* + + + +*----------8.2: 7 day reference main job---------------------------------------* + + +*<_empstat_> +/* <_empstat_note> + + For all individuals + + Comparability throughout the years is compromised: + Until 1992: "funcionários públicos estatutários" (public servants) and "militares" (army) could not be identified + Until 1992: "trabalhadores domésticos" (domestic workers) inexisted + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + As of 1992: "production for own consumption" and "construction for own use" exist + As of 2001: "empregado sem declaração de carteira" (probably) became "empregados sem carteira" + As of 2001: "trabalhador doméstico sem declaração de carteira" (probably) became "trabalhadores domésticos sem carteira" + + 2001: V4756 is V4756 + + */ + rename VD4008 empstat + recode empstat (1/3 = 1) (6 = 2) (4 = 3) (5 = 4) + replace empstat = . if lstatus != 1 + recast byte empstat + label variable empstat "Employment status during past week primary 7 day recall" + label define empstat_lab 1 "Paid employee" 2 "Non-paid employee" 3 "Employer" 4 "Self-employed" 5 "Other, workers not classified by status" + label values empstat empstat_lab +* + +*<_industry_orig_> +/* <_industry_orig_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + Until 2006: V9907? was ? + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older? + + Comparability throughout the years is compromised: + Until 2000: one set of codes (all throughout) + 2002: Adopted standardised set of codes (CNAE) + + */ + gen str5 industry_orig = string(V4013, "%05.0f") + replace industry_orig = "" if lstatus != 1 | age < minlaborage | industry_orig == "." + label variable industry_orig "Original survey industry code, main job 7 day recall" +* + +*<_industrycat_isic_> + gen industrycat_isic = substr(industry_orig,1,2) + "00" if !missing(V4013) + replace industrycat_isic = "4600" if inlist(industry_orig, "48010", "48020", "48076", "48078") + replace industrycat_isic = "4700" if industrycat_isic == "4800" + replace industrycat_isic = "" if industrycat_isic == "0000" + label variable industrycat_isic "ISIC code of primary job 7 day recall)" +* + + +*<_industrycat10_> + gen industrycat10 = substr((industrycat_isic), 1, 2) + destring industrycat10, replace + replace industrycat10 = 1 if inrange(industrycat10,1,3) + replace industrycat10 = 2 if inrange(industrycat10,5,9) + replace industrycat10 = 3 if inrange(industrycat10,10,33) + replace industrycat10 = 4 if inrange(industrycat10,35,39) + replace industrycat10 = 5 if inrange(industrycat10,41,43) + replace industrycat10 = 6 if inrange(industrycat10,45,47) | inrange(industrycat10,55,56) + replace industrycat10 = 7 if inrange(industrycat10,49,53) | inrange(industrycat10,58,63) + replace industrycat10 = 8 if inrange(industrycat10,64,82) + replace industrycat10 = 9 if inrange(industrycat10,84,84) + replace industrycat10 = 10 if inrange(industrycat10,85,99) + recast int industrycat10 + replace industrycat10 = . if !inrange(industrycat10,1,10) + label variable industrycat10 "1 digit industry classification, primary job 7 day recall" + label define industrycat10_lab 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utility" 5 "Construction" 6 "Commerce" 7 "Transport and Communications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10 industrycat10_lab +* + +*<_industrycat4_> + gen industrycat4 = . + replace industrycat4 = 1 if industrycat10 == 1 + replace industrycat4 = 2 if (industrycat10 == 2 | industrycat10 == 3 | industrycat10 == 4 | industrycat10 == 5) + replace industrycat4 = 3 if (industrycat10 == 6 | industrycat10 == 7 | industrycat10 == 8 | industrycat10 == 9) + replace industrycat4 = 4 if industrycat10 == 10 + label variable industrycat4 "Broad Economic Activities classification, primary job 7 day recall" + label define industrycat4_lab 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4 industrycat4_lab +* + +*<_occup_orig_> + gen str4 occup_orig = string(V4010, "%04.0f") if !missing(V4010) + replace occup_orig = "" if lstatus != 1 | age < minlaborage + label variable occup_orig "Original occupation record primary job 7 day recall" +* + + +*<_occup_isco_> + * COD code is the same as ISCO 08 if not for some small changes (especially in armed forces) + gen occup_isco = occup_orig + replace occup_isco = "6220" if occup_isco == "6225" + replace occup_isco = "5160" if occup_isco == "5168" + replace occup_isco = "0000" if inrange(occup_isco, "0200", "0512") + label variable occup_isco "ISCO code of primary job 7 day recall" +* + + +*<_occup_skill_> + + gen occup_skill = . + replace occup_skill = 3 if lstatus == 1 & (substr(occup_isco, 1, 1) == "1" | substr(occup_isco, 1, 1) == "2" | substr(occup_isco, 1, 1) == "3") + replace occup_skill = 2 if lstatus == 1 & (substr(occup_isco, 1, 1) == "4" | substr(occup_isco, 1, 1) == "5" | substr(occup_isco, 1, 1) == "6" | substr(occup_isco, 1, 1) == "7" | substr(occup_isco, 1, 1) == "8") + replace occup_skill = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + recast byte occup_skill + label variable occup_skill "Skill based on ISCO standard primary job 7 day recall" + label define occup_skill_lab 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill occup_skill_lab +* + + +*<_occup_> + gen occup = . + replace occup = 1 if lstatus == 1 & substr(occup_isco, 1, 1) == "1" + replace occup = 2 if lstatus == 1 & substr(occup_isco, 1, 1) == "2" + replace occup = 3 if lstatus == 1 & substr(occup_isco, 1, 1) == "3" + replace occup = 4 if lstatus == 1 & substr(occup_isco, 1, 1) == "4" + replace occup = 5 if lstatus == 1 & substr(occup_isco, 1, 1) == "5" + replace occup = 6 if lstatus == 1 & substr(occup_isco, 1, 1) == "6" + replace occup = 7 if lstatus == 1 & substr(occup_isco, 1, 1) == "7" + replace occup = 8 if lstatus == 1 & substr(occup_isco, 1, 1) == "8" + replace occup = 9 if lstatus == 1 & substr(occup_isco, 1, 1) == "9" + replace occup = 0 if lstatus == 1 & substr(occup_isco, 1, 1) == "10" + recast byte occup + label variable occup "1 digit occupational classification, primary job 7 day recall" + label define occup_lab 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 occup_lab +* + +*<_ocusec_> +/* <_ocusec_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4012 ocusec + recode ocusec (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec + label variable ocusec "Sector of activity primary job 7 day recall" + label define ocusec_lab 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec ocusec_lab +* + +*<_wage_no_compen_> +/* <_wage_no_compen_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + rename V403412 wage_no_compen + replace wage_no_compen = . if lstatus != 1 | age < minlaborage + replace wage_no_compen = 0 if empstat == 2 + replace wage_no_compen = . if wage_no_compen > 999000000000 + format wage_no_compen %12.0f + label variable wage_no_compen "Last wage payment primary job 7 day recall" +* + +*<_unitwage_> + gen unitwage = 5 + replace unitwage = . if lstatus != 1 + recast byte unitwage + label variable unitwage "Last wage's time unit primary job 7 day recall" + label define unitwage_lab 1 "Daily" 2 "Weekly" 3 "Every two weeks" 4 "Bimonths" 5 "Monthly" 6 "Trimester" 7 "Biannual" 8 "Annually" 9 "Hourly" 10 "Other" + label values unitwage unitwage_lab +* + +*<_whours_> + rename V4039 whours + replace whours = . if lstatus != 1 + label variable whours "Hours of work in last week primary job 7 day recall" +* + +*<_wmonths_> + gen wmonths = . // V9612 + 12*V9611 + *replace wmonth = . if lstatus != 1 | wmonths > 12 + label variable wmonths "Months of work in past 12 months primary job 7 day recall" +* + +*<_contract_> +/* <_contract_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + */ + gen contract = 0 + replace contract = 1 if VD4009 == 1 | VD4009 == 3 | VD4009 == 5 | VD4009 == 7 + replace contract = . if lstatus != 1 + label variable contract "Employment has contract primary job 7 day recall" + label define contract_lab 0 "Without contract" 1 "With contract" + label values contract contract_lab +* + +*<_wage_total_> +/* <_wage_total_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: V4718 is V4768 + + 13º salário + + */ + gen wage_total = . //wage_no_compen*wmonths + *replace wage_total = wage_total + wage_no_compen if wmonths == 12 & contract == 1 + label variable wage_total "Annualized total wage primary job 7 day recall" +* + +*<_healthins_> + gen healthins = . + label variable healthins "Employment has health insurance primary job 7 day recall" + label define healthins_lab 0 "Without health insurance" 1 "With health insurance" + label values healthins healthins_lab +* + +*<_socialsec_> + rename V4032 socialsec // [2001: 4761] + recode socialsec (2 = 0) (1 = 1) + replace socialsec = . if lstatus != 1 + label variable socialsec "Employment has social security insurance primary job 7 day recall" + label define socialsec_lab 1 "With social security" 0 "Without social security" + label values socialsec socialsec_lab +* + +*<_union_> + gen union = . + label variable union "Union membership at primary job 7 day recall" + label define union_lab 0 "Not union member" 1 "Union member" + label values union union_lab +* + +*<_firmsize_l_> + gen firmsize_l = . + replace firmsize_l = 51 if V4018 == 4 + replace firmsize_l = V40181 if V4018 == 1 + replace firmsize_l = V40182 if V4018 == 2 + replace firmsize_l = V40183 if V4018 == 3 + recast byte firmsize_l + label variable firmsize_l "Firm size (lower bracket) primary job 7 day recall" +* + +*<_firmsize_u_> + gen firmsize_u = . + replace firmsize_u = V40181 if V4018 == 1 + replace firmsize_u = V40182 if V4018 == 2 + replace firmsize_u = V40183 if V4018 == 3 + label variable firmsize_u "Firm size (upperr 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_> +/* <_empstat_2_note> + + For all individuals + + */ + gen empstat_2 = V4043 + recode empstat_2 (1/4 = 1) (5 = 3) (6 = 4) (7 = 2) + replace empstat_2 = . if lstatus != 1 + recast byte empstat_2 + label variable empstat_2 "Employment status during past week secondary job 7 day recall" + label values empstat_2 empstat_lab +* + +*<_industry_orig_2_> +/* <_industry_orig_2_note> + + CNAE-Domiciliar + *Classificação Nacional de Atividades Econômicas (CNAE) + + */ + gen str5 industry_orig_2 = string(V4044, "%05.0f") + replace industry_orig_2 = "" if lstatus != 1 | age < minlaborage | industry_orig_2 == "." + label variable industry_orig_2 "Original survey industry code, secondary job 7 day recall" +* + +* + gen industrycat_isic_2 = substr(industry_orig_2,1,2) + "00" if !missing(V4044) + replace industrycat_isic_2 = "4600" if inlist(industry_orig_2, "48010", "48020", "48076", "48078") + replace industrycat_isic_2 = "4700" if industrycat_isic_2 == "4800" + label variable industrycat_isic_2 "ISIC code of secondary job 7 day recall)" +* + + +*<_industrycat10_2_> + gen industrycat10_2 = substr((industrycat_isic_2), 1, 2) + destring industrycat10_2, replace + replace industrycat10_2 = 1 if inrange(industrycat10_2,1,3) + replace industrycat10_2 = 2 if inrange(industrycat10_2,5,9) + replace industrycat10_2 = 3 if inrange(industrycat10_2,10,33) + replace industrycat10_2 = 4 if inrange(industrycat10_2,35,39) + replace industrycat10_2 = 5 if inrange(industrycat10_2,41,43) + replace industrycat10_2 = 6 if inrange(industrycat10_2,45,47) | inrange(industrycat10_2,55,56) + replace industrycat10_2 = 7 if inrange(industrycat10_2,49,53) | inrange(industrycat10_2,58,63) + replace industrycat10_2 = 8 if inrange(industrycat10_2,64,82) + replace industrycat10_2 = 9 if inrange(industrycat10_2,84,84) + replace industrycat10_2 = 10 if inrange(industrycat10_2,85,99) + recast int industrycat10_2 + replace industrycat10_2 = . if !inrange(industrycat10_2,1,10) + label variable industrycat10_2 "1 digit industry classification, secondary job 7 day recall" + label values industrycat10_2 industrycat10_lab +* + +*<_industrycat4_2_> + gen industrycat4_2 = . + replace industrycat4_2 = 1 if industrycat10_2 == 1 + replace industrycat4_2 = 2 if (industrycat10_2 == 2 | industrycat10_2 == 3 | industrycat10_2 == 4 | industrycat10_2 == 5) + replace industrycat4_2 = 3 if (industrycat10_2 == 6 | industrycat10_2 == 7 | industrycat10_2 == 8 | industrycat10_2 == 9) + replace industrycat4_2 = 4 if industrycat10_2 == 10 + label variable industrycat4_2 "Broad Economic Activity classification, secondary job 7 day recall" + label values industrycat4_2 industrycat4_lab +* + +*<_occup_orig_2_> + gen str4 occup_orig_2 = string(V4041, "%04.0f") if !missing(V4041) + replace occup_orig_2 = "" if lstatus != 1 | age < minlaborage + label variable occup_orig_2 "Original occupational record secondary job 7 day recall" +* + + +*<_occup_isco_2_> + gen occup_isco_2 = occup_orig_2 + replace occup_isco_2 = "6220" if occup_isco_2 == "6225" + replace occup_isco_2 = "5160" if occup_isco_2 == "5168" + replace occup_isco_2 = "0000" if inrange(occup_isco_2, "0200", "0512") + label variable occup_isco_2 "ISCO code of seconday job 7 day recall" +* + + +*<_occup_skill_2_> + gen occup_skill_2 = . + replace occup_skill_2 = 3 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "1" | substr(occup_isco_2, 1, 1) == "2" | substr(occup_isco_2, 1, 1) == "3") + replace occup_skill_2 = 2 if lstatus == 1 & (substr(occup_isco_2, 1, 1) == "4" | substr(occup_isco_2, 1, 1) == "5" | substr(occup_isco_2, 1, 1) == "6" | substr(occup_isco_2, 1, 1) == "7" | substr(occup_isco_2, 1, 1) == "8") + replace occup_skill_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + recast byte occup_skill_2 + label variable occup_skill_2 "Skill based on ISCO standard secondary job 7 day recall" + label values occup_skill_2 occup_skill_lab +* + + +*<_occup_2_> + gen occup_2 = . + replace occup_2 = 1 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "1" + replace occup_2 = 2 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "2" + replace occup_2 = 3 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "3" + replace occup_2 = 4 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "4" + replace occup_2 = 5 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "5" + replace occup_2 = 6 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "6" + replace occup_2 = 7 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "7" + replace occup_2 = 8 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "8" + replace occup_2 = 9 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "9" + replace occup_2 = 0 if lstatus == 1 & substr(occup_isco_2, 1, 1) == "10" + recast byte occup_2 + label variable occup_2 "1 digit occupational classification, secondary job 7 day recall" + label values occup_2 occup_lab +* + +*<_ocusec_2_> +/* <_ocusec_2_note> + + Do NOT code basis of occupation (ISCO) or industry (ISIC) code + + */ + rename V4043 ocusec_2 + recode ocusec_2 (2 = 1) (1 3 5/7 = 2) (4 = 4) + recast byte ocusec_2 + label variable ocusec_2 "Sector of activity secondary job 7 day recall" + label values ocusec_2 ocusec_lab +* + +*<_wage_no_compen_2_> +/* <_wage_no_compen_2_note> + + Prefer using gross wages, rather than net wages + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + */ + rename V405012 wage_no_compen_2 + replace wage_no_compen_2 = . if lstatus != 1 | age < minlaborage + replace wage_no_compen_2 = 0 if empstat == 2 + replace wage_no_compen_2 = . if wage_no_compen_2 > 999000000000 + format wage_no_compen_2 %12.0f + label variable wage_no_compen_2 "Last wage payment secondary job 7 day recall" +* + +*<_unitwage_2_> + gen unitwage_2 = 5 + replace unitwage_2 = . if lstatus != 1 + recast byte unitwage_2 + label variable unitwage_2 "Last wages' time unit secondary job 7 day recall" + label values unitwage_2 unitwage_lab +* + +*<_whours_2_> + rename V4056 whours_2 + replace whours_2 = . if lstatus != 1 + label variable whours_2 "Hours of work in last week secondary job 7 day recall" +* + +*<_wmonths_2_> + gen wmonths_2 = . + label variable wmonths_2 "Months of work in the past 12 months secondary job 7 day recall" +* + +*<_wage_total_2_> +/* <_wage_total_2_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2 = . // wage_no_compen_2*wmonths_2 + *replace wage_total_2 = wage_total_2 + wage_no_compen_2 if wmonth_2s == 12 & contract_2 == 1 + label variable wage_total_2 "Annualized total wage secondary job 7 day recall" +* + +*<_firmsize_l_2_>/ + gen firmsize_l_2 = . + recast byte firmsize_l_2 + label variable firmsize_l_2 "Firm size (lower bracket) secondary job 7 day recall" +* + +*<_firmsize_u_2_> + gen firmsize_u_2 = firmsize_l_2 + label variable firmsize_u_2 "Firm size (upper bracket) secondary job 7 day recall" +* +} + +*----------8.4: 7 day reference additional jobs--------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_> + gen t_hours_others = 52*V4062 + replace t_hours_others = . if lstatus != 1 + label variable t_hours_others "Annualized hours worked in all but primary and secondary jobs 7 day recall" + drop V4062 +* + +*<_t_wage_nocompen_others_> +/* <_t_wage_nocompen_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405922 = . if lstatus != 1 | age < minlaborage +* replace V1022 = 0 if empstat_others == 2 + gen t_wage_nocompen_others = . // wmonths_others*V1022 + label variable t_wage_nocompen_others "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_others_> +/* <_t_wage_others_note> + + There are no wmonths_others and empstat_others + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + replace V405912 = . if lstatus != 1 | age < minlaborage +* replace V1025 = 0 if empstat_others == 2 + gen t_wage_others = . // wmonths_others*V1025 + t_wage_nocompen_others + label variable t_wage_others "Annualized wage in all but primary and secondary jobs (12-mon ref period)" +* +} + +*----------8.5: 7 day reference total summary----------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_> + gen t_hours_total = 52*(whours + whours_2) + t_hours_others + replace t_hours_total = . if lstatus != 1 + label variable t_hours_total "Annualized hours worked in all jobs 7 day recall" +* + +*<_t_wage_nocompen_total_> +/* <_t_wage_nocompen_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total = . // wage_no_compen + wage_no_compen_2 + t_wage_nocompen_others + label variable t_wage_nocompen_total "Annualized wage in all jobs excl. bonuses, etc. 7 day recall" +* + +*<_t_wage_total_> +/* <_t_wage_total_note> + + There are no wmonths_total and empstat_total + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + 2001: 4719 is 4769 + + */ + gen t_wage_total = . // (wage_total + wage_total_2 + t_wage_others)*wmonths_total or V4769*wmonths_total? + label variable t_wage_total "Annualized total wage for all jobs 7 day recall" +* +} + +*----------8.6: 12 month reference overall-------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +/* <__note> + + 1992: A broader definition of "work" was adopted, that includes + "production for own consumption" and "construction for own use" + + 1992: skip pattern introduced + + */ + +*<_lstatus_year_> +/* <_lstatus_year_note> + + Comparability throughout the years is compromised: + "Trabalhou" (V9001) is compatible throughout, but "estava afastado" is not, + due to skip pattern introduction and order change (V9004 in 1990's and V9002 in 2000's); + With both, we get "tinha trabalho", which indicates employment/unemployment + + Until 2006: V4764 was V4764 + Until 2006 (except 1996 & 1997): "employed" could be answered by people 5 years or older + + 2001: V4763 is V4763 + + */ + gen lstatus_year = . + recast byte lstatus + label variable lstatus_year "Labor status during last year" + label values lstatus_year lstatus_lab +* + +*<_potential_lf_year_> + gen potential_lf_year = . + recast byte potential_lf_year + label variable potential_lf_year "Potential labour force status during last year" + label values potential_lf_year potential_lf_lab +* + +*<_underemployment_year_> + gen underemployment_year = . + recast byte underemployment_year + label variable underemployment_year "Underemployment status during last year" + label values underemployment_year underemployment_lab +* + +*<_nlfreason_year_> + gen nlfreason_year = . + recast byte nlfreason_year + label variable nlfreason_year "Reason not in the labor force during last year" + label values nlfreason_year nlfreason_lab +* + +*<_unempldur_l_year_> + gen unempldur_l_year = . + label variable unempldur_l_year "Unemployment duration (months) during last year lower bracket" +* + +*<_unempldur_u_year_> + gen unempldur_u_year = unempldur_l_year + label variable unempldur_u_year "Unemployment duration (months) during last year upper bracket" +* + + +*----------8.7: 12 month reference main job------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_year_> + gen empstat_year = . + replace empstat_year = . if lstatus_year != 1 + label variable empstat_year "Employment status during past week primary job 12 month recall" + label values empstat_year empstat_lab +* + + +*<_ocusec_year_> + gen byte ocusec_year = . + label var ocusec_year "Sector of activity primary job 12 month recall" + la de lblocusec_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_year lblocusec_year +* + + +*<_industry_orig_year_> + gen industry_orig_year = . + label var industry_orig_year "Original industry record main job 12 month recall" +* + + +*<_industrycat_isic_year_> + gen industrycat_isic_year = . + label var industrycat_isic_year "ISIC code of primary job 12 month recall" +* + +*<_industrycat10_year_> + gen byte industrycat10_year = . + label var industrycat10_year "1 digit industry classification, primary job 12 month recall" + la de lblindustrycat10_year 1 "Agriculture" 2 "Mining" 3 "Manufacturing" 4 "Public utilities" 5 "Construction" 6 "Commerce" 7 "Transport and Comnunications" 8 "Financial and Business Services" 9 "Public Administration" 10 "Other Services, Unspecified" + label values industrycat10_year lblindustrycat10_year +* + + +*<_industrycat4_year_> + gen byte industrycat4_year=industrycat10_year + recode industrycat4_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_year "Broad Economic Activities classification, primary job 12 month recall" + la de lblindustrycat4_year 1 "Agriculture" 2 "Industry" 3 "Services" 4 "Other" + label values industrycat4_year lblindustrycat4_year +* + + +*<_occup_orig_year_> + gen occup_orig_year = . + label var occup_orig_year "Original occupation record primary job 12 month recall" +* + + +*<_occup_isco_year_> + gen occup_isco_year = "" + label var occup_isco_year "ISCO code of primary job 12 month recall" +* + + +*<_occup_year_> + gen byte occup_year = . + label var occup_year "1 digit occupational classification, primary job 12 month recall" + la de lbloccup_year 1 "Managers" 2 "Professionals" 3 "Technicians" 4 "Clerks" 5 "Service and market sales workers" 6 "Skilled agricultural" 7 "Craft workers" 8 "Machine operators" 9 "Elementary occupations" 10 "Armed forces" 99 "Others" + label values occup_year lbloccup_year +* + + +*<_occup_skill_year_> + gen occup_skill_year = . + replace occup_skill_year = 3 if inrange(occup_year, 1, 3) + replace occup_skill_year = 2 if inrange(occup_year, 4, 8) + replace occup_skill_year = 1 if occup_year == 9 + la de lblskillyear 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_year lblskillyear + label var occup_skill_year "Skill based on ISCO standard primary job 12 month recall" +* + + +*<_wage_no_compen_year_> + gen double wage_no_compen_year = . + label var wage_no_compen_year "Last wage payment primary job 12 month recall" +* + + +*<_unitwage_year_> + gen unitwage_year = . + recast byte unitwage_year + label variable unitwage_year "Last wage's time unit primary job 12 month recall" + label values unitwage_year unitwage_lab +* + +*<_whours_year_> + gen whours_year = . + label variable whours_year "Hours of work in last week primary job 12 mon recall" +* + +*<_wmonths_year_> + gen wmonths_year = . + label variable wmonths_year "Months of work in past 12 months primary job 12 month recall" +* + +*<_wage_total_year_> +/* <_wage_total_year_note> + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen wage_total_year = . + label variable wage_total_year "Annualized total wage primary job 12 month recall" +* + +*<_contract_year_> +/* <_contract_year_note> + + Comparability throughout the years is compromised: + Until 1992: "empregados" (workers) contained both "com carteira" and "sem carteira" (formal and informal) + + */ + gen contract_year =. + label variable contract_year "Employment has contract primary job 12 month recall" + label values contract_year contract_lab +* + +*<_healthins_year_> + gen healthins_year = . + label variable healthins_year "Employment has health insurance primary job 12 month recall" + label values healthins_year healthins_lab +* + +*<_socialsec_year_> + gen socialsec_year = . + label variable socialsec_year "Employment has social security insurance primary job 12 month recall" + label values socialsec_year socialsec_lab +* + +*<_union_year_> + gen union_year =. + replace union_year = . if lstatus_year != 1 + label variable union_year "Union membership at primary job 12 month recall" + label values union_year union_lab +* + +*<_firmsize_l_year_> + gen firmsize_l_year = . + recast byte firmsize_l_year + label variable firmsize_l_year "Firm size (lower bracket) primary job 12 month recall" +* + +*<_firmsize_u_year_> + gen firmsize_u_year = firmsize_l_year + label variable firmsize_u_year "Firm size (upper bracket), primary job 12 month recall" +* + + +*----------8.8: 12 month reference secondary job-------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + + +*<_empstat_2_year_> + gen byte empstat_2_year = . + label var empstat_2_year "Employment status during past week secondary job 12 month recall" + label values empstat_2_year lblempstat_year +* + + +*<_ocusec_2_year_> + gen byte ocusec_2_year = . + label var ocusec_2_year "Sector of activity secondary job 12 month recall" + la de lblocusec_2_year 1 "Public Sector, Central Government, Army" 2 "Private, NGO" 3 "State owned" 4 "Public or State-owned, but cannot distinguish" + label values ocusec_2_year lblocusec_2_year +* + + + +*<_industry_orig_2_year_> + gen industry_orig_2_year = . + label var industry_orig_2_year "Original survey industry code, secondary job 12 month recall" +* + + + +*<_industrycat_isic_2_year_> + gen industrycat_isic_2_year = . + label var industrycat_isic_2_year "ISIC code of secondary job 12 month recall" +* + + +*<_industrycat10_2_year_> + gen byte industrycat10_2_year = . + label var industrycat10_2_year "1 digit industry classification, secondary job 12 month recall" + label values industrycat10_2_year lblindustrycat10_year +* + + +*<_industrycat4_2_year_> + gen byte industrycat4_2_year=industrycat10_2_year + recode industrycat4_2_year (1=1)(2 3 4 5 =2)(6 7 8 9=3)(10=4) + label var industrycat4_2_year "Broad Economic Activities classification, secondary job 12 month recall" + label values industrycat4_2_year lblindustrycat4_year +* + + +*<_occup_orig_2_year_> + gen occup_orig_2_year = . + label var occup_orig_2_year "Original occupation record secondary job 12 month recall" +* + + +*<_occup_isco_2_year_> + gen occup_isco_2_year = "" + label var occup_isco_2_year "ISCO code of secondary job 12 month recall" +* + + +*<_occup_2_year_> + gen byte occup_2_year = . + label var occup_2_year "1 digit occupational classification, secondary job 12 month recall" + label values occup_2_year lbloccup_year +* + + +*<_occup_skill_2_year_> + gen occup_skill_2_year = . + replace occup_skill_2_year = 3 if inrange(occup_2_year, 1, 3) + replace occup_skill_2_year = 2 if inrange(occup_2_year, 4, 8) + replace occup_skill_2_year = 1 if occup_2_year == 9 + la de lblskilly2 1 "Low skill" 2 "Medium skill" 3 "High skill" + label values occup_skill_2_year lblskilly2 + label var occup_skill_2_year "Skill based on ISCO standard secondary job 12 month recall" +* + + +*<_wage_no_compen_2_year_> + gen double wage_no_compen_2_year = . + label var wage_no_compen_2_year "Last wage payment secondary job 12 month recall" +* + +*<_unitwage_2_year_> + gen unitwage_2_year = . + recast byte unitwage_2_year + label variable unitwage_2_year "Last wage' time unit secondary job 12 month recall" + label values unitwage_2_year unitwage_lab +* + +*<_whours_2_year_> + gen whours_2_year = . + label variable whours_2_year "Hours of work in last week secondary job 12 month recall" +* + +*<_wmonths_2_year_> + gen wmonths_2_year = . + label variable wmonths_2_year "Months of work in past 12 months secondary job 12 month recall" +* + +*<_wage_total_2_year_> +/* <_wage_total_2_year_note> + + 1980's: doesn't exist (only "Primary" and "All Other" jobs do) + + Prefer using gross wages, rather than net wages + + */ + gen wage_total_2_year = . + label variable wage_total_2_year "Annualized total wage secondary job 12 month recall" +* + +*<_firmsize_l_2_year_> + gen firmsize_l_2_year = . + recast byte firmsize_l_2_year + label variable firmsize_l_2_year "Firm size (lower bracket) secondary job 12 month recall" +* + +*<_firmsize_u_2_year_> + gen firmsize_u_2_year = firmsize_l_2_year + label variable firmsize_u_2_year "Firm size (upper bracket) secondary job 12 month recall" +* + + +*----------8.9: 12 month reference additional jobs-----------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_others_year_> + gen t_hours_others_year = . + label variable t_hours_others_year "Annualized hours worked in all but primary and secondary job 12 month recall" +* + +*<_t_wage_nocompen_others_year_> +/* <_t_wage_nocompen_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_others_year = . + label variable t_wage_nocompen_others_year "Annualized wage in all but 1st & 2nd jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_others_year_> +/* <_t_wage_others_year_note> + + There are no wmonths_others_year and empstat_others_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_others_year = . + label variable t_wage_others_year "Annualized wage in all but primary and secondary job 12 month recall" +* +} + +*----------8.10: 12 month total summary----------------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_t_hours_total_year_> + gen t_hours_total_year = . + label variable t_hours_total_year "Annualized hours worked in all job 12 month recall" +* + +*<_t_wage_nocompen_total_year_> +/* <_t_wage_nocompen_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_nocompen_total_year = . + label variable t_wage_nocompen_total_year "Annualized wage in all jobs excl. bonuses, etc. 12 month recall" +* + +*<_t_wage_total_year_> +/* <_t_wage_total_year_note> + + There are no wmonths_total_year and empstat_total_year + + Prefer using gross wages, rather than net wages + + 1980's: only "Primary" and "All Other" jobs exist + + */ + gen t_wage_total_year = . + label variable t_wage_total_year "Annualized total wage for all jobs 12 month recall" +* +} + +*----------8.11: Overall across reference periods------------------------------* +* Since labels are the same as main job, values are labelled using main job labels + +{ +*<_njobs_> +/* <_njobs_note> + + 1 = one; 3 = two; 5 = 3 or more + + */ + rename V4009 njobs + recode njobs (1 = 1) (3 = 2) (5 = 3) // 3 = 3+ + label variable njobs "Total number of jobs" +* + +*<_t_hours_annual_> + gen t_hours_annual = . + label variable t_hours_annual "Total hours worked in all jobs in the previous 12 months" +* + +*<_linc_nc_> + gen linc_nc = . + label variable linc_nc "Total annual wage income in all jobs, excl. bonuses, etc." +* + +*<_laborincome_> + gen laborincome = . + label variable 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'"' + } + + set trace on + * 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." + } + set trace off + + +* + +} + + +*<_% 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'/`out_file'", replace + +* +