* 2016_panel_eu_silc_r_ver_2022_03.do * * STATA Command Syntax File * Stata 17; * * Transforms the EU-SILC CSV-data (as released by Eurostat) into a Stata systemfile * * EU-SILC Panel 2016 - release 2021-09 / DOI: TBD * * When publishing statistics derived from the EU-SILC UDB, please state as source: * "EU-SILC UDB - version of 2021-09" * * Personal register file: * This version of the EU-SILC has been delivered in form of seperate country files. * The following do-file transforms the raw data into a single Stata file using all available country files. * Country files are delivered in the format UDB_l*country_stub*16R.csv * * (c) GESIS 2022-06-02 * * PLEASE NOTE * For Differences between data as described in the guidelines * and the anonymised user database as well as country specific anonymisation measures see: * L-2016 DIFFERENCES BETWEEN DATA COLLECTED.doc * * This Stata-File is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * * Pforr, Klaus and Johanna Jung (2022): 2016_panel_eu_silc_r_ver_2022_03.do. * Stata-Syntax for transforming EU-SILC csv data into a Stata-Systemfile. * * https://www.gesis.org/gml/european-microdata/eu-silc/ * * Contact: klaus.pforr@gesis.org /* Initialization commands */ clear capture log close set more off set linesize 250 set varabbrev off #delimit ; * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; * CONFIGURATION SECTION - Start ; * The following command should contain the complete path and * name of the Stata log file. * Change LOG_FILENAME to your filename ; local log_file "LOG_FILENAME" ; * The following command should contain the complete path where the CSV data files are stored * Change CSV_PATH to your file path (e.g.: C:/EU-SILC/Longitudinal 2005-2018) * Use forward slashes and keep path structure as delivered by Eurostat CSV_PATH/COUNTRY/YEAR; global csv_path "CSV_PATH" ; * The following command should contain the complete path and * name of the STATA file, usual file extension "dta". * Change STATA_FILENAME to your final filename ; local stata_file "STATA_FILENAME" ; * CONFIGURATION SECTION - End ; * There should be probably nothing to change below this line ; * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; * Loop to open and convert csv files into one dta file ; tempfile temp ; save `temp', emptyok ; foreach CC in AT BE BG CH CY CZ DK EE EL ES FI FR HR HU IE IS IT LT LU LV MT NL NO PL PT RO RS SE SI SK UK{ ; cd "$csv_path/`CC'/2016" ; import delimited using "UDB_l`CC'16R.csv", case(upper) clear asdouble ; append using `temp', force ; save `temp', replace ; } ; * Countries in data file are sorted in alphanumeric order ; sort RB020 ; log using "`log_file'", replace text ; * Definition of variable labels ; label variable RB010 "Year of the survey" ; label variable RB020 "Country alphanumeric" ; label variable RB030 "Personal ID" ; label variable RB040 "Current household ID" ; label variable RB070 "Quarter of birth" ; label variable RB070_F "Flag" ; label variable RB080 "Year of birth" ; label variable RB080_F "Flag" ; label variable RB090 "Sex" ; label variable RB090_F "Flag" ; label variable RB200 "Residential status" ; label variable RB200_F "Flag" ; label variable RB210 "Basic activity status" ; label variable RB210_F "Flag" ; label variable RB220 "Father ID" ; label variable RB220_F "Flag" ; label variable RB230 "Mother ID" ; label variable RB230_F "Flag" ; label variable RB240 "Spouse/partner ID" ; label variable RB240_F "Flag" ; label variable RB245 "Respondent status" ; label variable RB245_F "Flag" ; label variable RB250 "Data status" ; label variable RB250_F "Flag" ; label variable RB260 "Type of interview" ; label variable RB260_F "Flag" ; label variable RB270 "Personal ID of proxy" ; label variable RB270_F "Flag" ; label variable RX020 "Age at the end of the income reference period" ; label variable RX010 "Age at the date of the interview" ; label variable RB060 "Personal base weight" ; label variable RB060_F "Flag" ; label variable RB062 "Longitudinal weight (two-year duration)" ; label variable RB062_F "Flag" ; label variable RB063 "Longitudinal weight (three-year duration)" ; label variable RB063_F "Flag" ; label variable RB064 "Longitudinal weight (four-year duration)" ; label variable RB064_F "Flag" ; label variable RB100 "Sample person or co-resident" ; label variable RB100_F "Flag" ; label variable RB110 "Membership status" ; label variable RB110_F "Flag" ; label variable RB120 "Moved to" ; label variable RB120_F "Flag" ; label variable RB140 "Quarter moved out or died (BE: Month; NL: not provided)" ; label variable RB140_F "Flag" ; label variable RB150 "Year moved out or died" ; label variable RB150_F "Flag" ; label variable RB160 "Number of months in household during the income reference period" ; label variable RB160_F "Flag" ; label variable RB170 "Main activity status during the income reference period" ; label variable RB170_F "Flag" ; label variable RB180 "Quarter moved in (BE: Month; NL: not provided)" ; label variable RB180_F "Flag" ; label variable RB190 "Year moved in" ; label variable RB190_F "Flag" ; * Definition of category labels ; label define RB070_VALUE_LABELS 1 "January, February, March" 2 "April, May, June" 3 "July, August, September" 4 "October, November, December" ; label define RB070_F_VALUE_LABELS 1 "filled" -1 "missing" ; label define RB080_VALUE_LABELS 1935 "1935 or before" 1936 "PT: 1936 and before" 1940 "MT: 1936-1940" 1942 "DE: 1942 and before" 1945 "MT: 1941-1945" 1950 "MT: 1946-1950" 1955 "MT: 1951-1955" 1960 "MT: 1956-1960" 1965 "MT: 1961-1965" 1970 "MT: 1966-1970" 1975 "MT: 1971-1975" 1980 "MT: 1976-1980" 1985 "MT: 1981-1985" 1990 "MT: 1986-1990" 1995 "MT: 1991-1995" 2000 "MT: 1996-2000" 2005 "MT: 2001-2005" 2010 "MT: 2006-2010" 2016 "MT: 2011-2016" ; label define RB080_F_VALUE_LABELS 1 "filled" -1 "missing" ; label define RB090_VALUE_LABELS 1 "Male" 2 "Female" ; label define RB090_F_VALUE_LABELS 1 "filled" -1 "missing" ; label define RB200_VALUE_LABELS 1 "currently living in the household" 2 "temporarily absent" ; label define RB200_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (RB110 not = 1, 2, 3 or 4)" ; label define RB210_VALUE_LABELS 1 "at work" 2 "unemployed" 3 "in retirement or early retirement" 4 "other inactive person" ; label define RB210_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (RB110 not = 1, 2, 3 or 4)" ; label define RB220_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (father is not a household member) or (RB110 not = 1, 2, 3 or 4)" ; label define RB230_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (mother is not a household member) or (RB110 not = 1, 2, 3 or 4)" ; label define RB240_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (spouse/partner is not a household member) or (RB110 not = 1,2, 3 or 4)" ; label define RB245_VALUE_LABELS 1 "current household member aged 16 and over (all hm aged 16+ interviewed)" 2 "selected respondent (only selected hm aged 16+ interviewed)" 3 "not selected respondent(only selected hm aged 16+ interviewed)" 4 "not eligible person(Hm aged less than 16)" ; label define RB245_F_VALUE_LABELS 1 "filled" -2 "not applicable (RB110 not = 1, 2, 3 or 4)" ; label define RB250_VALUE_LABELS 11 "Information only completed from interview (information or interview completed)" 12 "Information only completed from registers (information or interview completed)" 13 "Information completed from both: interview and registers (information or interview completed)" 14 "Information completed from full-record imputation (information or interview completed)" 21 "Individual unable to respond and no proxy possible (interview not completed though contact made)" 22 "Failed to return self-completed questionnaire (interview not completed though contact made)" 23 "Refusal to cooperate (interview not completed though contact made)" 31 "Individual not contacted because temporarily away and no proxy possible" 32 "Individual not contacted for other reasons" 33 "Information not completed: reason unknown" ; label define RB250_F_VALUE_LABELS 1 "filled" -2 "na (RB245 not = 1,2 or 3)" ; label define RB260_VALUE_LABELS 1 "face to face interview-PAPI" 2 "face to face interview-CAPI" 3 "CATI, telephone interview" 4 "self-administered by respondent" 5 "proxy interview" 5 "Computer assisted web interviewing-CAWI " 6 "Face to face interview-PAPI with proxy " 7 "Face to face interview-CAPI with proxy " 8 "CATI, telephone interview with proxy " 9 "Self-administered by respondent with proxy " 10 "Computer assisted web interviewing-CAWI with proxy " ; label define RB260_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "na (RB250 not=11 or 13)" ; label define RB270_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "na (RB260 not=5)" ; label define RX010_VALUE_LABELS 80 "80 or over" ; label define RX020_VALUE_LABELS 80 "80 or over" ; label define RB060_F_VALUE_LABELS 1 "filled" ; label define RB062_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (no 2-year trajectory for the individual, i.e. individual in first wave)" ; label define RB063_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (no 3-year trajectory for the individual, i.e. individual in first or second wave)" ; label define RB064_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (no 4-year trajectory for the individual, i.e. individual in first, second or third wave)" ; label define RB100_VALUE_LABELS 1 "sample person" 2 "co-resident" ; label define RB100_F_VALUE_LABELS 1 "filled" -1 "missing" ; label define RB110_VALUE_LABELS 1 "Was in this household in previous waves or current household member (current household member)" 2 "Moved into this household from another sample household since previous wave (current household member)" 3 "Move into this household from outside sample since previous wave (current household member)" 4 "Newly born into this household since last wave (current household member)" 5 "Moved out since previous wave or last interview if not contacted in previous wave (not current household member)" 6 "Died (not current household member)" 7 "Lived in hh at least 3 mon during inc ref per & was not recorded in register of hh (not current hh member)" ; label define RB110_F_VALUE_LABELS 1 "filled" -1 "missing" ; label define RB120_VALUE_LABELS 1 "To a private household in the country" 2 "To a collective household or institution in the country" 3 "Abroad" 4 "Lost" ; label define RB120_F_VALUE_LABELS 1 "filled" -2 "not applicable (RB110 not = 5)" ; label define RB140_VALUE_LABELS 1 "1st quarter. BE:January" 2 "2nd quarter. BE:February" 3 "3rd quarter. BE:March" 4 "4th quarter. BE:April" 5 "BE: May" 6 "BE: June" 7 "BE: July" 8 "BE: August" 9 "BE: September" 10 "BE: October" 11 "BE: November" 12 "BE: December" ; label define RB140_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (RB110 not = 5 or 6)" ; label define RB150_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (RB110 not = 5 or 6)" ; label define RB160_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (RB110 not = 5 or 6 or 7)" ; label define RB170_VALUE_LABELS 1 "At work" 2 "Unemployed" 3 "In retirement or early retirement or has given up business" 4 "Other inactive person" ; label define RB170_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (RB110 not = 5 or 6 or 7)" ; label define RB180_VALUE_LABELS 1 "1st quarter. BE:January" 2 "2nd quarter. BE:February" 3 "3rd quarter. BE:March" 4 "4th quarter. BE:April" 5 "BE: May" 6 "BE: June" 7 "BE: July" 8 "BE: August" 9 "BE: September" 10 "BE: October" 11 "BE: November" 12 "BE: December" ; label define RB180_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (RB110 not = 3)" ; label define RB190_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (RB110 not = 3)" ; * Attachement of category labels to variable ; label values RB070 RB070_VALUE_LABELS ; label values RB070_F RB070_F_VALUE_LABELS ; label values RB080 RB080_VALUE_LABELS ; label values RB080_F RB080_F_VALUE_LABELS ; label values RB090 RB090_VALUE_LABELS ; label values RB090_F RB090_F_VALUE_LABELS ; label values RB200 RB200_VALUE_LABELS ; label values RB200_F RB200_F_VALUE_LABELS ; label values RB210 RB210_VALUE_LABELS ; label values RB210_F RB210_F_VALUE_LABELS ; label values RB220_F RB220_F_VALUE_LABELS ; label values RB230_F RB230_F_VALUE_LABELS ; label values RB240_F RB240_F_VALUE_LABELS ; label values RB245 RB245_VALUE_LABELS ; label values RB245_F RB245_F_VALUE_LABELS ; label values RB250 RB250_VALUE_LABELS ; label values RB250_F RB250_F_VALUE_LABELS ; label values RB260 RB260_VALUE_LABELS ; label values RB260_F RB260_F_VALUE_LABELS ; label values RB270_F RB270_F_VALUE_LABELS ; label values RX010 RX010_VALUE_LABELS ; label values RX020 RX020_VALUE_LABELS ; label values RB060_F RB060_F_VALUE_LABELS ; label values RB062_F RB062_F_VALUE_LABELS ; label values RB063_F RB063_F_VALUE_LABELS ; label values RB064_F RB064_F_VALUE_LABELS ; label values RB100_F RB100_F_VALUE_LABELS ; label values RB110_F RB110_F_VALUE_LABELS ; label values RB120_F RB120_F_VALUE_LABELS ; label values RB140_F RB140_F_VALUE_LABELS ; label values RB150_F RB150_F_VALUE_LABELS ; label values RB160_F RB160_F_VALUE_LABELS ; label values RB170_F RB170_F_VALUE_LABELS ; label values RB180_F RB180_F_VALUE_LABELS ; label values RB190_F RB190_F_VALUE_LABELS ; label values RB100 RB100_VALUE_LABELS ; label values RB110 RB110_VALUE_LABELS ; label values RB120 RB120_VALUE_LABELS ; label values RB140 RB140_VALUE_LABELS ; label values RB170 RB170_VALUE_LABELS ; label values RB180 RB180_VALUE_LABELS ; label data "Personal register file 2016" ; compress ; save "`stata_file'", replace ; log close ; set more on #delimit cr