*------------------------------------------------------------------------------------------------------------------------------. * EU-Labour Force Survey - Data Service - German Microdata Lab * This routine recodes missings and alphanumeric variables of the EU LFS 2004 AD HOC data to numeric variables. * Checked for the November 2013 release of the EU-LFS, as provided by Eurostat. * Version 1 of the routine, January 2015 * Stata/MP 13.0 * (c) GESIS - Leibniz Institute for the Social Sciences * German Microdata Lab * Andrea Lengerer, Bianca Dungl * http://www.gesis.org/en/institute/ * Contact: gml@gesis.org * This Stata code is protected under the creative commons licence. *------------------------------------------- Initialization commands ----------------------------------------------------. #delimit ; *--- Add Release-Variable --- ; gen release = "NOV 2013" ; *--- Recode Alphanumeric Variables --- ; * Variables which remain alphanumeric: hhnum and qhhnum (too many values), quarter (only one value) ; * recodification of region ; * Values of region have country-specific meaning (according to the NUTS classification) ; egen region_ = concat(country region) if region!="00" ; drop region ; rename region_ region ; gen region_ = .e ; foreach x in "AT10 0110" "AT20 0120" "AT30 0130" "BE10 0210" "BE21 0221" "BE22 0222" "BE23 0223" "BE24 0224" "BE25 0225" "BE31 0231" "BE32 0232" "BE33 0233" "BE34 0234" "BE35 0235" "BG01 0301" "BG02 0302" "BG03 0303" "BG04 0304" "BG05 0305" "BG06 0306" "BG11 0311" "BG12 0312" "BG13 0313" "BG21 0321" "BG22 0322" "BG23 0323" "BG31 0331" "BG32 0332" "BG33 0333" "BG34 0334" "BG41 0341" "BG42 0342" "CH01 0401" "CH02 0402" "CH03 0403" "CH04 0404" "CH05 0405" "CH06 0406" "CH07 0407" "CZ01 0601" "CZ02 0602" "CZ03 0603" "CZ04 0604" "CZ05 0605" "CZ06 0606" "CZ07 0607" "CZ08 0608" "DE10 0701" "DE20 0702" "DE30 0703" "DE40 0704" "DE50 0705" "DE60 0706" "DE70 0707" "DE80 0708" "DE90 0709" "DEA0 0710" "DEB0 0711" "DEC0 0712" "DED0 0713" "DEE0 0714" "DEF0 0715" "DEG0 0716" "DK01 0801" "DK02 0802" "DK03 0803" "DK04 0804" "DK05 0805" "ES11 1011" "ES12 1012" "ES13 1013" "ES21 1021" "ES22 1022" "ES23 1023" "ES24 1024" "ES30 1030" "ES41 1041" "ES42 1042" "ES43 1043" "ES51 1051" "ES52 1052" "ES53 1053" "ES61 1061" "ES62 1062" "ES63 1063" "ES64 1064" "ES70 1070" "FI13 1113" "FI18 1118" "FI19 1119" "FI20 1120" "FI1A 1132" "FI1B 1132" "FI1C 1133" "FI1D 1134" "FR10 1210" "FR21 1221" "FR22 1222" "FR23 1223" "FR24 1224" "FR25 1225" "FR26 1226" "FR30 1230" "FR41 1241" "FR42 1242" "FR43 1243" "FR51 1251" "FR52 1252" "FR53 1253" "FR61 1261" "FR62 1262" "FR63 1263" "FR71 1271" "FR72 1272" "FR81 1281" "FR82 1282" "FR83 1283" "FR91 1291" "FR92 1292" "FR93 1293" "FR94 1294" "GR11 1311" "GR12 1312" "GR13 1313" "GR14 1314" "GR21 1321" "GR22 1322" "GR23 1323" "GR24 1324" "GR25 1325" "GR30 1330" "GR41 1341" "GR42 1342" "GR43 1343" "HR01 1401" "HR02 1402" "HR03 1403" "HR04 1404" "HU10 1510" "HU21 1521" "HU22 1522" "HU23 1523" "HU31 1531" "HU32 1532" "HU33 1533" "IE01 1601" "IE02 1602" "ITC1 1831" "ITC2 1832" "ITC3 1833" "ITC4 1834" "ITD1 1841" "ITD2 1842" "ITD3 1843" "ITD4 1844" "ITD5 1845" "ITE1 1851" "ITE2 1852" "ITE3 1853" "ITE4 1854" "ITF1 1861" "ITF2 1862" "ITF3 1863" "ITF4 1864" "ITF5 1865" "ITF6 1866" "ITG1 1871" "ITG2 1872" "ITH1 1881" "ITH2 1882" "ITH3 1883" "ITH4 1884" "ITH5 1885" "ITI1 1891" "ITI2 1892" "ITI3 1893" "ITI4 1894" "NO01 2401" "NO02 2402" "NO03 2403" "NO04 2404" "NO05 2405" "NO06 2406" "NO07 2407" "PL11 2511" "PL12 2512" "PL21 2521" "PL22 2522" "PL31 2531" "PL32 2532" "PL33 2533" "PL34 2534" "PL41 2541" "PL42 2542" "PL43 2543" "PL51 2551" "PL52 2552" "PL61 2561" "PL62 2562" "PL63 2563" "PT11 2611" "PT15 2615" "PT16 2616" "PT17 2617" "PT18 2618" "PT20 2620" "PT30 2630" "RO01 2701" "RO02 2702" "RO03 2703" "RO04 2704" "RO05 2705" "RO06 2706" "RO07 2707" "RO08 2708" "RO11 2711" "RO12 2712" "RO21 2721" "RO22 2722" "RO31 2731" "RO32 2732" "RO41 2741" "RO42 2742" "SE01 2801" "SE02 2802" "SE04 2804" "SE06 2806" "SE07 2807" "SE08 2808" "SE09 2809" "SE0A 2810" "SE11 2811" "SE12 2812" "SE21 2821" "SE22 2822" "SE23 2823" "SE31 2831" "SE32 2832" "SE33 2833" "SI01 2901" "SI02 2902" "SK01 3001" "SK02 3002" "SK03 3003" "SK04 3004" "UKC0 3103" "UKD0 3104" "UKE0 3105" "UKF0 3106" "UKG0 3107" "UKH0 3108" "UKI0 3109" "UKJ0 3110" "UKK0 3111" "UKL0 3112" "UKM0 3113" "UKN0 3114" { ; local name=substr("`x'",1,4) ; local code=substr("`x'",6,.) ; replace region_=`code' if region=="`name'" ; } ; drop region ; rename region_ region ; * Values of regionw and region1y have country-specific meaning (according to the NUTS classification) ; * recodification of regionw and region1y ; replace countryw = "999" if countryw == "" ; replace regionw = "999" if regionw == "" ; replace countr1y = "999" if countr1y == "" ; replace region1y = "999" if region1y == "" ; egen regionw_ = concat(countryw regionw) if regionw!="00" ; egen region1y_ = concat(countr1y region1y) if region1y!="00" ; gen regionwx = .e ; gen region1yx = .e ; * separate coding of regionw for Slovenia (due to the separate coding of countryw in Slovenia) ; foreach x in "4501 000-OWN COUNTRY01" "4502 000-OWN COUNTRY02" " .a NO ANSWER" { ; local name=substr("`x'",6,.) ; local code=substr("`x'",1,4) ; if country == "SI" replace regionwx=.a if regionw=="999" ; if country == "SI" replace regionwx=.a if countryw=="999" ; if country == "SI" replace regionwx=.b if regionw=="99" ; if country == "SI" replace regionwx=.b if countryw=="99" ; if country == "SI" replace regionwx=`code' if regionw_=="`name'" ; } ; foreach x in "AT11 0311" "AT12 0312" "AT13 0313" "AT21 0321" "AT22 0322" "AT31 0331" "AT32 0332" "AT33 0333" "AT34 0334" "BE10 0510" "BE21 0521" "BE22 0522" "BE23 0523" "BE24 0524" "BE25 0525" "BE31 0531" "BE32 0532" "BE33 0533" "BE34 0534" "BE35 0535" "BG01 0601" "BG02 0602" "BG03 0603" "BG04 0604" "BG05 0605" "BG06 0606" "BG11 0611" "BG12 0612" "BG13 0613" "BG21 0621" "BG22 0622" "BG23 0623" "BG31 0631" "BG32 0632" "BG33 0633" "BG34 0634" "BG41 0641" "BG42 0642" "CH01 0801" "CH02 0802" "CH03 0803" "CH04 0804" "CH05 0805" "CH06 0806" "CH07 0807" "CZ01 1001" "CZ02 1002" "CZ03 1003" "CZ04 1004" "CZ05 1005" "CZ06 1006" "CZ07 1007" "CZ08 1008" "DE11 1111" "DE12 1112" "DE13 1113" "DE14 1114" "DE21 1121" "DE22 1122" "DE23 1123" "DE24 1124" "DE25 1125" "DE26 1126" "DE27 1127" "DE30 1130" "DE40 1140" "DE41 1141" "DE42 1142" "DE50 1150" "DE60 1160" "DE71 1171" "DE72 1172" "DE73 1173" "DE80 1180" "DE91 1191" "DE92 1192" "DE93 1193" "DE94 1194" "DEA1 11011" "DEA2 11012" "DEA3 11013" "DEA4 11014" "DEA5 11015" "DEB0 11020" "DEB1 11021" "DEB2 11022" "DEB3 11023" "DEC0 11030" "DED1 11041" "DED2 11042" "DED3 11043" "DED4 11044" "DED5 11045" "DEE0 11050" "DEE1 11051" "DEE2 11052" "DEE3 11053" "DEF0 11060" "DEG0 11070" "DK01 1201" "DK02 1202" "DK03 1203" "DK04 1204" "DK05 1205" "GR11 1411" "GR12 1412" "GR13 1413" "GR14 1414" "GR21 1421" "GR22 1422" "GR23 1423" "GR24 1424" "GR25 1425" "GR30 1430" "GR41 1441" "GR42 1442" "GR43 1443" "ES11 1511" "ES12 1512" "ES13 1513" "ES21 1521" "ES22 1522" "ES23 1523" "ES24 1524" "ES30 1530" "ES41 1541" "ES42 1542" "ES43 1543" "ES51 1551" "ES52 1552" "ES53 1553" "ES61 1561" "ES62 1562" "ES63 1563" "ES64 1564" "ES70 1570" "FI13 1613" "FI16 1616" "FI18 1618" "FI19 1619" "FI20 1620" "FI1A 1631" "FI1B 1632" "FI1C 1633" "FI1D 1634" "FR10 1810" "FR21 1821" "FR22 1822" "FR23 1823" "FR24 1824" "FR25 1825" "FR26 1826" "FR30 1830" "FR41 1841" "FR42 1842" "FR43 1843" "FR51 1851" "FR52 1852" "FR53 1853" "FR61 1861" "FR62 1862" "FR63 1863" "FR71 1871" "FR72 1872" "FR81 1881" "FR82 1882" "FR83 1883" "FR91 1891" "FR92 1892" "FR93 1893" "FR94 1894" "HR01 2101" "HR02 2102" "HR03 2103" "HR04 2104" "HU10 2210" "HU21 2221" "HU22 2222" "HU23 2223" "HU31 2231" "HU32 2232" "HU33 2233" "IE01 2301" "IE02 2302" "ITC1 2631" "ITC2 2632" "ITC3 2633" "ITC4 2634" "ITD1 2641" "ITD2 2642" "ITD3 2643" "ITD4 2644" "ITD5 2645" "ITE1 2651" "ITE2 2652" "ITE3 2653" "ITE4 2654" "ITF1 2661" "ITF2 2662" "ITF3 2663" "ITF4 2664" "ITF5 2665" "ITF6 2666" "ITG1 2671" "ITG2 2672" "ITH1 2681" "ITH2 2682" "ITH3 2683" "ITH4 2684" "ITH5 2685" "ITI1 2691" "ITI2 2692" "ITI3 2693" "ITI4 2694" "IT11 26011" "IT20 26020" "IT31 26031" "IT32 26032" "IT51 26051" "IT52 26052" "IT60 26060" "IT80 26080" "IT93 26093" "NL11 3711" "NL12 3712" "NL13 3713" "NL21 3721" "NL22 3722" "NL23 3723" "NL31 3731" "NL32 3732" "NL33 3733" "NL34 3734" "NL41 3741" "NL42 3742" "NO01 3801" "NO02 3802" "NO03 3803" "NO04 3804" "NO05 3805" "NO06 3806" "NO07 3807" "PL11 3911" "PL12 3912" "PL21 3921" "PL22 3922" "PL31 3931" "PL32 3932" "PL33 3933" "PL34 3934" "PL41 3941" "PL42 3942" "PL43 3943" "PL51 3951" "PL52 3952" "PL61 3961" "PL62 3962" "PL63 3963" "PT11 4011" "PT12 4012" "PT13 4013" "PT14 4014" "PT15 4015" "PT16 4016" "PT17 4017" "PT18 4018" "PT20 4020" "PT30 4030" "RO01 4101" "RO02 4102" "RO03 4103" "RO04 4104" "RO05 4105" "RO06 4106" "RO07 4107" "RO08 4108" "RO11 4111" "RO12 4112" "RO21 4121" "RO22 4122" "RO31 4131" "RO32 4132" "RO41 4141" "RO42 4142" "SE01 4401" "SE02 4402" "SE04 4404" "SE06 4406" "SE07 4407" "SE08 4408" "SE09 4409" "SE0A 4410" "SE11 4411" "SE12 4412" "SE21 4421" "SE22 4422" "SE23 4423" "SE31 4431" "SE32 4432" "SE33 4433" "SI01 4501" "SI02 4502" "SK01 4601" "SK02 4602" "SK03 4603" "SK04 4604" "TR10 4810" "TR21 4821" "TR22 4822" "TR31 4831" "TR32 4832" "TR33 4833" "TR41 4841" "TR42 4842" "TR51 4851" "TR52 4852" "TR61 4861" "TR62 4862" "TR63 4863" "TR71 4871" "TR72 4872" "TR81 4881" "TR82 4882" "TR83 4883" "TR90 4890" "TRA1 48011" "TRA2 48012" "TRB1 48021" "TRB2 48022" "TRC1 48031" "TRC2 48032" "TRC3 48033" "UKC0 5030" "UKC1 5031" "UKC2 5032" "UKD0 5040" "UKD1 5041" "UKD2 5042" "UKD3 5043" "UKD4 5044" "UKD5 5045" "UKE0 5050" "UKE1 5051" "UKE2 5052" "UKE3 5053" "UKE4 5054" "UKF0 5060" "UKF1 5061" "UKF2 5062" "UKF3 5063" "UKG0 5070" "UKG1 5071" "UKG2 5072" "UKG3 5073" "UKH0 5080" "UKH1 5081" "UKH2 5082" "UKH3 5083" "UKI0 5090" "UKI1 5091" "UKI2 5092" "UKJ0 50100" "UKJ1 50101" "UKJ2 50102" "UKJ3 50103" "UKJ4 50104" "UKK0 50110" "UKK1 50111" "UKK2 50112" "UKK3 50113" "UKK4 50114" "UKL0 50120" "UKL1 50121" "UKL2 50122" "UKM0 50130" "UKM1 50131" "UKM2 50132" "UKM3 50133" "UKM4 50134" "UKM5 50135" "UKM6 50136" "UKN0 50140" { ; local name=substr("`x'",1,4) ; local code=substr("`x'",6,.) ; replace region1yx=.a if region1y=="999" ; replace region1yx=.a if countr1y=="999" ; replace region1yx=.b if region1y=="99" ; replace region1yx=.b if countr1y=="99" ; replace region1yx=`code' if region1y_=="`name'" ; foreach cou in "AT" "BE" "BG" "CH" "CY" "CZ" "DE" "DK" "EE" "ES" "FI" "FR" "GR" "HR" "HU" "IE" "IS" "IT" "LT" "LU" "LV" "MT" "NL" "NO" "PL" "PT" "RO" "SE" "SK" "UK" { ; if country == "`cou'" replace regionwx=.a if regionw=="999" ; if country == "`cou'" replace regionwx=.a if countryw=="999" ; if country == "`cou'" replace regionwx=.b if regionw=="99" ; if country == "`cou'" replace regionwx=.b if countryw=="99" ; if country == "`cou'" replace regionwx=`code' if regionw_=="`name'" ; } ; } ; drop regionw regionw_ region1y region1y_; rename regionwx regionw ; rename region1yx region1y ; *recodification of country ; gen country_ = . ; foreach x in "AT 1" "BE 2" "BG 3" "CH 4" "CY 5" "CZ 6" "DE 7" "DK 8" "EE 9" "ES 10" "FI 11" "FR 12" "GR 13" "HR 14" "HU 15" "IE 16" "IS 17" "IT 18" "LT 19" "LU 20" "LV 21" "MT 22" "NL 23" "NO 24" "PL 25" "PT 26" "RO 27" "SE 28" "SI 29" "SK 30" "UK 31" { ; local name=substr("`x'",1,2) ; local code=substr("`x'",4,.) ; replace country_=`code' if country=="`name'" ; } ; drop country ; rename country_ country ; *recodification of national, countryb (and countryw only for Malta and Slovenia due to seperate coding) ; gen national_ = .a ; gen countryb_ = .a ; gen countryw_ = .a ; foreach x in " 0 000-OWN COUNTRY" " 1 001-EU15" " 2 002-NMS10" " 3 003-NMS3" " 4 004-NMS13" " 5 005-EU27" " 5 005-EU28" " 6 006-EFTA" " 7 007-OTHER EUROPE" " 8 008-EUROPE OUTSIDE EU27" " 8 008-EUROPE OUTSIDE EU28" " 9 009-NORTH AFRICA" " 10 010-OTHER AFRICA" " 11 011-NEAR MIDDLE EAST" " 12 012-EAST ASIA" " 13 013-SOUTH S-EAST ASIA" " 14 014-NORTH AFRICA AND NEAR" " 15 015-EAST AND SOUTH ASIA" " 16 016-NORTH AMERICA" " 17 017-CENTRAL AMERICA" " 18 018-SOUTH AMERICA" " 19 019-AUSTRALIA OCEANIA" " 20 020-LATIN AMERICA" " 21 021-NORTH AMERICA AND AUS" " 0 000" "111 111" "800 800" "911 911" "999 999" " .a NO ANSWER" { ; local name=substr("`x'",5,.) ; local code=substr("`x'",1,3) ; replace national_=`code' if national=="`name'" ; replace countryb_=`code' if countryb=="`name'" ; foreach cou in 22 29 { ; if country == `cou' replace countryw_=`code' if countryw=="`name'" ; } ; } ; if country==29 recode countryw_ (0=45) (5=180) (8=190) (111=160) (911=170) (999=.b) ; foreach cou in 22 29 { ; if country == `cou' drop countryw ; if country == `cou' rename countryw_ countryw ; } ; drop national countryb ; rename national_ national ; rename countryb_ countryb ; *recodification of na111y1d, na111d, na112j1d and na11pr1d ; gen na111y1d_= .a ; gen na111d_= .a ; gen na112j1d_= .a ; gen na11pr1d_= .a ; foreach x in "A 1" "B 2" "C 3" "D 4" "E 5" "F 6" "G 7" "H 8" "I 9" "J 10" "K 11" "L 12" "M 13" "N 14" "O 15" "P 16" "Q 17" "9 .b" { ; local name=substr("`x'",1,1) ; local code=substr("`x'",3,.) ; replace na111y1d_=`code' if na111y1d=="`name'" ; replace na111d_=`code' if na111d=="`name'" ; replace na112j1d_=`code' if na112j1d=="`name'" ; replace na11pr1d_=`code' if na11pr1d=="`name'" ; } ; drop na111y1d na111d na112j1d na11pr1d ; rename na111y1d_ na111y1d ; rename na111d_ na111d ; rename na112j1d_ na112j1d ; rename na11pr1d_ na11pr1d ; *recodification of hatlev1d ; gen hatlev1d_ = .a ; foreach x in "L 1" "M 2" "H 3" "9 .b" "8 8" { ; local name=substr("`x'",1,1) ; local code=substr("`x'",3,.) ; replace hatlev1d_=`code' if hatlev1d=="`name'" ; } ; drop hatlev1d ; rename hatlev1d_ hatlev1d ; *recodification of countr1y and countryw (countryw already recoded for Malta and Slovenia) ; gen countr1y_ = .a ; foreach x in "AD 01" "AL 02" "AT 03" "BA 04" "BE 05" "BG 06" "BY 07" "CH 08" "CY 09" "CZ 10" "DE 11" "DK 12" "EE 13" "GR 14" "ES 15" "FI 16" "FO 17" "FR 18" "GG 19" "GI 20" "HR 21" "HU 22" "IE 23" "IM 24" "IS 25" "IT 26" "JE 27" "LI 28" "LT 29" "LU 30" "LV 31" "MC 32" "MD 33" "ME 34" "XM 34" "MK 35" "MT 36" "NL 37" "NO 38" "PL 39" "PT 40" "RO 41" "RS 42" "XS 42" "RU 43" "SE 44" "SI 45" "SK 46" "SM 47" "TR 48" "UA 49" "UK 50" "VA 51" "XK 52" "CS 60" "SU 61" "YU 62" "NN 90" "01 110" "02 120" "03 130" "04 140" "15 150" "05 0500" "DZ 0501" "EG 0502" "LY 0503" "MA 0504" "TN 0505" "06 0600" "AO 0601" "BF 0602" "BI 0603" "BJ 0604" "BW 0605" "CD 0606" "CF 0607" "CG 0608" "CI 0609" "CM 0610" "CV 0611" "DJ 0612" "ER 0613" "ET 0614" "GA 0615" "GH 0616" "GM 0617" "GN 0618" "GQ 0619" "GW 0620" "KE 0621" "KM 0622" "LR 0623" "LS 0624" "MG 0625" "ML 0626" "MR 0627" "MU 0628" "MW 0629" "MZ 0630" "NA 0631" "NE 0632" "NG 0633" "RW 0634" "SC 0635" "SD 0636" "SH 0637" "SL 0638" "SN 0639" "SO 0640" "SS 0641" "ST 0642" "SZ 0643" "TD 0644" "TG 0645" "TZ 0646" "UG 0647" "YT 0648" "ZA 0649" "ZM 0650" "ZW 0651" "07 0700" "BM 0701" "CA 0702" "GL 0703" "PM 0704" "US 0705" "08 0800" "AG 0801" "AI 0802" "AN 0803" "AW 0804" "BB 0805" "BL 0806" "BS 0807" "BZ 0808" "CR 0809" "CU 0810" "DM 0811" "DO 0812" "GD 0813" "GT 0814" "HN 0815" "HT 0816" "JM 0817" "KN 0818" "KY 0819" "LC 0820" "MF 0821" "MS 0822" "MX 0823" "NI 0824" "PA 0825" "PR 0826" "SV 0827" "TC 0828" "TT 0829" "VC 0830" "VG 0831" "09 0900" "AR 0901" "BO 0902" "BR 0903" "CL 0904" "CO 0905" "EC 0906" "FK 0907" "GY 0908" "PE 0909" "PY 0910" "SR 0911" "TF 0912" "UY 0913" "VE 0914" "10 1000" "CN 1001" "JP 1002" "KP 1003" "KR 1004" "MN 1005" "TW 1006" "11 1100" "AE 1101" "AM 1102" "AZ 1103" "BH 1104" "GE 1105" "IL 1106" "IQ 1107" "IR 1108" "JO 1109" "KG 1110" "KW 1111" "KZ 1112" "LB 1113" "OM 1114" "PS 1115" "QA 1116" "SA 1117" "SY 1118" "TJ 1119" "TM 1120" "UZ 1121" "YE 1122" "12 1200" "AF 1201" "BD 1202" "BN 1203" "BT 1204" "ID 1205" "IN 1206" "KH 1207" "LA 1208" "LK 1209" "MM 1210" "MV 1211" "MY 1212" "NP 1213" "PH 1214" "PK 1215" "SG 1216" "TH 1217" "TL 1218" "VN 1219" "13 1300" "AU 1301" "FJ 1302" "FM 1303" "KI 1304" "MH 1305" "NC 1306" "NR 1307" "NZ 1308" "PF 1309" "PG 1310" "PN 1311" "PW 1312" "SB 1313" "TO 1314" "TV 1315" "VU 1316" "WF 1317" "WS 1318" "14 1400" { ; local name=substr("`x'",1,2) ; local code=substr("`x'",4,.) ; replace countr1y_=`code' if countr1y=="`name'" ; replace countr1y_=.a if countr1y=="999" ; replace countr1y_=.b if countr1y=="99" ; foreach cou in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24 25 26 27 28 30 31 { ; if country == `cou' replace countryw_=`code' if countryw=="`name'" ; if country == `cou' replace countryw_=.a if countryw=="999" ; if country == `cou' replace countryw_=.b if countryw=="99" ; } ; } ; foreach cou in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24 25 26 27 28 30 31 { ; if country == `cou' drop countryw ; if country == `cou' rename countryw_ countryw ; } ; drop countr1y ; rename countr1y_ countr1y ; *recodification of yearesid ; gen yearesid_ = .a ; foreach x in " 0 00" " 1 01" " 2 02" " 3 03" " 4 04" " 5 05" " 6 06" " 7 07" " 8 08" " 9 09" "10 10" " 2 01-04" " 6 05-10" "11 11" "12 11-14" "17 15-19" "22 20-24" "27 25-29" "32 30-34" "37 35-39" "42 40-44" "47 45-49" "52 50-54" "57 55-59" "62 60-64" "67 65-69" "72 70-74" "77 75-79" "82 80-84" "87 85-89" "92 90-94" "97 95-99" "52 50-99" { ; local name=substr("`x'",4,.) ; local code=substr("`x'",1,2) ; replace yearesid_=`code' if yearesid=="`name'" ; } ; drop yearesid ; rename yearesid_ yearesid ; *--- Recode Missing Values --- ; recode marstat (.=.a) ; recode leavclas (.=.i) ; recode hhinst proxy stapro supvisor wayjfoun ftpt ftptreas temp tempreas tempdur tempagcy shiftwk evenwk nightwk satwk sunwk wishmore waymore homewk lookoj lookreas exist2j stapro2j existpr stapropr seekreas seektype seekdur wantwork availble avaireas preseek needcare register mainstat educstat educlevl couratt courpurp courworh wstat1y stapro1y na11s na112js na11prs durune educ4wn na111ys lentr4w purp4w ahm2004_ownmtsch ahm2004_singcust ahm2004_shiftpat ahm2004_varwkhrs ahm2004_annwkhrs ahm2004_oncallwk ahm2004_wktpptft ahm2004_varhrsrw ahm2004_wkt1pers ahm2004_wkt2pers (.=.a) (9=.b) ; recode sizefirm mstartwk hwusual hwactual hwoverp hwoverpu hourreas hwwish hwactua2 monthpr leavreas hatlevel methfw countr1y hwustrai ahm2004_overthor ahm2004_povertor (.=.a) (99=.b) ; recode iscopr3d educfild courlen courfild hatfield isco1d iscopr1d isco3d startime leavtime is881d is88pr1d is883d is88pr3d (.=.a) (999=.b) ; recode ystartwk yearpr hatyear (.=.a) (9999=.b) ; recode wstator signisal seekwork methoda methodb methodc methodd methode methodf methodg methodh methodi methodj methodk methodl methodm ilostat hhlink (9=.b); recode nowkreas hhspou hhfath hhmoth (99=.b) ; *--- Recode Variables in Countries which did not deliver any information for this Variable --- ; recode signisal (4=.), gen(signisal_) ; recode educfild (9=.e), gen(educfild_) ; recode courfild (9=.e), gen(courfild_) ; foreach x in hhseqnum refyear refweek intweek region degurba hhtype hhinst intwave intquest rem hhpriv hhlink hhspou hhfath hhmoth sex age marstat national yearesid countryb proxy wstator nowkreas stapro supvisor sizefirm countryw regionw ystartwk mstartwk wayjfoun ftpt ftptreas temp tempreas tempdur tempagcy shiftwk evenwk nightwk satwk sunwk hwusual hwactual hwoverp hwoverpu hourreas wishmore waymore hwwish homewk lookoj lookreas exist2j stapro2j hwactua2 existpr yearpr monthpr leavreas stapropr iscopr3d seekwork seekreas seektype seekdur methoda methodb methodc methodd methode methodf methodg methodh methodi methodj methodk methodl methodm wantwork availble avaireas preseek needcare register mainstat educstat educlevl educfild_ couratt courlen courpurp courfild_ courworh hatlevel hatfield hatyear wstat1y stapro1y na111y1d countr1y region1y ilostat na111d na11s isco1d na112j1d na112js na11pr1d na11prs iscopr1d durune educ4wn hatlev1d na111ys methfw lentr4w purp4w hwustrai isco3d startime leavtime leavclas is881d is88pr3d is88pr1d is883d signisal_ ahm2004_ownmtsch ahm2004_singcust ahm2004_overthor ahm2004_povertor ahm2004_shiftpat ahm2004_varwkhrs ahm2004_annwkhrs ahm2004_oncallwk ahm2004_wktpptft ahm2004_varhrsrw ahm2004_wkt1pers ahm2004_wkt2pers { ; tab `x', nofreq ; if r(r)==0 recode `x' (missing=.c) ; } ; recode signisal_ (.=4) ; recode educfild_ (.=9) ; recode courfild_ (.=9) ; drop signisal educfild courfild ; rename signisal_ signisal ; rename educfild_ educfild ; rename courfild_ courfild ; *--- Recode or Rename Variabels in Specific Cases --- ; * in Slovenia children were not asked for marstat ; if country == 29 recode marstat (.a=.b) if age <= 12 ; * in certain cases, members of the armed forces had been coded wrong in the 3-digit ISCO (until 2010). recode is883d is88pr3d (11=10) ; * end ;