* 2012_4_cross_eu_silc_hhld_reg_d.do * * STATA Command Syntax File * Stata 13.0; * * Transforms the EU-SILC CSV-data (as released by Eurostat) into a Stata-Systemfile * * EU-SILC - Cross 2012 * Household register file: * UDB_c12D_ver 2012-4 from 01-01-16.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-2012 DIFFERENCES BETWEEN DATA COLLECTED AND UDB .doc * * (c) GESIS 2016-02-16 * GESIS - Leibniz Institute for the Social Sciences * German Microdata Lab * Heike Wirth; Anika Herter * http://www.gesis.org/en/institute/ * * Contact: heike.wirth@gesis.org /* Initialization commands */ clear capture log close set more off version 13.0 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 and * name of the CSV data file. Change CSV_FILENAME to your filename ; local csv_file "CSV_FILENAME" ; * The following command should contain the complete path and * name of the STATA file, usual file extension "dta". Change STATA_FILENAME to your filename ; local stata_file "STATA_FILENAME" ; * CONFIGURATION SECTION - End ; * There should be probably nothing to change below this line ; * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; log using "`log_file'", replace text ; insheet using "`csv_file'", comma names case ; * 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 DB010 "Year of the Survey" ; label variable DB020 "Country alphanumeric" ; label variable DB030 "Household ID" ; label variable DB040 "Region (NUTS 1 or 2; CZ,ES,FI,FR: NUTS2; UK: NUTS1)" ; label variable DB040_F "Flag" ; label variable DB060 "PSU-1 (First stage)" ; label variable DB060_F "Flag" ; label variable DB062 "PSU-2 (Second stage)" ; label variable DB062_F "Flag" ; label variable DB070 "Order of selection of PSU" ; label variable DB070_F "Flag" ; label variable DB075 "Rotational Group(UK: Nuts 1)" ; label variable DB075_F "Flag" ; label variable DB090 "Household cross-sectional weight" ; label variable DB090_F "Flag" ; label variable DB100 "Degree of urbanisation (EE, LV: lbl 1,2 = 1; MT: lbl 2,3 = 2) " ; label variable DB100_F "Flag" ; * Definition of category labels ; * DB030 ID number see construction doc "UDB description" point 8.6.6 ; label define DB040_F_VALUE_LABELS -1 "missing" 1 "filled according to NUTS-03" 2 "filled according to NUTS-08" ; label define DB060_F_VALUE_LABELS 1 "filled" -2 "not applicable" ; label define DB062_F_VALUE_LABELS 1 "filled" -2 "not applicable" ; label define DB070_F_VALUE_LABELS 1 "filled" -2 "not applicable" ; label define DB075_F_VALUE_LABELS 1 "filled" -2 "na (no rotational design is used)" ; label define DB090_F_VALUE_LABELS 1 "filled" ; label define DB100_VALUE_LABELS 1 "densely populated area" 2 "intermediate area" 3 "thinly populated area" ; label define DB100_F_VALUE_LABELS 1 "filled" -1 "missing" ; * Attachement of category labels to variable ; label values DB040_F DB040_F_VALUE_LABELS ; label values DB060_F DB060_F_VALUE_LABELS ; label values DB062_F DB062_F_VALUE_LABELS ; label values DB070_F DB070_F_VALUE_LABELS ; label values DB075_F DB075_F_VALUE_LABELS ; label values DB090_F DB090_F_VALUE_LABELS ; label values DB100 DB100_VALUE_LABELS ; label values DB100_F DB100_F_VALUE_LABELS ; compress ; save "`stata_file'", replace ; log close ; set more on #delimit cr