* 2016_09-18_cross_eu_silc_pers_reg_r.do * * STATA Command Syntax File * Stata 15.1; * * Transforms the EU-SILC CSV-data (as released by Eurostat) into a Stata systemfile * * EU-SILC - Cross 2016 Version September 2018 * 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_c*country_stub*16R.csv * * * PLEASE NOTE * For Differences between data as described in the guidelines * and the anonymised user database as well as country specific anonymisation measures see: * C-2016 DIFFERENCES BETWEEN DATA COLLECTED.doc * * (c) GESIS 2018-12-10 * GESIS - Leibniz Institute for the Social Sciences * German Microdata Lab * Valentina Ponomarenko * https://www.gesis.org/gml/european-microdata/eu-silc/ * * Contact: valentina.ponomarenko@gesis.org /* Initialization commands */ clear capture log close set more off version 15.1 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/Crossectional 2004-2017) * 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 DE 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_c`CC'16R.csv", case(preserve) clear ; append using `temp', force ; save `temp', replace ; } ; * Countries in data file are sorted in alphanumeric order ; sort RB020 ; log using "`log_file'", replace text ; * Note that some variables in the csv-data file might in lowercase * To ensure that the dataset contains only variable names in uppercase ; foreach var of varlist _all { ; local newname = upper("`var'") ; cap rename `var' `newname' ; } ; * Definition of variable labels ; label variable RB010 "Year of the survey" ; label variable RB020 "Country alphanumeric" ; label variable RB030 "Personal ID" ; label variable RB031 "Year of immigration - grouped in 5 year classes" ; label variable RB031_F "Flag" ; 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 RB050 "Personal cross-sectional weight" ; label variable RB050_F "Flag" ; label variable RL010 "Education at pre-school:hours of education during an usual week" ; label variable RL010_F "Flag" ; label variable RL020 "Education at compulsory school:hours of education during an usual week" ; label variable RL020_F "Flag" ; label variable RL030 "Childcare at centre-based services:hours of child care during an usual week" ; label variable RL030_F "Flag" ; label variable RL040 "Childcare at day-care centre:hours of child care during an usual week" ; label variable RL040_F "Flag" ; label variable RL050 "Childcare by a professional child-miner:hours of child care during an usual week" ; label variable RL050_F "Flag" ; label variable RL060 "Childcare by grand-parents/other hhld members/relatives etc: ours during an usual week" ; label variable RL060_F "Flag" ; label variable RL070 "Children cross-sectional weight for child care" ; label variable RL070_F "Flag" ; label variable RX030 "Household ID" ; label variable RX040 "Work intensity" ; label variable RX050 "Low work intensity status"; label variable RX060 "Severely materially deprived household"; label variable RX070 "At risk of poverty or social exclusion"; label variable RC010 "Payment for the cost of formal childcare services"; label variable RC010_F "Flag" ; label variable RC020 "Proportion of the cost of formal childcare services paid"; label variable RC020_F "Flag" ; label variable RC030 "Who pays/contributes to the cost of formal childcare services"; label variable RC030_F "Flag" ; label variable RC070 "Payment for tuition fees"; label variable RC070_F "Flag" ; label variable RC080 "Part of the tuition fees paid"; label variable RC080_F "Flag" ; label variable RC090 "Who pays/ contributes to the tuition fees"; label variable RC090_F "Flag" ; * Definition of category labels ; label define RB031_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "not applicable (no immigration for the person)" ; 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 1933 "1933 or before" 1934 "PT: 1934 and before" ; 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 RB050_F_VALUE_LABELS 1 "filled" -2 "Not applicable (RB110 not equal to 1, 2, 3 or 4)" -7 "Not applicable RB010 not equal last year" ; label define RL010_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "na (person not admitted to pre-school because of her age)" ; label define RL020_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "na (person is not admitted to compulsory school)" ; label define RL030_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "na (person is neither at pre-school nor at school or is more than twelve years old" ; label define RL040_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "na (person is more than twelve years old)" ; label define RL050_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "na (person is more than twelve years old)" ; label define RL060_F_VALUE_LABELS 1 "filled" -1 "missing" -2 "na (person is more than twelve years old)" ; label define RL070_F_VALUE_LABELS 1 "filled" -2 "na (persons aged more than 12 years old at the date of interview)" ; label define RX050_VALUE_LABELS 0 "no low work intensity" 1 "low work intensity" 2 "not applicable" ; label define RX060_VALUE_LABELS 0 "not severely deprived" 1 "severely deprived" ; label define RX070_VALUE_LABELS 000 "not ARP/not severely materially deprived/no low work intensity" 001 "not ARP/not severely materially deprived/low work intensity" 010 "not ARP/severely materially deprived/no low work intensity" 011 "not ARP/severely materially deprived/low work intensity" 100 "ARP/not severely materially deprived/no low work intensity" 101 "ARP/not severely materially deprived/low work intensity" 110 "ARP/severely materially deprived/no low work intensity" 111 "ARP/severely materially deprived/low work intensity" ; label define RB031_VALUE_LABELS 2015 "2015 - 2011" 2010 "2010 - 2006" 2005 "2005 - 2001" 2000 "2000 - 1996" 1995 "1995 - 1991" 1990 "1990 - 1986" 1985 "1985 - 1981" 1980 "1980 - 1976" 1975 "1975 - 1971" 1970 "1970 - 1966" 1965 "1965 - 1961" 1960 "1960 - 1956" 1955 "1955 - 1951" 1950 "1950 - 1946" 1945 "1945 - 1941" 1940 "1940 - 1936" 1935 "<=1935" ; label define RC010_VALUE_LABELS 1 "Yes" 2 "No" ; label define RC010_F_VALUE_LABELS 1 "Filled" -1 "Missing" -4 "No formal childcare for this child (RL030<1 AND RL040<1) OR not current household member (RB110 not in (1,2,3,4))" -5 "Not applicable (person is more than 12 years old)" -7 "Not applicable RB010 ≠ 2016" ; label define RC020_VALUE_LABELS 1 "Full price (full cost)" 2 "Reduced price (subsidised by government, employer, private person, etc.)" 9 "Do not know" ; label define RC020_F_VALUE_LABELS 1 "Filled" -1 "Missing" -2 "Not applicable (RC010 = 2)" -4 "No formal childcare for this child (RL030<1 AND RL040<1) OR not current household member (RB110 not in (1,2,3,4))" -5 "Not applicable (person is more than 12 years old)" -7 "Not applicable RB010 ≠ 2016" ; label define RC030_VALUE_LABELS 1 "Government or local authorities" 2 "Employer" 3 "Other institutions (e.g. church, non-profit organisations)" 4 "Private persons who are not household members" 5 "Other" 9 "Do not know" ; label define RC030_F_VALUE_LABELS 1 "Filled" -1 "Missing" -2 "Not applicable (RC020 = 1 OR RC020=9)" -4 "No formal childcare for this child (RL030<1 AND RL040<1) OR not current household member (RB110 not in (1,2,3,4))" -5 "Not applicable (person is more than 12 years old)" -7 "Not applicable RB010 ≠ 2016" ; label define RC070_VALUE_LABELS 1 "Yes" 2 "No" ; label define RC070_F_VALUE_LABELS 1 "Filled" -1 "Missing" -4 "Person does not follow formal education OR not current household member (RB110 not in (1,2,3,4))" -7 "Not applicable RB010 ≠ 2016" ; label define RC080_VALUE_LABELS 1 "Full price (full cost)" 2 "Reduced price (subsidised by government, employer, private person, etc.)" 9 "Do not know" ; label define RC080_F_VALUE_LABELS 1 "Filled" -1 "Missing" -2 "Not applicable (RC070=2)" -4 "Person does not follow formal education OR not current household member (RB110 not in (1,2,3,4))" -7 "Not applicable RB010 ≠ 2016" ; label define RC090_VALUE_LABELS 1 "Government or local authorities" 2 "Employer" 3 "Other institutions (e.g. church, non-profit organisations)" 4 "Private persons who are not household members" 5 "Other" 9 "Do not know" ; label define RC090_F_VALUE_LABELS 1 "Filled" -1 "Missing" -2 "Not applicable (RC080=1 OR RC080=9) OR not current household member (RB110 not in (1,2,3,4))" -4 "Person does not follow formal education" -7 "Not applicable RB010 ≠ 2016" ; * Attachement of category labels to variable ; label values RB031 RB031_VALUE_LABELS ; label values RB031_F RB031_F_VALUE_LABELS ; 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 RX050 RX050_VALUE_LABELS ; label values RL010_F RL010_F_VALUE_LABELS ; label values RL020_F RL020_F_VALUE_LABELS ; label values RL030_F RL030_F_VALUE_LABELS ; label values RL040_F RL040_F_VALUE_LABELS ; label values RL050_F RL050_F_VALUE_LABELS ; label values RL060_F RL060_F_VALUE_LABELS ; label values RL070_F RL070_F_VALUE_LABELS ; label values RB050_F RB050_F_VALUE_LABELS ; label values RX060 RX060_VALUE_LABELS ; label values RX070 RX070_VALUE_LABELS ; label values RC010 RC010_VALUE_LABELS ; label values RC010_F RC010_F_VALUE_LABELS ; label values RC020 RC020_VALUE_LABELS ; label values RC020_F RC020_F_VALUE_LABELS ; label values RC030 RC030_VALUE_LABELS ; label values RC030_F RC030_F_VALUE_LABELS ; label values RC070 RC070_VALUE_LABELS ; label values RC070_F RC070_F_VALUE_LABELS ; label values RC080 RC080_VALUE_LABELS ; label values RC080_F RC080_F_VALUE_LABELS ; label values RC090 RC090_VALUE_LABELS ; label values RC090_F RC090_F_VALUE_LABELS ; compress ; save "`stata_file'", replace ; log close ; set more on #delimit cr