***************************** *Preamble ***************************** clear all set more off cap log close cd "E:\Wave_1"//Define the working directory /*Define the data source directory, where there should contain file NKPS_maindata_wave1_0405, Dutch ISCO codes*/ global datadir "E:\Original Data\Netherlands" use "$datadir\NKPS_maindata_wave1_0405" save File_NL, replace ***************************** *Part0. IDs and weights ***************************** label define numeric_l -8"Not Applicable" -2"Refused to Answer" -1"Don't Know" * Year of survey gen a_syear = ayear label var a_syear "Year of survey" tab a_syear, mi * Month of survey gen a_smonth = month(aintdate) label var a_smonth "Month of Survey" tab a_smonth, mi * Individual id *defined to be the same as family id gen a_pid = famnum label var a_pid "Individual ID" * Family id gen a_fid = famnum label var a_fid "Family id" insp a_fid * Cross-wave person identifier gen a_pidp = famnum label var a_pidp "Cross wave person identifier (for panel data)" * Individual sample weight *aweight0 converts sample into an individual sample gen a_pweight = aweight0 label var a_pweight "Individual sample weight" tab a_pweight, mi * Family sample weight *aweight1 adjust the sample to an individual sample & adjust the sample *distribution of household type gen a_fweight = aweight1 label var a_fweight "Family Sample Weight" insp a_fweight ***************************** *Part1. Basic Demographic ***************************** * Birth year *abirthyr gen a_birthy = abirthyr label var a_birthy "R's year of birth" insp a_birthy * Birth month *aa102 birthdate Anchor gen a_birthm = month(aa102) label var a_birthm "R's month of birth" tab a_birthm * Age *aage gen a_age=aage label var aage "R's age" insp a_age * Gender *asex 0 male 1female --> 1male 2female gen a_gender = asex +1 label define gender 1 "Male" 2 "Female" label values a_gender gender tab a_gender, mi * Ethnicity gen a_ethnica=an105 replace a_ethnica = 1 if an105 ==. & an101 == 2 label values a_ethnica an105 label var a_ethnica "R's Ethnicity" tab a_ethnica,mi * R's Ethnicity: Majority or not gen a_ethnicb = . replace a_ethnicb = 1 if a_ethnica == 1 replace a_ethnicb = 2 if a_ethnica >= 2 & a_ethnica != . label define a_ethnicb 1 "Majority: Dutchman" 2 "Minority" label value a_ethnicb a_ethnicb label var a_ethnicb "R's Ethnicity: Majority or not" tab a_ethnicb,mi * R's place of residence is urban or rural gen a_urban = . replace a_urban = 1 if aurbres >= 1 & aurbres <=3 //urban replace a_urban = 2 if aurbres >= 4 & aurbres <=5 //rural label define urban 1 "urban" 2 "rural" label values a_urban urban label var a_urban "R's place of residence is urban or rural" tab a_urban, mi * Sibling *ansibs: Number of own/half/adop siblings anchor incl deceased gen a_sib = ansibs gen sib_v1 = 0 //correct with ax301s* forvalues i=1/9 { replace sib_v1 = sib_v1 + 1 if ax301s`i' != . } replace a_sib = sib_v1 if sib_v1 > a_sib label value a_sib numeric_l label var a_sib "Number of Siblings of R" tab a_sib,mi tab a_sib if a_sib>=0 * Birth order of R a_birthorder *abirthyr Year of birth anchor *ax301s* Year of birth sibling * gen a_birthorder = 1 forvalues i = 1/9 { forvalues j = 1/8161 { if abirthyr[`j'] >= ax301s`i'[`j'] { qui replace a_birthorder = `i'+ 1 in `j' } } } label variable a_birthorder "Birth order of R" label value a_birthorder numeric_l tab a_birthorder, mi * Father birth year gen a_birthy_f = ax301f replace a_birthy_f = . if ax301f >= 1991 & ax301f != . 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 * Father's age, death = na gen a_age_f = a_syear - a_birthy_f if a_birthy_f >0 replace a_age_f = a_birthy_f if a_birthy_f < = 0 replace a_age_f = -8 if ax402f > 0 & ax402f !=. 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 * Mother birth year gen a_birthy_m = ax301m replace a_birthy_m = . if ax301m >= 1991 & ax301m != . 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 * Mother's age, death = na gen a_age_m = a_syear - a_birthy_m if a_birthy_m >0 replace a_age_m = a_birthy_m if a_birthy_m < = 0 replace a_age_m = -8 if ax402m > 0 & ax402m !=. 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 * Year of birth of R's spouse a_birthy_s *ac102 Current partner: birthyear gen a_birthy_s = ac102 replace a_birthy_s = . if ac102 >=1991 & ac102 != . replace a_birthy_s = -8 if amarstat == 2 & mi(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 * Age of R's spouse a_age_s gen a_age_s = a_syear - a_birthy_s if a_birthy_s > 0 replace a_age_s = a_birthy_s if a_birthy_s <0 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 * Number of children of R a_child gen a_child = ankids label var a_child "Number of Children of R" label value a_child numeric_l tab a_child, mi * Year of birth first ten children forvalues i = 1/9 { gen a_birthy_c`i' = ax301c`i' replace a_birthy_c`i' = -8 if mi(a_birthy_c`i') & `i'> ankids label var a_birthy_c`i' "Year of Birth Of R's Children" label value a_birthy_c`i' numeric_l } gen a_birthy_c10=ax301d1 gen a_birthy_c11=ax301d2 gen a_birthy_c12=ax301d3 replace a_birthy_c10 = -8 if mi(a_birthy_c10) & 10> ankids replace a_birthy_c11 = -8 if mi(a_birthy_c11) & 11> ankids replace a_birthy_c12 = -8 if mi(a_birthy_c12) & 12> ankids label var a_birthy_c10 "Year of Birth Of R's Children" label var a_birthy_c11 "Year of Birth Of R's Children" label var a_birthy_c12 "Year of Birth Of R's Children" label value a_birthy_c1* numeric_l * Age of first ten children forvalues i=1/12 { gen a_age_c`i' = a_syear - a_birthy_c`i' if a_birthy_c`i' > 0 qui replace a_age_c`i' = a_birthy_c`i' if a_birthy_c`i' <= 0 label value a_age_c`i' numeric_l label variable a_age_c`i' "Age of R's no.`i' child" } forvalues i=1/9 { replace a_age_c`i' = -8 if ax402c`i' >=0 & ax402c`i' != . } replace a_age_c10 = -8 if ax402d1 >=0 & ax402d1 != . replace a_age_c11 = -8 if ax402d2 >=0 & ax402d2 != . replace a_age_c12 = -8 if ax402d3 >=0 & ax402d3 != . save File_NL, replace ***************************** *Part 2. Education ***************************** use File_NL merge 1:1 famnum using "$datadir\DutchISCED" drop _merge /*idea in ISCED: 0 pre-primary : 1 incompete 1 primary levl : 2 elementar 2 lower secon : 3 lower voc/ 4 lower gen 3 upper secon : 5 medium ge/ 6 upper gen/7 intermedi 5 first stage : 8 higher voc / 9 university 6 secon stag : 10 post */ * Highest educational level attained by R a_edu gen a_edu = -8 replace a_edu = 1 if aedu == 1 | aedu == 2 // 1. Elementary and Below replace a_edu = 2 if aedu == 3 | aedu == 4 // 2. Junior High and Vocational School replace a_edu = 3 if aedu == 5 | aedu == 6 | aedu == 7 // 3. Senior High and Vocational School replace a_edu = 4 if aedu == 8 // 4. Vocational College or Some College replace a_edu = 5 if aedu == 9 | aedu == 10 // 5. Bachelor Degree and above mvdecode a_edu, mv( -8 ) 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 *ab505: Father:level of education attained gen a_edu_f= ab505 recode a_edu_f (-1 = -8) (11 = -1) recode a_edu_f (1 2 = 1)(3 4 = 2)(5 6 7 = 3 )(8 = 4) (9 10 = 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 *ab510: Mother:level of education attained gen a_edu_m= ab510 recode a_edu_m (-1 = -8) (11 = -1) recode a_edu_m (1 2 = 1)(3 4 = 2)(5 6 7 = 3 )(8 = 4) (9 10 = 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 * Highest educational level attained by R's spouse a_edu_s *am801: Partner:level of education attained (not SPVA group) *ao107: (SPVA group) gen a_edu_s = am801 replace a_edu_s = ao107 if ao107 >0 & ao107 !=. recode a_edu_s (-1 -2 = -8) (11 = -1) recode a_edu_s (1 2 = 1)(3 4 = 2)(5 6 7 = 3 )(8 = 4) (9 10 = 5) replace a_edu_s = -8 if mi(a_edu_s) & amarstat != 1 label value a_edu_s a_edu_l 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 ***************************** *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 *am202: Curren Main Activity gen a_employ = . replace a_employ = 1 if am202 == 1 | am202 == 18 //1. Employed replace a_employ = 2 if am202 == 2 | am202 == 20 //2. Unemployed replace a_employ = 3 if am202 >= 3 & am202 <= 6 //3. Not in Labour Market replace a_employ = -8 if am202 == 7 | am202 == 19 | am202 == 21 //-8: Not Applicable 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 tab a_employ if a_employ>=0 * Employment status of R's spouse a_employ_s *am811: Partner: current main activityao202 not asked for spva cont *ao202: Partner: current main activity SPVA control group only gen a_employ_s = am811 replace a_employ_s = ao202 if am811 <0 recode a_employ_s (1 18 =1 ) (2 20 =2) (3/6 = 3) (7 19 21 =-8) replace a_employ_s = -8 if amarstat != 1 & mi(a_employ_s) label values a_employ_s a_employ_l label var a_employ_s "Employment status of R's spouse" tab a_employ_s ,mi tab a_employ_s if a_employ_s >=0 * Working hours per week a_workhour_week *am311: Factual nr of working hours clonevar a_workhour_week = am311 replace a_workhour_week = -8 if mi(a_workhour_week) & a_employ != 1 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 save File_NL, replace /*Merging in occupation data*/ use "$datadir\Dutch ISCO codes.dta", clear /*rename (arid a828 a828_1dig a832 a832_1dig a917 a917_1dig a921 a921_1dig a5112 a5112_1dig a5114 a5114_1dig) /// (famnum a_isco_last a_isco_last_dig a_isco a_isco_dig a_isco_s_last a_isco_s_last_dig a_isco_s a_isco_s_dig a_isco_f a_isco_f_dig a_isco_m a_isco_m_dig) */ sort famnum capture mkdir nlcompute save nlcompute\Dutch_ISCO_codes.dta, replace use File_NL merge 1:1 famnum using nlcompute\Dutch_ISCO_codes.dta drop _merge * Occupation (ISCO88/08 standardization) a_isco * Occupation of R's first job a_isco_first * Occupation of R's spouse's main job a_isco_s * Occupation (ISCO) of R's father when R was a child a_isco_f * Occupation (ISCO) of R's mother when R was a child a_isco_m label var a_isco "Occupation (ISCO88/08 standardization)" label var a_isco_f "Occupation (ISCO) of R's father when R was a child" label var a_isco_m "Occupation (ISCO) of R's mother when R was a child" replace a_isco = -8 if mi(a_isco) & a_employ != 1 drop a_isco_s //null variable *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 100 `"Legislators & Senior officials"', 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 200 `"Professionals"', 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 300 `"Technicians and associate 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 *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,mi tab a_isco if a_isco > 0 replace a_isco_f = int(a_isco_f/10) if a_isco_f > 0 label value a_isco_f a_isco replace a_isco_m = int(a_isco_m/10) if a_isco_m > 0 label value a_isco_m a_isco *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 * Monthly income by employment, including all benefits. if am701 ==5 | 6, refer to am702 gen a_monthinc = am701b if am701 ==1 | am701 ==2 replace a_monthinc = am701b * 4 if am701 ==3 //if am701==4, it represents that the inomce is irregular and the value is an average number// replace a_monthinc = 0 if am701 == 7 replace a_monthinc = 225 if am702 ==1 replace a_monthinc = 650 if am702 ==2 replace a_monthinc = 850 if am702 ==3 replace a_monthinc = 1050 if am702 ==4 replace a_monthinc = 1250 if am702 ==5 replace a_monthinc = 1450 if am702 ==6 replace a_monthinc = 1650 if am702 ==7 replace a_monthinc = 1850 if am702 ==8 replace a_monthinc = 2050 if am702 ==9 replace a_monthinc = 2250 if am702 ==10 replace a_monthinc = 2450 if am702 ==11 replace a_monthinc = 2650 if am702 ==12 replace a_monthinc = 2850 if am702 ==13 replace a_monthinc = 3050 if am702 ==14 replace a_monthinc = 3250 if am702 ==15 replace a_monthinc = 3450 if am702 ==16 replace a_monthinc = 3650 if am702 ==17 replace a_monthinc = -8 if mi(a_monthinc) & a_employ != 1 label value a_monthinc numeric_l label variable a_monthinc "Average monthly wage" * Hourly wage gen a_hourwage=a_monthinc/(am311/7*30) if am311>0 & a_monthinc >0 replace a_hourwage=0 if am311==0 | a_monthinc == 0 replace a_hourwage = -8 if mi(a_hourwage) & a_employ != 1 label var a_hourwage "Hourly Wage" label value a_hourwage numeric_l * Annual income (main job) gen a_yearinc1=a_monthinc*12 if a_monthinc >=0 replace a_yearinc1 = a_monthinc if a_monthinc < 0 label value a_yearinc1 numeric_l label var a_yearinc1 "Annual Income" tab a_yearinc1 * Annual pension gen a_pensioninc = 0 replace a_pensioninc = am705 if (am704_1==4|am704_2==4) replace a_pensioninc = 225 if am706 ==1 & (am704_1==4|am704_2==4) replace a_pensioninc = 650 if am706 ==2 & (am704_1==4|am704_2==4) replace a_pensioninc = 850 if am706 ==3 & (am704_1==4|am704_2==4) replace a_pensioninc = 1050 if am706 ==4 & (am704_1==4|am704_2==4) replace a_pensioninc = 1250 if am706 ==5 & (am704_1==4|am704_2==4) replace a_pensioninc = 1450 if am706 ==6 & (am704_1==4|am704_2==4) replace a_pensioninc = 1650 if am706 ==7 & (am704_1==4|am704_2==4) replace a_pensioninc= 1850 if am706 ==8 & (am704_1==4|am704_2==4) replace a_pensioninc = 2050 if am706 ==9 & (am704_1==4|am704_2==4) replace a_pensioninc = 2250 if am706 ==10 & (am704_1==4|am704_2==4) replace a_pensioninc = 2450 if am706 ==11 & (am704_1==4|am704_2==4) replace a_pensioninc = 2650 if am706 ==12 & (am704_1==4|am704_2==4) replace a_pensioninc = 2850 if am706 ==13 & (am704_1==4|am704_2==4) replace a_pensioninc = 3050 if am706 ==14 & (am704_1==4|am704_2==4) replace a_pensioninc= 3250 if am706 ==15 & (am704_1==4|am704_2==4) replace a_pensioninc = 3450 if am706 ==16 & (am704_1==4|am704_2==4) replace a_pensioninc = 3650 if am706 ==17 & (am704_1==4|am704_2==4) replace a_pensioninc=a_pensioninc*12 label var a_pensioninc "Annual Pension" * Annual labor income gen a_income = a_yearinc1 label var a_income "Annual Labor Income" * Working experience a_exp *am408: Nr of years employed (only applicable to spva control group) *am402: Year start 1st job *am407: Nr of >1 year unemployed gen a_exp = am408 if am408 >=0 replace a_exp = a_syear - am402 if am402 >0 & am402 != . &mi(a_exp) replace a_exp = a_exp - am407 if !mi(am407) replace a_exp = 60 if a_exp >=60 & a_exp !=. recode a_exp (-3 -1 = 0) label value a_exp numeric_l label var a_exp "Work Experience" tab a_exp, mi sum a_exp if a_exp >0 * Whether has injury insurance a_injureinsur *whether has disability benefit //Income: 1st type of benefit gen a_injureinsur = 0 replace a_injureinsur = 1 if am704_1 == 3 | am704_2 == 3 | am704_3 == 3 label define a_inj_l -8"Not Applicable" -2"Refused to Answer" -1"Don't Know" /// 0"No" 1"Yes" label value a_injureinsur a_inj_l label var a_injureinsur "Whether has injury insurance" tab a_injureinsur save File_NL, replace ***************************** *Part. 4 Household Economic Activities ***************************** * Family size gen a_fsize = ahhsize replace a_fsize = a_fsize - 1 if ae201_1 >5 & ae201_1 !=. replace a_fsize = a_fsize - 1 if ae201_2 >5 & ae201_2 !=. replace a_fsize = a_fsize - 1 if ae201_3 >5 & ae201_3 !=. replace a_fsize = a_fsize - 1 if ae201_4 >5 & ae201_4 !=. replace a_fsize = a_fsize - 1 if ae201_5 >5 & ae201_5 !=. replace a_fsize = 1 if ahhtyp == 8 label var a_fsize "Family Size" label value a_fsize numeric_l * Household size gen a_hhsize=ahhsize * a_gen:number of generations in household gen a_gen = . replace a_gen = 1 if ahhtyp == 2 | ahhtyp == 3 |ahhtyp == 4 |ahhtyp == 8 /// |ahhtyp == 9 | ahhtyp == 10 replace a_gen = 2 if ahhtyp == 1 | ahhtyp == 5 | ahhtyp == 6 | ahhtyp == 7 /// | ahhtyp == 11 | ahhtyp == 12 | ahhtyp == 13 replace a_gen = a_gen + 1 if ae201_1 ==1 | ae201_2 ==1 | ae201_3 ==1 | /// ae201_4 ==1 | ae201_5 ==1 replace a_gen = a_gen + 1 if (ahhtyp != 1) & (ae201_1 == 2 | ae201_2 == 2 /// | ae201_3 ==2 | ae201_4 ==2 | ae201_5 ==2) replace a_gen = a_gen + 1 if (ahhtyp ==1 | ahhtyp ==2 | ahhtyp ==3 | ahhtyp /// ==4 | ahhtyp ==8 | ahhtyp ==9 | ahhtyp ==10) & (ae201_1 ==3 | ae201_2 ==3 /// | ae201_3 ==3 | ae201_4 ==3 | ae201_5 ==3) replace a_gen =4 if a_gen>4& a_gen!=. 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 val a_gen a_gen * Family structure gen a_fstruc = ahhtyp if ahhtyp >=2 & ahhtyp <= 7 recode a_fstruc (2=1) (3 4 =3) (5 6 =4) (7=2) replace a_fstruc = 6 if ahhtyp == 14 forvalues i=1/5 { qui replace a_fstruc = 6 if ae201_`i' >= 2 & ae201_`i' <= 5 & a_fstruc == . } forvalues i =1/5{ qui replace a_fstruc = 5 if ae201_`i' == 1 & a_fstruc == . } gen a_fstruc1 = ahhtyp if a_fstruc == . recode a_fstruc1 (1=4) (8=1) (9 10=3) (11 12 =4) (13=2) replace a_fstruc = a_fstruc1 if a_fstruc == . drop a_fstruc1 *in the case of step/foster children forvalues i=1/5 { qui replace a_fstruc = 2 if ahhtyp == 8 & a_fstruc == 1 & (ae201_`i' == 21 | ae201_`i' == 23 ) qui replace a_fstruc = 4 if ahhtyp == 9 & a_fstruc == 3 & (ae201_`i' == 21 | ae201_`i' == 23 ) qui replace a_fstruc = 4 if ahhtyp == 10 & a_fstruc == 3 & (ae201_`i' == 21 | ae201_`i' == 23 ) } *in the case of ever-married children replace a_fstruc = 5 if ahhtyp == 1 & a_fstruc == 4 & amarstat >=1 &!mi(amarstat) //R live with parents & R married before forvalues i=1/5 { qui replace a_fstruc = 5 if ahhtyp >= 8 & ahhtyp <= 13 & a_fstruc != 6 & ae201_`i' == 22 //children married/have partner } recode a_fstruc (-1=-8) 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" 6"Other Family" label value a_fstruc fstruc_l label var a_fstruc "Family Structure" * Household Structure gen a_hhstruc = a_fstruc forvalues i=1/5 { //non-family member existed in the household replace a_hhstruc = 7 if ae201_`i' >= 6 & ae201_`i' <= 20 | ae201_`i' == 24 } recode a_hhstruc (-1=-8) label define hhstruc_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" 6"Other Household with No Non-relatives" 7 "Other Household with Non-relatives" label value a_hhstruc hhstruc_l label var a_hhstruc "Household Structure" ***************************** *Part. 5 Marriage ***************************** * Marrital status gen a_marriage=amarstat recode a_marriage (0 = 2)(2 = 4) (-1 = .) 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 * Year of current marriage gen a_cmarri_y = ac117 replace a_cmarri_y = -8 if amarstat != 1 & mi(a_cmarri_y) label var a_cmarri_y "Year of Current Marriage" label define cmarriy_l -8 "Not Applicable" -2"Refused to Answer" -1"Don't Know" label value a_cmarri_y cmarriy_l sum a_cmarri_y * Cohabitation before marriage *ac115 Current partner: year of start cohabitation gen a_cmarri_cohab = . replace a_cmarri_cohab = 1 if a_marriage == 1 & ac115 > 0 replace a_cmarri_cohab = 0 if a_marriage == 1 & ac115 == . replace a_cmarri_cohab = -8 if amarstat != 1 & mi(a_cmarri_cohab) label define cmarri_coh_l -8 "Not Applicable" -2"Refused to Answer" -1"Don't Know" /// 0"No" 1"Yes" label var a_cmarri_cohab "Whether Cohabited before Current Marriage" label value a_cmarri_cohab cmarri_coh_l tab a_cmarri_cohab, mi * Duration of cohabitation before current marriage a_cmarri_cohabd *ac115 Current partner: year of start cohabitation gen a_cmarri_cohabd = ac117 - ac115 replace a_cmarri_cohabd = -8 if a_cmarri_cohabd < 0 replace a_cmarri_cohabd = -8 if amarstat != 1 & mi(a_cmarri_cohabd) label define cohabd_l -8 "Not Applicable" -2"Refused to Answer" -1"Don't Know" /// 0"Below 1 Year" label var a_cmarri_cohabd "Duration of cohabitation before current marriage" label value a_cmarri_cohabd cohabd_l tab a_cmarri_cohabd, mi sum a_cmarri_cohabd if a_cmarri_cohabd>0 * Total number of R's marriages a_marri_times *ac116: Current Partner: Married? *ac404_X: Ex-partner X: Ever married? gen a_marri_times = 0 replace a_marri_times = a_marri_times +1 if ac116 == 1 for num 1/7 : /// replace a_marri_times = a_marri_times +1 if ac404_X == 1 replace a_marri_times = 0 if amarstat == 0 label var a_marri_times "Total number of R's Marriages" tab a_marri_times,mi * In first marriage-a_firstmarry a_firstmarri gen a_firstmarri = . replace a_firstmarri = -8 if a_marri_times == -8 | a_marri_times == 0 replace a_firstmarri = -2 if a_marri_times == -2 replace a_firstmarri = -1 if a_marri_times == -1 replace a_firstmarri = 1 if a_marri_times == 1 & a_marriage == 1 replace a_firstmarri = 0 if (a_marri_times == 1 & a_marriage != 1) | /// a_marri_times >1 label var a_firstmarri "In First Marriage" label define yesno -8 "Not Applicable" -2"Refused to Answer" -1"Don't Know" /// 0"No" 1"Yes" label value a_firstmarri yesno tab a_firstmarri, mi ***************************** *Part.6 Migration ***************************** * Place of birth of R (province/state) a_birthplace *an101: Country of Birth clonevar a_birthplace = an101 label var a_birthplace "Place of Birth of R" tab a_birthplace, mi tab a_birthplace if a_birthplace >=0 * Place of birth of R's spouse a_birthplace_s clonevar a_birthplace_s = ac103 replace a_birthplace_s = -8 if ac101 !=1 label var a_birthplace_s "Place of Birth of R's spouse (Country)" label define ac103 -8 "Not Applicable",modify label value a_birthplace_s ac103 tab a_birthplace_s, mi tab a_birthplace_s if a_birthplace_s >=0 * Place of current residence of R (province/state) a_province *aprovres province anchor clonevar a_province = aprovres label var a_province "Place of Current Residence of R" tab a_province, mi * Place of current residence of R's spouse a_province_s *ac104 Current partner: cohabiting? *ac111p Province current partner gen a_province_s = . replace a_province_s = a_province if ac104 == 1 replace a_province_s = ac111p if ac104 != 1 replace a_province_s = -8 if ac101 !=1 label var a_province_s "Place of Current Residence of R's Spouse" label define aprovres -8"Not Applicable", modify label value a_province_s aprovres tab a_province_s, mi tab a_province a_province_s ***************************** *Part.7 Housing ***************************** * House Ownership (public, subsidized(by government or employer), private, rental) a_house_owner gen a_house_owner = 2 replace a_house_owner = 1 if al204 == 1 | al205 == 1 | al206 == 1 replace a_house_owner = . if al204 == . & al205 == . & al206 == . label define housetn -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 housetn tab a_house_owner, mi * Housing type gen a_housing=al101 label values a_housing al101 * Year of moving in this house a_moveyear gen a_moveyear=al103 label var a_moveyear"Year of Moving in This House" sum a_moveyear insp a_moveyear ***************************** *Part.8 Health and Well-being ***************************** * Self-rated status a_health *an301 General health assessment gen a_health = an301 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 * CES-D depression scale a_cesd *as32b Psychic health: depressed gen a_depressed = as32b replace a_depressed = a_depressed - 1 if a_depressed >=3 label define depress_l -8 "Not Applicable" -2 "Refused to Answer" -1"Don't Know" /// 1" Always" 2 "Often" 3"Sometimes" 4"Seldom" 5"Never" label value a_depressed depress_l label var a_depressed "Freq. of feeling depressed" tab a_depressed, mi * Self-rated happiness a_happiness //as32e FREQ:psychic health: happy gen a_happiness = as32e replace a_happiness = 7- a_happiness if a_happiness >0 recode a_happiness (6=5) (4/5=4) 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 a_lifesat //as35o lifesatisf: satisfied all in all gen a_lifesat = as35o replace a_lifesat = 6-as35o 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 keep a_* *ISCED save File_NL, replace