***************************** *Preamble ***************************** set more off clear cd "E:\Wave_1" //Define the working directory /*Define the data source directory, where there should contain file PPFAD BIOPAREN BIOBIRTH BIOBRTHM BIOJOB BAPEQUIV PHRF HHRF BAPGEN BAP BAH BAHGEN BAHBRUTTO*/ global datadir "E:\Original Data\Germany\stata_de%2Ben_v30i" ******************************************** * * * KEEP USEFUL VARIABLES INTO File_Ger DATA * * * ******************************************** use "$datadir\ppfad", clear keep hhnr persnr sex gebjahr gebmonat corigin immiyear psample save File_Ger.dta, replace use "$datadir\bioparen", clear keep persnr hhnr vgebj mgebj vtodj mtodj vbbil mbbil vsbil msbil visco88 misco88 vegp megp vnr mnr /// morigin vorigin nums numb geschw malter valter visco88 misco88 qui merge 1:1 persnr using File_Ger drop _merge save File_Ger.dta, replace use "$datadir\biobirth", clear keep hhnr persnr kidgeb* kidmon* kidpnr* sumkids qui merge 1:1 persnr using File_Ger drop _merge save File_Ger.dta, replace use "$datadir\biobrthm", clear keep hhnr persnr kidgeb* kidmon* kidpnr* sumkids qui merge 1:1 persnr using File_Ger drop _merge save File_Ger.dta, replace use "$datadir\biojob", clear keep hhnr persnr isco88 egp qui merge 1:1 persnr using File_Ger drop _merge save File_Ger.dta, replace use "$datadir\bapequiv", clear keep hhnr hhnrakt persnr e1110110 e1110510 i1111010 ijob110 ijob210 iself10 /// iunby10 iunay10 isuby10 ieret10 imaty10 imaty10 istuy10 imilt10 ialim10 iachm10 /// ismp110 ismp210 iciv110 iciv210 iwar110 iwar210 iagr110 iagr210 iguv110 iguv210 /// ivbl110 ivbl210 iprv110 iprv210 ison110 ison210 i13ly10 i14ly10 ixmas10 iholy10 /// igray10 iothy10 idemy10 itray10 igrv110 igrv210 ivbl110 ivbl210 icom110 icom210 /// i1110110 i1110210 i1110310 i1110410 i1110610 i1110710 i1110810 i1111710 i1111810 /// chspt10 house10 nursh10 subst10 sphlp10 ssold10 adchb10 alg210 hsup10 l1110110 l1110210 d1110410 qui merge 1:1 persnr using File_Ger drop _merge save File_Ger.dta, replace use "$datadir\phrf", clear keep hhnr persnr baphrf qui merge 1:1 persnr using File_Ger drop _merge save File_Ger.dta, replace use "$datadir\hhrf", clear keep hhnrakt bahhrf rename hhnrakt bdhhnr qui merge 1:m bdhhnr using "$datadir\ppfad", keepusing(bahhnr persnr) rename bahhnr hhnrakt drop if _merge == 1 drop _merge bdhhnr capture mkdir gcompute save gcompute\bafweight.dta, replace use File_Ger, clear qui merge 1:1 persnr using gcompute\bafweight, keepusing(bahhrf) drop _merge save File_Ger.dta, replace use "$datadir\bapgen", clear keep hhnr hhnrakt persnr partnr10 partz10 babilzeit bapsbil bapsbila bapbbil01 bapbbil02 bapbbila /// betr10 isced10 field10 batatzeit egp10 nace10 expft10 baerwzeit nation10 qui merge 1:1 persnr using File_Ger drop _merge save File_Ger.dta, replace use "$datadir\bap", clear keep hhnr hhnrakt persnr bapjahrin bapmonin bap0103 bap82h01 bap82q01 bap82k01 bap13201 bap13202 /// bap13203 bap97 bap96 bap87 bap9901 bap107 bap9501 bap9401 bap9402 bap9403 bap9404 bap12503 bap160 /// bap151 bap15202 bap131 bap13201 bap09 bap10 bap17 bap134 qui merge 1:1 persnr using File_Ger, drop if _merge == 2 // keep adults surveyed in 2010 drop _merge save File_Ger.dta, replace merge m:1 hhnrakt using "$datadir\bahbrutto", keepusing (baregtyp babula bawum1) drop if _merge == 2 drop _merge ***************************** *Part0. IDs and weights ***************************** label define numeric_l -8 "Not Applicable" -2 "Refuse to Answer" -1 "Don't Know" * Year of survey rename bapjahrin a_syear label variable a_syear "Year of Survey" tab a_syear, mi * Month of survey rename bapmonin a_smonth label variable a_smonth "Month of Survey" label value a_smonth numeric_l tab a_smonth, mi * Individual id gen a_pid = persnr label variable a_pid "Individual id" sum a_pid * Family id gen a_fid=hhnrakt label variable a_fid "Family id" sum a_fid * Cross wave person identifier (for pannel data) gen a_pidp = a_pid //same as a_pid label variable a_pidp "Cross wave person identifier (for pannel data)" sum a_pidp * Individual sample weight rename baphrf a_pweight label variable a_pweight "Individual sample weight" sum a_pweight * Family sample weight rename bahhrf a_fweight label variable a_fweight "Family sample weight" sum a_fweight ***************************** * Basic Demographic ***************************** * R's year of birth *gebjahr from ppfad gen a_birthy = gebjahr label variable a_birthy "R's year of birth" tab a_birthy * R's month of birth gen a_birthm = gebmonat replace a_birthm = -8 if a_birthm == -1 label value a_birthm numeric_l label variable a_birthm "R's month of birth" tab a_birthm, mi * R's age gen a_age = a_syear - a_birthy if a_birthy > 0 qui replace a_age = a_birthy if a_birthy < 0 // replace the missing values according to a_birthy label value a_age numeric_l label variable a_age "R's age" sum a_age * R's gender gen a_gender = sex label define a_gender_l -8 "Not Applicable" -2 "Refuse to Answer" -1 "Don't Know" 1 "Male" 2 "Female" label values a_gender a_gender_l label variable a_gender "R's Gender" tab a_gender, mi * R's ethnicity gen a_ethnic = bap134 //from bap replace a_ethnic = -8 if bap134 == -1 label define a_ethnic 1 "Majority: German" 2 "Minority" -8 "Not Applicable" // German born; Non-German born label values a_ethnic a_ethnic label variable a_ethnic "R's ethnicity" tab a_ethnic, mi rename a_ethnic a_ethnicb * R's place of residence is urban or rural clonevar a_urban=baregtyp //from bahbrutto label variable a_urban "R's place of residence is urban or rural" label define a_urban_l 1"Urban" 2"Rural" label values a_urban a_urban_l tab a_urban, mi * Number of siblings of R gen a_sib = nums + numb if nums >= 0 & numb > =0 & !mi(nums) & !mi(numb) replace a_sib = nums if mi(a_sib) & numb <= 0 replace a_sib = numb if mi(a_sib) & nums <= 0 replace a_sib = -8 if mi(a_sib) & geschw <0 replace a_sib = 0 if geschw == 2 recode a_sib (-2 = -8) (-1 =-2) label value a_sib numeric_l label var a_sib "Number of Siblings of R" tab a_sib,mi save File_Ger, replace * Year of birth of R's father *vgebj from bioparen gen a_birthy_f = vgebj recode a_birthy_f (-2 -3 -4 -5 -6 -7 -8 = -8) (-1 = -2) label var a_birthy_f "Year of birth of R's father" label value a_birthy_f numeric_l tab a_birthy_f, mi sum a_birthy_f if a_birthy_f >0 * Age of R's father *valter from bioparen: Age Father gen a_age_f = valter recode a_age_f (-1 -2 -3 -4 -5 -6 -7 -8 = -8) label variable a_age_f "Age of R's father" label value a_age_f numeric_l tab a_age_f, mi sum a_age_f if a_age_f >0 * Year of birth of R's mother *mgebj from bioparen gen a_birthy_m = mgebj recode a_birthy_m (-2 -3 -4 -5 -6 -7 -8 = -8) (-1 = -2) label var a_birthy_m "Year of birth of R's mother" label value a_birthy_m numeric_l tab a_birthy_m, mi sum a_birthy_m if a_birthy_m >0 * Age of R's mother *malter from bioparen: Age Mother gen a_age_m = malter recode a_age_m (-1 -2 -3 -4 -5 -6 -7 -8 = -8) label variable a_age_m "Age of R's mother" label value a_age_m numeric_l tab a_age_m, mi sum a_age_m if a_age_m >0 save File_Ger,replace *merge information from biobirth & biobirthm rename *kidgeb0* *kidgeb* rename *kidmon0* *kidmon* * Number of children of R a_child gen a_child = sumkids for num 1/15: replace a_child = a_child - 1 if kidgebX >a_syear label variable a_child "Number of children of R" tab a_child, mi * Year of birth of R's children a_birthy_c1-a_birthy_c10 * Month of birth of R's children a_birthm_c1-a_birthm_c10 recode kidgeb* kidmon* (-3 -2 =-8) (-1=-2) forvalues i=1/15 { gen a_birthy_c`i' = kidgeb`i' gen a_birthm_c`i' = kidmon`i' qui replace a_birthy_c`i' = -8 if a_birthy_c`i' > a_syear | /// ( a_birthy_c`i' == a_syear & a_birthm_c`i' > a_smonth) label value a_birthy_c`i' numeric_l label variable a_birthy_c`i' "Year of birth of R's no.`i' child" qui replace a_birthm_c`i' = -8 if a_birthy_c`i' > a_syear | /// ( a_birthy_c`i' == a_syear & a_birthm_c`i' > a_smonth) label values a_birthm_c`i' numeric_l label variable a_birthm_c`i' "Month of birth of R's no.`i' child" } save File_Ger, replace ***************************** *Part 2. Education ***************************** qui recode babilzeit isced10 field10 (-2 -3 -4 -5 -6 -7 -8 = -8) (-1 = -2) // recode variables for missing values * Years of schooling of R clonevar a_eduy = babilzeit //from bapgen label value a_eduy numeric_l label variable a_eduy "Years of schooling of R" tab a_eduy, mi tab a_eduy if a_eduy >=0 * Highest educational level attained by R gen a_edu = -8 //from bapgen replace a_edu = 1 if isced10 == 1 // 1. Elementary and Below replace a_edu = 2 if isced10 == 2 // 2. Junior High and Vocational School replace a_edu = 3 if isced10 == 3 | isced10 == 4 // 3. Senior High and Vocational School replace a_edu = 4 if isced10 == 5 // 4. Vocational College or Some College replace a_edu = 5 if isced10 == 6 // 5. Bachelor Degree and above replace a_edu = -2 if isced10 == -1 // no answer label define a_edu_l 1 "Elementary and Below" 2 "Junior High and Vocational School" 3 "Senior High and Vocational School" 4 "Vocational College or Some College" 5 "Bachelor Degree and above" -2 "Refuse to Answer" -8 "Not Applicable" -1 "Don't Know" label values a_edu a_edu_l label variable a_edu "Highest Educational level Attained" tab a_edu, mi tab a_edu if a_edu >=0 * Highest educational level attained by R's father a_edu_f *vsbil from bioparen: Level of Education Father gen a_edu_f = vsbil recode a_edu_f (-3 -1 -2=-8) (0=-1) recode a_edu_f (6 7 = 1) (1=2) (2 4 =3) (3=4)(5=5) label value a_edu_f a_edu_l label var a_edu_f "Highest educational level attained by R's father" tab a_edu_f,mi tab a_edu_f if a_edu_f >=0 * Highest educational level attained by R's mother a_edu_m *msbil from bioparen: Level of Education Mother gen a_edu_m = msbil recode a_edu_m (-3 -1 -2=-8) (0=-1) recode a_edu_m (6 7 = 1) (1=2) (2 4 =3) (3=4)(5=5) label value a_edu_m a_edu_l label var a_edu_m "Highest educational level attained by R's mother" tab a_edu_m,mi tab a_edu_m if a_edu_m >=0 ***************************** *Part 3. Individual's Labor Market Outcomes ***************************** * Employment status (employed, self-employed, unemployed, not in labor market (retired, full-time student,looking after family) a_employ *bap09: Employment Status from bap *betr10: Size Of The Company from bapgen *bap10: Gainfully Employed, future from bap *bap17: Actively Sought Work Last 4 Weeks from bap gen a_employ = -8 replace a_employ = 1 if bap09<5 //1. Employed replace a_employ = 1 if betr10==11 //1. Employed replace a_employ = 3 if bap09>4 //3. Not in Labour Market replace a_employ = 2 if bap09>5 & bap10!=1 & bap17==1 //2. Unemployed label define a_employ_l 1 "Employed" /// 2 "Unemployed" /// 3 "Not in Labour Market" /// -8 "Not Applicable" -2 "Refused" -1 "Don't Know" label values a_employ a_employ_l label variable a_employ "Employment Status" tab a_employ, mi * Working hours per week a_workhour_week gen a_workhour_week = batatzeit //from bapgen //rename batatzeit a_workhour_week replace a_workhour_week = -8 if a_workhour_week ==-3 label define a_workhour_l -8 "Not Applicable" /// -2 "Refused" /// -1 "Don't Know" label values a_workhour_week a_workhour_l label variable a_workhour_week "Working Hours per Week" sum a_workhour_week if a_workhour_week>0 tab a_workhour_week if a_workhour_week <= 0 *define isco value label label define a_isco -8 `"Not Applicable"', modify label define a_isco -2 `"Refused"', modify label define a_isco -1 `"Don't Know"', modify label define a_isco 10 `"Armed forces"', modify label define a_isco 11 `"Armed forces"', modify label define a_isco 110 `"Legislators & Senior officials"', modify label define a_isco 111 `"Legislators"', modify label define a_isco 112 `"Senior government officials"', modify label define a_isco 113 `"Traditional chiefs and heads of villages"', modify label define a_isco 114 `"Senior officials of special interest organizations"', modify label define a_isco 120 `"Corporate managers"', modify label define a_isco 121 `"Directors and chief executives"', modify label define a_isco 122 `"Production and operations department managers"', modify label define a_isco 123 `"Other departmental managers"', modify label define a_isco 124 `"Office Manager"', modify label define a_isco 125 `"Military Officers"', modify label define a_isco 130 `"General managers"', modify label define a_isco 131 `"General managers"', modify label define a_isco 210 `"Physical, mathematical and engineering science professionals"', modify label define a_isco 211 `"Physicists, chemists and related professionals"', modify label define a_isco 212 `"Mathematicians, statisticians and related professionals"', modify label define a_isco 213 `"Computing professionals"', modify label define a_isco 214 `"Architects, engineers and related professionals"', modify label define a_isco 220 `"Life science and health professionals"', modify label define a_isco 221 `"Life science professionals"', modify label define a_isco 222 `"Health professionals (except nursing)"', modify label define a_isco 223 `"Nursing and midwifery professionals"', modify label define a_isco 230 `"Teaching professionals"', modify label define a_isco 231 `"College, university and higher education teaching professionals"', modify label define a_isco 232 `"Secondary education teaching professionals"', modify label define a_isco 233 `"Primary and pre-primary education teaching professionals"', modify label define a_isco 234 `"Special education teaching professionals"', modify label define a_isco 235 `"Other teaching professionals"', modify label define a_isco 240 `"Other professionals"', modify label define a_isco 241 `"Business professionals"', modify label define a_isco 242 `"Legal professionals"', modify label define a_isco 243 `"Archivists, librarians and related information professionals"', modify label define a_isco 244 `"Social sciences and related professionals"', modify label define a_isco 245 `"Writers and creative or performing artists"', modify label define a_isco 246 `"Religious professionals"', modify label define a_isco 247 `"Public Service Administrative professionals"', modify label define a_isco 310 `"Physical and engineering science associate professionals"', modify label define a_isco 311 `"Physical and engineering science technicians"', modify label define a_isco 312 `"Computer associate professionals"', modify label define a_isco 313 `"Optical and electronic equipment operators"', modify label define a_isco 314 `"Ship and aircraft controllers and technicians"', modify label define a_isco 315 `"Safety and quality inspectors"', modify label define a_isco 320 `"Life science and health associate professionals"', modify label define a_isco 321 `"Life science technicians and related associate professionals"', modify label define a_isco 322 `"Modern health associate professionals (except nursing)"', modify label define a_isco 323 `"Nursing and midwifery associate professionals"', modify label define a_isco 324 `"Traditional medicine practitioners and faith-healers"', modify label define a_isco 330 `"Teaching associate professionals"', modify label define a_isco 331 `"Primary education teaching associate professionals"', modify label define a_isco 332 `"Pre-primary education teaching associate professionals"', modify label define a_isco 333 `"Special education teaching associate professionals"', modify label define a_isco 334 `"Other teaching associate professionals"', modify label define a_isco 340 `"Other associate professionals"', modify label define a_isco 341 `"Finance and sales associate professionals"', modify label define a_isco 342 `"Business services agents and trade brokers"', modify label define a_isco 343 `"Administrative associate professionals"', modify label define a_isco 344 `"Customs, tax and related government associate professionals"', modify label define a_isco 345 `"Police inspectors and detectives"', modify label define a_isco 346 `"Social work associate professionals"', modify label define a_isco 347 `"Artistic, entertainment and sports associate professionals"', modify label define a_isco 348 `"Religious associate professionals"', modify label define a_isco 400 `"Clerks"', modify label define a_isco 410 `"Office clerks"', modify label define a_isco 411 `"Secretaries and keyboard-operating clerks"', modify label define a_isco 412 `"Numerical clerks"', modify label define a_isco 413 `"Material-recording and transport clerks"', modify label define a_isco 414 `"Library, mail and related clerks"', modify label define a_isco 419 `"Other office clerks"', modify label define a_isco 420 `"Customer service clerks"', modify label define a_isco 421 `"Cashiers, tellers and related clerks"', modify label define a_isco 422 `"Client information clerks"', modify label define a_isco 500 `"Service workers & Shop & Market sales Workers"', modify label define a_isco 510 `"Personal and protective services workers"', modify label define a_isco 511 `"Travel attendants and related workers"', modify label define a_isco 512 `"Housekeeping and restaurant services workers"', modify label define a_isco 513 `"Personal care and related workers"', modify label define a_isco 514 `"Other personal service workers"', modify label define a_isco 515 `"Astrologers, fortune-tellers and related workers"', modify label define a_isco 516 `"Protective services workers"', modify label define a_isco 520 `"Models, salespersons and demonstrators"', modify label define a_isco 521 `"Fashion and other models"', modify label define a_isco 522 `"Shop salespersons and demonstrators"', modify label define a_isco 523 `"Stall and market salespersons"', modify label define a_isco 610 `"Market-oriented skilled agricultural and fishery workers"', modify label define a_isco 611 `"Market gardeners and crop growers"', modify label define a_isco 612 `"Market-oriented animal producers and related workers"', modify label define a_isco 613 `"Market-oriented crop and animal producers"', modify label define a_isco 614 `"Forestry and related workers"', modify label define a_isco 615 `"Fishery workers, hunters and trappers"', modify label define a_isco 620 `"Subsistence agricultural and fishery workers"', modify label define a_isco 621 `"Subsistence agricultural and fishery workers"', modify label define a_isco 700 `"Craft etc trade workers"', modify label define a_isco 710 `"Extraction and building trade workers"', modify label define a_isco 711 `"Miners, shot-firers, stonecutters and carvers"', modify label define a_isco 712 `"Building frame and related trades workers"', modify label define a_isco 713 `"Building finishers and related trades workers"', modify label define a_isco 714 `"Painters, building structure cleaners and related trade workers"', modify label define a_isco 720 `"Metal, machinery and related trades workers"', modify label define a_isco 721 `"Metal moulders, welders, sheet-metalworkers, structural-metal preparers and related trades workers"', modify label define a_isco 722 `"Blacksmiths, toolmakers and related trades workers"', modify label define a_isco 723 `"Machinery mechanics and fitters"', modify label define a_isco 724 `"Electrical and electronic equipment mechanics and fitters"', modify label define a_isco 730 `"Precision, handicraft, printing and related trades workers"', modify label define a_isco 731 `"Precision workers in metal and related materials"', modify label define a_isco 732 `"Potters, glass-makers and related trades workers"', modify label define a_isco 733 `"Handicraft workers in wood, textile, leather and related materials"', modify label define a_isco 734 `"Printing and related trades workers"', modify label define a_isco 740 `"Other craft and related trades workers"', modify label define a_isco 741 `"Food processing and related trades workers"', modify label define a_isco 742 `"Wood treaters, cabinet-makers and related trades workers"', modify label define a_isco 743 `"Textile, garment and related trades workers"', modify label define a_isco 744 `"Felt, leather and shoemaking trades workers"', modify label define a_isco 810 `"Stationary plant and related operators"', modify label define a_isco 811 `"Mining and mineral-processing plant operators"', modify label define a_isco 812 `"Metal-processing plant operators"', modify label define a_isco 813 `"Glass, ceramics and related plant operators"', modify label define a_isco 814 `"Wood processing and papermaking plant operators"', modify label define a_isco 815 `"Chemical processing plant operators"', modify label define a_isco 816 `"Power production and related plant operators"', modify label define a_isco 817 `"Automated assembly-line and industrial robot operators"', modify label define a_isco 820 `"Machine operators and assemblers"', modify label define a_isco 821 `"Metal and mineral products machine operators"', modify label define a_isco 822 `"Chemical products machine operators"', modify label define a_isco 823 `"Rubber and plastic products machine operators"', modify label define a_isco 824 `"Wood products machine operators"', modify label define a_isco 825 `"Printing, binding and paper products machine operators"', modify label define a_isco 826 `"Textile, fur and leather products machine operators"', modify label define a_isco 827 `"Food and related products machine operators"', modify label define a_isco 828 `"Assemblers"', modify label define a_isco 829 `"Other machine operators and assemblers"', modify label define a_isco 830 `"Drivers and mobile plant operators"', modify label define a_isco 831 `"Locomotive engine-drivers and related workers"', modify label define a_isco 832 `"Motor vehicle drivers"', modify label define a_isco 833 `"Agricultural and other mobile plant operators"', modify label define a_isco 834 `"Ships' deck crews and related workers"', modify label define a_isco 900 `"Elementary Occupations"', modify label define a_isco 910 `"Sales and services elementary occupations"', modify label define a_isco 911 `"Street vendors and related workers"', modify label define a_isco 912 `"Shoe cleaning and other street services' elementary occupations"', modify label define a_isco 913 `"Domestic and related helpers, cleaners and launderers"', modify label define a_isco 914 `"Building caretakers, window and related cleaners"', modify label define a_isco 915 `"Messengers, porters, doorkeepers and related workers"', modify label define a_isco 916 `"Garbage collectors and related labourers"', modify label define a_isco 920 `"Agricultural, fishery and related labourers"', modify label define a_isco 921 `"Agricultural, fishery and related labourers"', modify label define a_isco 930 `"Labourers in mining, construction, manufacturing and transport"', modify label define a_isco 931 `"Mining and construction labourers"', modify label define a_isco 932 `"Manufacturing labourers"', modify label define a_isco 933 `"Transport labourers and freight handlers"', modify label define a_isco 991 `"Help In Family Business, Not Agri"', modify label define a_isco 992 `"Apprentice Without Defined Job Role"', modify label define a_isco 993 `"Intern, Trainee Without Defined Job Role"', modify label define a_isco 997 `"Foreman, Team Leader"', modify label define a_isco 998 `"Other Labourer, No Further Details"', modify * Occupation (ISCO88/08 standardization) a_isco clonevar a_isco=e1110510 //bapequiv replace a_isco = -8 if e1110510 == 0 label variable a_isco "Current occupation (ISCO88/08 standardization)" *keep the fist 3 digit replace a_isco = int(a_isco/10) if a_isco > 0 label value a_isco a_isco tab a_isco if a_isco < 0 insp a_isco if a_isco >0 save File_Ger, replace * Occupation (ISCO) of R's father when R was a child(15 years old) a_isco_f *visco88 from bioparen clonevar a_isco_f = visco88 recode a_isco_f (-3 -2 -1 =-8) label value a_isco_f a_isco label variable a_isco_f "Occupation(ISCO) of R's father" *keep the fist 3 digit replace a_isco_f = int(a_isco_f/10) if a_isco_f > 0 tab a_isco_f, mi * Occupation(ISCO) of R's mother when R was a child (15 years old) *misco88 from bioparen clonevar a_isco_m = misco88 recode a_isco_m (-3 -2 -1 =-8) label variable a_isco_m "Occupation(ISCO) of R's mother" *keep the fist 3 digit replace a_isco_m = int(a_isco_m/10) if a_isco_m > 0 label value a_isco_m a_isco tab a_isco_m, mi *make frequency table by 100 label define isco1 -8 "Not Applicable" -2 "Refuse to Answer"-1 "Don't Know" /// 1"Legislators, Senior Officials And Managers" /// 2"Professionals" /// 3"Technicians And Associate Professionals" /// 4"Clerks" /// 5"Service Workers And Shop And Market Sales Workers" /// 6"Skilled Agricultural And Fishery Workers" /// 7"Craft And Related Trades Workers" /// 8"Plant And Machine Operators And Assemblers" /// 9"Elementary Occupations" /// 0"Armed Forces" clonevar a_isco1 = a_isco replace a_isco1 = int(a_isco1/100) if a_isco1 > 0 clonevar a_isco1_f = a_isco_f replace a_isco1_f = int(a_isco1_f/100) if a_isco1_f > 0 clonevar a_isco1_m = a_isco_m replace a_isco1_m = int(a_isco1_m/100) if a_isco1_m > 0 label values a_isco1 isco1 label values a_isco1_f isco1 label values a_isco1_m isco1 * Average monthly wage (main job) gen a_monthinc= ijob110 / 12 replace a_monthinc = -8 if a_monthinc== 0 & (a_employ == 2 |a_employ == 3) label value a_monthinc numeric_l label variable a_monthinc "Average monthly wage" format a_monthinc %9.1f sum a_monthinc * Hourly wage rate (main job) gen a_hourwage = . qui replace a_hourwage = a_monthinc / (a_workhour_week/7*30) if a_workhour_week > 0 replace a_hourwage = -8 if (mi(a_hourwage) | a_hourwage == 0) &(a_employ == 2 |a_employ == 3) label value a_hourwage numeric_l label variable a_hourwage "Hourly wage rate" format a_hourwage %9.1f tab a_hourwage * Income from main job last year (main job) gen a_yearinc1 = ijob110 replace a_yearinc1 = -8 if a_yearinc1==0 & (a_employ == 2 |a_employ == 3) label value a_yearinc1 numeric_l label variable a_yearinc1 "Income from main job last year (main job)" sum a_yearinc1 * Income from other job last year (including second, part-time, terporary job?) gen a_yearinc2 = 0 foreach var in ijob210 iself10 { qui replace a_yearinc2 = a_yearinc2 + `var' if `var' > 0 } replace a_yearinc2 = -8 if a_yearinc2==0 & (a_employ == 2 |a_employ == 3) label value a_yearinc2 numeric_l label variable a_yearinc2 "Income from other job last year (including second, part-time, terporary job?)" format a_yearinc2 %9.1f sum a_yearinc2 * Annual pension (for retired) gen a_pensioninc = 0 foreach var in igrv110 igrv210 ivbl110 ivbl210 icom110 icom210 { replace a_pensioninc = a_pensioninc + `var' if `var' > 0 } label variable a_pensioninc "Annual pension (for retired)" format a_pensioninc %9.1f sum a_pensioninc * Total labor income last year egen a_income=rowtotal(a_yearinc1 a_yearinc2),missing replace a_income = a_yearinc1 if a_yearinc2 < 0 replace a_income = a_yearinc2 if a_yearinc1 < 0 replace a_income = -8 if a_yearinc1 <0 & a_yearinc2 < 0 label value a_income numeric_l label variable a_income "Total labor income last year" format a_income %9.1f tab a_income * EGP of R's main job *egp10 Erikson, Goldthorpe Class Category IS88 from bapgen clonevar a_egp = egp10 replace a_egp = -8 if egp10 == -2 replace a_egp = . if egp10 == -1 label copy egp10 a_egp label variable a_egp "EGP of R's main job" label define a_egp -8 "Not Applicable", modify label value a_egp a_egp tab a_egp, mi tab a_egp if a_egp >=0 * Industry of R's main job *nace10 2 Digit NACE Industry, Sector from bapgen clonevar a_industry = nace10 label define nace10 -8 "not applicable" -2 "refuse to answer" -1 "don't know", modify label variable a_industry "Industry of R's main job" label val a_industry nace10 tab a_industry if a_industry>0 tab a_industry,mi * Working experience clonevar a_exp = expft10 //from bapgen //Working Experience Full-Time Employment recode a_exp (-2=-8) label value a_exp numeric_l label variable a_exp "Working experience" tab a_exp,mi sum a_exp if a_exp > 0 insp a_exp * Tenure of current job clonevar a_tenure=baerwzeit //from bapgen //Length of Time with Firm label value a_tenure numeric_l label variable a_tenure "Tenure of current job" sum a_tenure if a_tenure>0 tab a_tenure, mi * Job satisfaction gen a_jobsat = bap0103 //from bap replace a_jobsat = 1 if a_jobsat == 0 | a_jobsat == 1 replace a_jobsat = 2 if a_jobsat >= 2 & a_jobsat <= 4 replace a_jobsat = 3 if a_jobsat == 5 replace a_jobsat = 4 if a_jobsat >= 6 & a_jobsat <= 8 replace a_jobsat = 5 if a_jobsat == 9 | a_jobsat == 10 label define a_jobsat_l -8 "Not Applicable" -2 "Refused" /// -1 "Don't Know" 1 "Very Unsatisfied" 2 "Unsatisfied" /// 3 "Fair" 4 "Satisfied" 5 "Very Satisfied" label values a_jobsat a_jobsat_l label variable a_jobsat "Job Satisfaction" tab a_jobsat,mi tab a_jobsat if a_jobsat >=0 * Whether has unemployment insurance *bapequiv gen a_unemployinsur = 1 qui replace a_unemployinsur = 0 if iunby10 == 0 label define a_unemployinsur 0 "No" 1 "Yes" label values a_unemployinsur a_unemployinsur label variable a_unemployinsur "Whether has unemployment insurance" tab a_unemployinsur, mi * Whether has pension *igrv110 : Retirement pay: stat. pension insurance *igrv210 : Widows pension: stat pension insurance *ivbl110 : Supplementary benefits for civil servants *ivbl210 : Widows supplement benefits(civil servants) *icom110 : Company pension *icom210 : Widows company pension *bapequiv gen a_pension = 1 qui replace a_pension = 0 if a_pensioninc == 0 label define a_pension 0 "No" 1 "Yes" label values a_pension a_pension label variable a_pension "Whether has pension" tab a_pension, mi * Whether has maternity insurance or whether it's included by R's health insurance *imaty10 bapequiv :maternity benefit gen a_materinsur = 1 qui replace a_materinsur = 0 if imaty10 == 0 label define a_materinsur 0 "No" 1 "Yes" label values a_materinsur a_materinsur label variable a_materinsur "Whether has maternity insurance or whether it's included by R's health insurance" tab a_materinsur, mi save File_Ger, replace ***************************** *Part. 4 Household Economic Activities ***************************** * Number of persons in family/ Family size use "$datadir\bapbrutto" keep hhnrakt bastell recode bastell (0 = 0 "[0] Head of household") (1 2 13 = 1 "[1] Spouse of hh head") (3 4 12 = 2 "[2] Child") /// (5 = 3 "[3] Child in law") (6 = 4 "[4] Parent") (7 = 5 "[5] Parent in law") (8 = 6 "[6] Siblings") /// (9 = 7 "[7] Grandchild") (10= 8 "[8] Other relative" )(11= 9 "[9]Non-relative"), gen(relation) drop bastell gsort hhnrakt relation bysort hhnrakt: gen j = _n reshape wide relation, i(hhnrakt) j(j) // reshape long to wide to generate family level variables gen a_hhsize = 0 for num 1/14: qui replace a_hhsize = a_hhsize + 1 if !missing(relationX) label variable a_hhsize "Number of persons in household/ Household size" gen a_nonrelative = 0 for num 1/14: qui replace a_nonrelative = a_nonrelative + 1 if relationX == 9 gen a_fsize = a_hhsize - a_nonrelative label variable a_fsize "Family size" gen a_otherrelative=0 for num 1/14: qui replace a_otherrelative = a_otherrelative + 1 if relationX == 8 * Number of generations in household local A gc c p local B grandchildren children parents forvalues j=1/3 { local m: word `j' of `A' local n: word `j' of `B' gen gener_`m' = 0 label variable gener_`m' "whether has `n'" } forvalues i=1/14 { qui replace gener_gc=1 if relation`i'==7 // grandchildren qui replace gener_c=1 if relation`i'==2 | relation`i'==3 // children qui replace gener_p=1 if relation`i'==4 | relation`i'==5 // parents } // generate generation variables gen a_gen = 1 // default is 1 generation in HH replace a_gen = 2 if (gener_gc==0&gener_c==1&gener_p==0) | (gener_gc==0&gener_c==0&gener_p==1) // HH&children; HH&parents replace a_gen = 3 if (gener_gc==1&gener_p==0) | (gener_gc==0&gener_c==1&gener_p==1) // HH&grandchildren(with or without children); HH&children&parents replace a_gen = 4 if gener_gc==1&gener_p==1 //HH&grandchilren&parents(with or without children) replace a_gen = -1 if a_otherrelative > 0 label variable a_gen "Number of generations in household" label define a_gen -8 "Not Applicable" -2 "Refused to Answer" -1"Don't Know" 1 "1 Generation" 2 "2 Generations" 3 "3 Generations" 4 "4 or more Generations" label value a_gen a_gen * Family Structure (6 categories) * Only consider composition of the family unit who are relatives in the household, no consideration on non-relative household members local A s c cl p pl sib gc or non local B spouse children children-in-law parents parents-in-law siblings grandchildren other-relative non-relative forvalues j=1/9 { local m: word `j' of `A' local n: word `j' of `B' gen coresid_`m' = 0 label variable coresid_`m' "number of `n' coresident with HH head" forvalues i=1/14 { qui replace coresid_`m' = coresid_`m' + 1 if relation`i' == `j' } } // generate coresidence variables gen a_fstruc = 6 // defalt is other family * 1.Primary individual family replace a_fstruc = 1 if a_fsize==1 * 2.Single-parent family * HH head & unmarried children replace a_fstruc = 2 if coresid_s==0 & coresid_c>0 & coresid_cl==0 & coresid_p==0 /// & coresid_pl==0 & coresid_sib==0 & coresid_gc==0 & coresid_or==0 * One parent & unmarried HH head (and siblings) replace a_fstruc = 2 if coresid_c==0 & coresid_cl==0 & coresid_p==1 & coresid_pl==0 /// & coresid_s==0 & coresid_gc==0 & coresid_or==0 * 3.Couple with no children (two person family) * Couple and family size==2 replace a_fstruc = 3 if coresid_s==1 & a_fsize==2 * 4.Couple with unmarried children * HH head & spouse & unmarried children replace a_fstruc = 4 if coresid_s==1 & coresid_c>0 & coresid_cl==0 & coresid_p==0 /// & coresid_pl==0 & coresid_sib==0 & coresid_gc==0 & coresid_or==0 * Parents (both) & unmarried HH head (and siblings) replace a_fstruc = 4 if coresid_c==0 & coresid_cl==0 & coresid_p==2 & coresid_pl==0 /// & coresid_s==0 & coresid_gc==0 & coresid_or==0 * Stem family (parent+married child, with or without grandchildren) * HH, spouse and parent or parent-in-law replace a_fstruc = 5 if coresid_s==1 & ((coresid_p>0 & coresid_pl==0) | (coresid_p==0 & coresid_pl>0)) /// & coresid_c==0 & coresid_cl==0 & coresid_sib==0 & coresid_gc==0 & coresid_or==0 * HH (with or without spouse), 0 or 1 child, 1 child-in-law replace a_fstruc = 5 if coresid_c<=1 & coresid_cl==1 /// & coresid_p==0 & coresid_pl==0 & coresid_sib==0 & coresid_gc==0 & coresid_or==0 * HH (with or without spouse), parent or parent-in-law, 1 child or 1 child in law, 0 or more grandchild replace a_fstruc = 5 if ((coresid_p>0 & coresid_pl==0) | (coresid_p==0 & coresid_pl>0)) & (coresid_c==1 | coresid_cl==1) & coresid_gc>=0 /// & coresid_sib==0 & coresid_or==0 * HH (with or without spouse), 0 or 1 child, 0 or 1 child-in-law, 1 or more grandchild ,0 or more parent replace a_fstruc = 5 if (coresid_c<=1 & coresid_cl<=1) & coresid_gc>0 /// & (coresid_p==0 | coresid_pl==0) & coresid_sib==0 & coresid_or==0 label define fstruc_l -8 "Not Applicable" -2 "Refused to Answer" -1"Don't Know" /// 1 "Primary Individual Family" 2 "Single-Parent Family" 3 "Married Couple with No Children" /// 4 "Married Couple with Children" 5 "Stem Family" 6"Other Family" label value a_fstruc fstruc_l label var a_fstruc "Family Structure" * Household Structure *other household if there are non-relative household members gen a_hhstruc = a_fstruc replace a_hhstruc=7 if a_nonrelative >0 label define hhstruc -8 "Not Applicable" -2 "Refused to Answer" -1"Don't Know" /// 1 "Primary Individual Household" 2 "Single-Parent Household" 3 "Married Couple with No Children" /// 4 "Married Couple with Children" 5 "Stem Family Household" 6"Other Household with No Non-relatives" 7 "Other Household with Non-relatives" label value a_hhstruc hhstruc label var a_hhstruc "Household Structure" keep hhnrakt a_hhsize a_nonrelative a_fsize a_gen a_fstruc a_hhstruc save gcompute\fstruc,replace use File_Ger merge m:1 hhnrakt using gcompute\fstruc keep if _merge == 3 drop _merge * part4. Annual family total income rename i1110110 a_faminc_pre label variable a_faminc_pre "Pre-Government Annual family total income" rename i1110210 a_faminc_post label variable a_faminc_pre "Post-Government Annual family total income" sum a_faminc_pre sum a_faminc_post qui recode a_faminc_pre a_faminc_post (-2 -3 -4 -5 -6 -7 -8 = -8) (-1 = -2) // recode variables for missing values save File_Ger, replace ***************************** *Part. 5 Marriage ***************************** qui recode bap151 bap15202 (-2 -3 -4 -5 -6 -7 -8 = -8) (-1 = -2) // recode variables for missing values * Current marriage status (never married, married, devorced, widowed) *bap151 marital status from bap gen a_marriage = bap151 replace a_marriage = 2 if bap151 == 3 //single replace a_marriage = 3 if bap151 == 5 //widowed replace a_marriage = 1 if bap151 == 2 //separated --->married label define mar_l -8 "Not Applicable" -2"Refused to Answer" -1"Don't Know" /// 1 "Married" 2"Single" 3"Widowed" /// 4 "Divorced, annulment" label value a_marriage mar_l label var a_marriage "Current Marital Status" tab a_marriage, mi ***************************** *Part.6 Migration ***************************** merge 1:1 persnr using "$datadir\ppfad", keepusing (corigin) drop if _merge == 2 drop _merge qui recode corigin bap13201 (-2 -3 -4 -5 -6 -7 -8 = -8) (-1 = -2) // recode variables for missing values * Place of birth of R(province/state) *only have information about birth country clonevar a_birthplace = corigin label define corigin -8 "Not Applicable" -2"Refused to Answer" -1"Don't Know", modify label value a_birthplace corigin label variable a_birthplace "Place of birth of R (Country)" tab a_birthplace, mi * Place of current residence of R (province/state) a_province *babula Federal State of residence (l1110110) from bahbrutto clonevar a_province = babula label var a_province "Place of Current Residence of R" label define babula -8"Not Applicable" -2"Refused to Answer", modify label value a_province babula tab a_province, mi * Proficiency of local language *bap131 Mother Tongue German: both parents *bap13201 oral ability *bap13202 written *bap13203 reading gen german_s = bap13201 if bap13201>0 gen german_w = bap13202 if bap13202>0 gen german_r = bap13203 if bap13203>0 egen german = rowmean (german_s german_w german_r) gen a_language = . replace a_language = bap131 if bap131 == 1 |bap131 <0 replace a_language = 2 if german >= 1 & german <= 2 //good replace a_language = 3 if german >2 & german < 4 //fair replace a_language = 4 if german >=4 & german <=5 //bad label define language_l -8 " Not Applicable" -2 "Refused to Answer" -1 "Don't Know" /// 1 "Native User" 2"Good" 3"Fair" 4"Bad" label var a_language "Proficiency of local language" label value a_language language_l tab a_language, mi ***************************** *Part.7 Housing ***************************** merge m:1 hhnrakt using "$datadir\bah", keepusing(bah29) keep if _merge != 2 drop _merge merge m:1 hhnrakt using "$datadir\bahgen", keepusing(owner10 size10 room10 moveyr10) keep if _merge != 2 drop _merge qui recode owner bah29 size10 room10 moveyr10 bawum1 (-2 -3 -4 -5 -6 -7 -8 = -8) (-1 = -2) // recode variables for missing values * House Ownership *from bahgen gen a_house_owner = owner10 qui recode a_house_owner (. = -8) // household questionnaire nonrespondence replace a_house_owner = 1 if owner10 == 1 | owner10 == 5 //Owned by R or R's family replace a_house_owner = 2 if owner10 == 2 | owner10 == 3 //Rented label define owner10 -8 "Not Applicable" -2 "Refuse to Answer" -1 "Don't Know" /// 1 "Owned by R or R's Family" 2 "Rented", modify label variable a_house_owner "House Ownership" label value a_house_owner owner10 tab a_house_owner, mi * Housing type (house, apartment, courtyard) rename bawum1 a_housing label variable a_housing "housing type (house, apartment, courtyard)" tab a_housing, mi * Mortgage *bah29 from bah gen a_mortgage = bah29 qui recode a_mortgage (2=0) label define yesno -8 "Not Applicable" -2 "Refuse to Answer" -1 "Don't Know" /// 1"Yes" 0"No" label value a_mortgage yesno label variable a_mortgage "Whether have housing mortgage" tab a_mortgage, mi * Floor size *size10 from bahgen gen a_housesize =size10 label variable a_housesize "Floor size" sum a_housesize * Year of moving in this house *moveyr10 from bahgen gen a_moveyear = moveyr10 label value a_moveyear numeric_l label variable a_moveyear "Year of moving in this house" tab a_moveyear if a_moveyear <0 sum a_moveyear if a_moveyear >0 insp a_moveyear ***************************** *Part.8 Health and Well-being ***************************** qui recode bap97 bap96 bap87 bap9901 bap9501 bap9401 bap9402 bap9403 bap9404 bap12503 bap160 (-2 -3 -4 -5 -6 -7 -8 = -8) (-1 = -2) // recode variables for missing values * Current body weight *bap97 from bap clonevar a_weight = bap97 label variable a_weight "Current body weight" label value a_weight numeric_l sum a_weight if a_weight > 0 tab a_weight if a_weight < 0 insp a_weight * Current height *bap96 from bap clonevar a_height = bap96 label variable a_height "Current height" label value a_height numeric_l sum a_height if a_height > 0 tab a_height if a_height < 0 insp a_height * Self-rated health status gen a_health = bap87 recode a_health (1/2 = 1 ) (3=2) (4/5=3) label define health_l -8 "Not Applicable" -2 "Refused to Answer" -1"Don't Know" /// 1" Good" 2 "Fair" 3"Bad" label value a_health health_l label var a_health "Self-rated Health Status" tab a_health, mi * Frequancy of hospitalization due to illness/injury during the past year clonevar a_hospi = bap9901 label value a_hospi numeric_l label variable a_hospi "Frequancy of hospitalization due to illness/injury during the past year" sum a_hospi if a_hospi >0 tab a_hospi if a_hospi <0 insp a_hospi * Health Insurance *bap107 from bap: Type of Health Insurance qui recode bap107 (-1 = 0) (1 2 = 1), gen(a_healthinsur) label values a_healthinsur yesno label variable a_healthinsur "Whether have health insurance" tab a_healthinsur, mi * Did you smoke in the last month *bap9501 from bap: Curently Smoke? gen a_smoking = bap9501 recode a_smoking (2=0) label value a_smoking yesno label variable a_smoking "Frequency of smoking in the last month" tab a_smoking, mi * Did you drink alcohol more than three times each week in the last month *bap9401 bap9402 bap9403 bap9404: Freq. of drinking different types of alcohol gen a_drinking =0 replace a_drinking = 1 if bap9401 == 1 | bap9402 == 1 |bap9403 == 1| bap9404 == 1 replace a_drinking = -8 if bap9401 < 0 & bap9402 < 0 &bap9403 < 0& bap9404 < 0 replace a_drinking = . if bap9401 ==. & bap9402 ==. &bap9403 ==.& bap9404 ==. label value a_drinking yesno label var a_drinking "Do you drink regularly" tab a_drinking, mi * Self-rated happiness gen a_happiness = bap12503 label define degree_l -8 "Not Applicable" -2 "Refused to Answer" -1"Don't Know" /// 1 "1 Low" 5 "5 High" label value a_happiness degree_l label variable a_happiness "Self-rated Degree of Happiness" tab a_happiness, mi * Self-rated life satisfaction *bap160 satisfaction with life at today gen a_lifesat = bap160 recode a_lifesat (0/1=1)(2/4=2)(5=3)(6/8=4)(9/10=5) label define lifesat_l -8 "Not Applicable" -2 "Refused to Answer" -1"Don't Know" /// 1 "Very Dissatisfied" 2" Dissatisfied" 3"Fair" 4"Satisfied" 5 "Very Satisfied" label value a_lifesat lifesat_l label var a_lifesat "Self-rated Life Satisfaction" tab a_lifesat, mi * BMI a_bmi gen a_bmi = . replace a_bmi = a_weight/(a_height/100)^2 if a_weight > 0 &a_height>0 replace a_bmi = a_weight if a_weight < 0 replace a_bmi = a_height if a_height < 0 label value a_bmi numeric_l label var a_bmi "BMI" sum a_bmi if a_bmi >0 tab a_bmi if a_bmi < 0 insp a_bmi replace a_bmi = . if a_bmi >100 save File_Ger, replace **************************SPOUSE********************** *partnr10 Partner Person Number keep persnr a_birthy a_birthm a_age a_urban a_eduy a_edu a_isco a_employ a_birthplace a_province /// a_language rename persnr partnr10 rename a_* a_*_s save gcompute\spouse, replace use File_Ger merge m:1 partnr10 using gcompute\spouse drop if _merge == 2 drop _merge save File_Ger, replace foreach var of varlist a_*_s { replace `var' = -8 if mi(`var') & (bap151 >=2|partnr10 <0) } * Year of birth of R's spouse a_birthy_s label value a_birthy_s numeric_l label var a_birthy_s "Year of birth of R's spouse" tab a_birthy_s, mi sum a_birthy_s if a_birthy_s > 0 * Month of birth of R's spouse a_birthm_s label value a_birthm_s numeric_l label var a_birthm_s "Month of birth of R's spouse" tab a_birthm_s, mi tab a_birthm_s if a_birthm_s>0 * Age of R's spouse a_age_s label value a_age_s numeric_l label var a_age_s "Age of R's spouse" tab a_age_s, mi sum a_age_s if a_age_s > 0 * Place of residence of R's spouse (urban or rural) a_urban_s label var a_urban_s "Place of residence of R's spouse (urban or rural)" label value a_urban_s a_urban_l tab a_urban_s, mi tab a_urban_s if a_urban_s >=0 * Years of schooling of R's spouse a_eduy_s *Highest educational level attained by R's spouse a_edu_s label value a_eduy_s numeric_l label var a_eduy_s "Year of Schooling of R's spouse" tab a_eduy_s, mi tab a_eduy_s if a_eduy_s > 0 label var a_edu_s "Highest educational level attained by R's spouse" tab a_edu_s, mi tab a_edu_s if a_edu_s >=0 * Occupation of R's spouse's main job a_isco_s *Employment status of R's spouse a_employ_s label var a_employ_s "Employment status of R's spouse" label var a_isco_s "Occupation of R's spouse's main job" tab a_employ_s, mi tab a_employ_s if a_employ_s >=0 clonevar a_isco1_s = a_isco_s replace a_isco1_s = int(a_isco1_s/100) if a_isco1_s > 0 label values a_isco1_s isco1 * Place of birth of R's spouse a_birthplace_s label var a_birthplace_s "Place of birth of R's Spouse (Country)" tab a_birthplace_s, mi * Place of current residence of R's spouse a_province_s label var a_province_s "Place of current residence of R's spouse" label var a_language_s "Proficiency of local language for R's spouse" keep a_* save File_Ger, replace