*merge wave 3 and 7 clear all *path w3 global PATHW3 ="C:\WORK\SHARE\DATA - rel 7.0.0\sharew3_rel7-0-0_ALL_datasets_stata" *path w7 global PATHW7 "C:\WORK\SHARE\DATA - rel 7.0.0\sharew7_rel7-0-0_ALL_datasets_stata" *path rel 7 global PATHR7 "C:\WORK\SHARE\DATA - rel 7.0.0" tempfile wave3 zakladni EkonomickaAktivita2 set more off *---------------------------------------------------------------------------------------------------------------------------- *------------------------------------ WAVE 3 -------------------------------------------------------------------------------- *---------------------------------------------------------------------------------------------------------------------------- *---------------------------------------------------------------------------------------------------------------------------- *************************** merge zakladni modul (vek, yrbirth) *zakladni modul - na to abych dostala vek respondenta cd use "${PATHW3}\sharew3_rel7-0-0_cv_r.dta", clear *****presny vek jednotlivce z roku a mesice narozeni a interview (modul cv_r obsahuje nepresny vek - pravdepodobne zaokrouhleni nahoru) gen vek_presny=. replace vek_presny=(int_year+(int_month/12)) - (yrbirth+(mobirth/12)) if int_year>2000 & int_year<2020 & yrbirth>1880 & yrbirth<=int_year & int_month>=1 & int_month<=12 & mobirth>=1 & mobirth<=12 replace vek_presny=round(vek_presny, 0.01) *****vek zaokrouhleny na cele roky dolu gen vek=floor(vek_presny) gen vek_2017=vek+(2017 - int_year) if int_year>2000 & int_year<2020 replace age_int=. if age_int<0 gen age_int_2017=age_int+(2017-int_year) if int_year>2000 & int_year<2020 *keep only those who are respondents - i.e. respond to main interview keep if interview==1 keep mergeid gender vek_presny vek yrbirth age_int age_int_2017 vek_2017 sort mergeid save `zakladni' *************************** merge vahy use "${PATHW3}\sharew3_rel7-0-0_gv_weights.dta", clear rename cciw_w3 weights_ind_w3 //calibrated cross-sectional individual weight -all keep mergeid weights_ind_w3 sort mergeid merge mergeid using `zakladni' tab _merge drop _merge sort mergeid save `zakladni', replace *---------------------------------------------------------------------------------------------------------------------------- *************************** merge rc (children) use "${PATHW3}\sharew3_rel7-0-0_rc.dta", clear rename sl_rc023_ n_children //number of children forvalues i = 1(1)13 { rename sl_rc026_`i' gender_child_`i' //gender rename sl_rc024_`i' y_birth_child_`i' //year of birth rename sl_rc029_`i' left_job_child_`i' //left job because of child rename sl_rc030_`i' maternity_leave_`i' //How long was maternity interruption } keep mergeid n_children gender_child_* y_birth_child_* left_job_child_* maternity_leave_* sort mergeid merge mergeid using `zakladni' tab _merge drop _merge sort mergeid save `zakladni', replace *---------------------------------------------------------------------------------------------------------------------------- *************************** merge rp (martial status + years -married, divorced) *martial status from waves 1,2, 4, 5, 6 and 7 use "${PATHW3}\sharew3_rel7-0-0_rp.dta", clear rename sl_rp002_ been_married //ever been married rename sl_rp008_1 year_married_1 //year married rename sl_rp014_1 year_divorced_1 //year divorced rename sl_rp008_2 year_married_2 //year married rename sl_rp014_2 year_divorced_2 //year divorced keep mergeid been_married year_married_* year_divorced_* replace been_married=. if been_married<0 replace year_married_1=. if year_married_1<0 replace year_married_2=. if year_married_2<0 sort mergeid merge mergeid using `zakladni', update replace tab _merge drop _merge sort mergeid save `zakladni', replace *---------------------------------------------------------------------------------------------------------------------------- *************************** merge wq (about recognition in job) - FEW OBSERVATIONS!!! use "${PATHW3}\sharew3_rel7-0-0_wq.dta", clear forvalues i = 1(1)18 { rename sl_wq023_`i' job_recognition_`i' //work gives recognition rename sl_wq024_`i' job_adequate_salary_`i' //work has adequate salary } keep mergeid job_recognition_* job_adequate_salary_* sort mergeid merge mergeid using `zakladni' tab _merge drop _merge sort mergeid save `zakladni', replace *---------------------------------------------------------------------------------------------------------------------------- ****************MAIN DATA use "${PATHW3}\sharew3_rel7-0-0_re.dta", clear sort mergeid merge m:m mergeid using `zakladni' tab _merge keep if _merge==3 drop _merge *teacher: job industry = education (sl_re014_1==12) & job description = manager, professional, associate professional (sl_re013_1==1, 2, 3) gen teacher=0 forvalues i = 1(1)20 { gen teacher_`i'=1 if sl_re014_`i'==12 & (sl_re013_`i'==1 | sl_re013_`i'==2 | sl_re013_`i'==3) replace teacher_`i'=0 if sl_re014_`i'!=. & teacher_`i'!=1 replace teacher=1 if teacher_`i'==1 } *health and social worker: job industry = health and social work (sl_re014_1==13) & job description = professional or associate prof. (sl_re013_1==2 or 3 or 5) gen social_work=0 forvalues i = 1(1)20 { gen social_work_`i'=1 if sl_re014_`i'==13 & (sl_re013_`i'==2 | sl_re013_`i'==3 | sl_re013_`i'==5) replace social_work_`i'=0 if sl_re014_`i'!=. & social_work_`i'!=1 replace social_work=1 if social_work_`i'==1 } gen nursery=0 forvalues i = 1(1)20 { gen nursery_`i'=1 if sl_re014_`i'==13 & sl_re013_`i'==3 replace nursery_`i'=0 if sl_re014_`i'!=. & nursery_`i'!=1 replace nursery=1 if nursery_`i'==1 } *rename vars rename sl_re002_ year_finish_edu //Year finished fulltime education rename sl_re006_ start_first_job //Start first paid job rename sl_re035_1 after_last_job //situation in after last job rename sl_re040_ main_job //main job in career forvalues i=1(1)20 { rename sl_re011_`i' year_start_job_`i' //Year started job rename sl_re013_`i' job_desc_`i' //Job description rename sl_re014_`i' job_industry_`i' //Job industry rename sl_re015_`i' job_sector_`i' //job sector - 1 (private), 2(public), 3 (self-employed) rename sl_re016_`i' job_time_`i' //working time - 1 (fuul-time), 2(part-time), 3 ... rename sl_re026_`i' year_stop_job_`i' //year stopped in this job } forvalues i=1(1)16 { rename sl_re021_`i' first_month_wage_`i' //First monthly wage in job rename sl_re022c_`i' currency_wage_`i' //currency of wage rename sl_re031_`i' reasons_left_job_`i' // Reasons left job - 6 (I retired) rename sl_re032_`i' gap_after_job_`i' //Gap after leaving this job rename sl_re033_`i' done_in_gap_`i' //Done in gap after leaving this job } gen w3=1 keep mergeid hhid3 mergeidp3 coupleid3 w3 country gender year_finish_edu year_start_job_* job_desc_* job_industry_* first_month_wage_* start_first_job nursery nursery_* /// year_stop_job_* job_time_* job_sector_* job_recognition_* job_adequate_salary_* n_children gender_child_* y_birth_child_* left_job_child_* maternity_leave_* /// weights_ind_w3 currency_wage_* reasons_left_job_* gap_after_job_* done_in_gap_* after_last_job main_job teacher teacher_* yrbirth age_int_2017 vek_2017 social_work /// social_work_* been_married year_married_* year_divorced_* sort mergeid save `wave3' *---------------------------------------------------------------------------------------------------------------------------- *------------------------------------ WAVE 7 --------------------------------------------------------------------------------- *---------------------------------------------------------------------------------------------------------------------------- *---------------------------------------------------------------------------------------------------------------------------- *************************** merge zakladni modul (vek, yrbirth) *zakladni modul - na to abych dostala vek respondenta use "${PATHW7}\sharew7_rel7-0-0_cv_r.dta", clear *****presny vek jednotlivce z roku a mesice narozeni a interview (modul cv_r obsahuje nepresny vek - pravdepodobne zaokrouhleni nahoru) gen vek_presny=. replace vek_presny=(int_year+(int_month/12)) - (yrbirth+(mobirth/12)) if int_year>2000 & int_year<2020 & yrbirth>1880 & yrbirth<=int_year & int_month>=1 & int_month<=12 & mobirth>=1 & mobirth<=12 replace vek_presny=round(vek_presny, 0.01) *****vek zaokrouhleny na cele roky dolu gen vek=floor(vek_presny) gen vek_2017=vek+(2017 - int_year) if int_year>2000 & int_year<2020 replace age_int=. if age_int<0 gen age_int_2017=age_int+(2017-int_year) if int_year>2000 & int_year<2020 *keep only those who are respondents - i.e. respond to main interview keep if interview==1 keep mergeid gender vek_presny vek yrbirth age_int age_int_2017 vek_2017 sort mergeid save `zakladni', replace *************************** merge vahy (individual share life interview only) *zakladni modul - na to abych dostala vek respondenta use "${PATHW7}\sharew7_rel7-0-0_gv_weights.dta", clear rename cciw_w7_SHL weights_ind_SHL //calibrated cross-sectional individual weight SHARE Life interview rename cciw_w7 weights_ind //calibrated cross-sectional individual weight -all keep mergeid weights_ind_SHL weights_ind sort mergeid merge mergeid using `zakladni' tab _merge drop _merge sort mergeid save `zakladni', replace *---------------------------------------------------------------------------------------------------------------------------- *************************** merge rc (children) use "${PATHW7}\sharew7_rel7-0-0_rc.dta", clear rename rc023_ n_children forvalues i = 1(1)16 { rename rc026_`i' gender_child_`i' //gender rename rc024_`i' y_birth_child_`i' //year of birth rename rc029_`i' left_job_child_`i' //left job because of child rename rc030_`i' maternity_leave_`i' //How long was maternity interruption } keep mergeid n_children gender_child_* y_birth_child_* left_job_child_* maternity_leave_* sort mergeid merge mergeid using `zakladni' tab _merge drop _merge sort mergeid save `zakladni', replace *---------------------------------------------------------------------------------------------------------------------------- *************************** merge rp (martial status + years -married, divorced) *martial status from waves 1,2, 4, 5, 6 and 7 use "${PATHW7}\sharew7_rel7-0-0_rp.dta", clear rename rp002_ been_married //ever been married rename rp008_1 year_married_1 //year married rename rp014_1 year_divorced_1 //year divorced rename rp008_2 year_married_2 //year married rename rp014_2 year_divorced_2 //year divorced keep mergeid been_married year_married_* year_divorced_* replace been_married=. if been_married<0 replace year_married_1=. if year_married_1<0 replace year_married_2=. if year_married_2<0 sort mergeid merge mergeid using `zakladni', update replace tab _merge drop _merge sort mergeid save `zakladni', replace *---------------------------------------------------------------------------------------------------------------------------- *************************** merge wq (about recognition in job) - FEW OBSERVATIONS!!! use "${PATHW7}\sharew7_rel7-0-0_wq.dta", clear forvalues i = 1(1)16 { rename wq023_`i' job_recognition_`i' //work gives recognition rename wq024_`i' job_adequate_salary_`i' //work has adequate salary } keep mergeid job_recognition_* job_adequate_salary_* sort mergeid merge mergeid using `zakladni' tab _merge drop _merge sort mergeid save `zakladni', replace *---------------------------------------------------------------------------------------------------------------------------- ****************MAIN DATA use "${PATHW7}\sharew7_rel7-0-0_re.dta", clear sort mergeid merge m:m mergeid using `zakladni' tab _merge keep if _merge==3 drop _merge *ISCO - 2 digit (isco_i) + 3 digit (isco3_i) forvalues i = 1(1)20 { tostring re012isco_`i', gen(isco_`i') gen isco3_`i'=substr( isco_`i', 1,3) replace isco_`i'=substr( isco_`i', 1,2) destring isco_`i', replace destring isco3_`i', replace replace isco_`i'=. if isco_`i'<0 replace isco3_`i'=. if isco_`i'<0 destring re012isco_`i', replace } *dle isco - urcit ty, kteri jsou ucitelmi (ISCO 23 - Teaching Professionals + 1345 Education managers) gen teacher=0 forvalues i = 1(1)20 { gen teacher_`i'=1 if re012isco_`i'==1345 | isco_`i'==23 replace teacher_`i'=0 if re012isco_`i'!=. & re012isco_`i'!=-7 & teacher_`i'!=1 *replace teacher_`i'=1 if re012isco_`i'==-7 & re014_`i'==12 replace teacher=1 if teacher_`i'==1 } ****dle isco - urcit ty, kteri jsou health and social worker (ISCO 22 and 32 - Health Professionals and associate professionals) gen social_work=0 forvalues i = 1(1)20 { gen social_work_`i'=1 if isco_`i'==22 | isco_`i'==32 | re012isco_`i'==2635 | re012isco_`i'==3412 | re012isco_`i'==5311 | re012isco_`i'==5321 | re012isco_`i'==5322 | re012isco_`i'==5329 replace social_work_`i'=0 if re012isco_`i'!=. & re012isco_`i'!=-7 & social_work_`i'!=1 replace social_work=1 if social_work_`i'==1 } gen nursery=0 forvalues i = 1(1)20 { gen nursery_`i'=1 if isco3_`i'==222 | isco3_`i'==321 | isco3_`i'==322 | isco3_`i'==323 replace nursery_`i'=0 if re012isco_`i'!=. & nursery_`i'!=1 replace nursery=1 if nursery_`i'==1 } drop isco_* *rename vars rename re002_ year_finish_edu //Year finished fulltime education rename re006_ start_first_job //Start first paid job (=1 if right after edu) rename re035_1 after_last_job //situation in after last job rename re040_ main_job //main job in career forvalues i=1(1)20 { rename re011_`i' year_start_job_`i' //Year started job rename re012isco_`i' isco_`i' //ISCO code> Title of job rename re014_`i' job_industry_`i' //Job industry rename re015_`i' job_sector_`i' //job sector - 1 (private), 2(public), 3 (self-employed) rename re016_`i' job_time_`i' //working time - 1 (full-time), 2(part-time), 3 ... rename re026_`i' year_stop_job_`i' //year stopped in this job } forvalues i=1(1)16 { rename re021_`i' first_month_wage_`i' //First monthly wage in job rename re022_`i' currency_wage_`i' //currency of wage rename re031_`i' reasons_left_job_`i' // Reasons left job - 6 (I retired) rename re032_`i' gap_after_job_`i' //Gap after leaving this job rename re033_`i' done_in_gap_`i' //Done in gap after leaving this job } keep mergeid hhid7 mergeidp7 coupleid7 country gender year_finish_edu year_start_job_* isco_* job_industry_* first_month_wage_* start_first_job nursery nursery_* /// job_sector_* job_time_* year_stop_job_* job_recognition_* job_adequate_salary_* n_children gender_child_* y_birth_child_* left_job_child_* maternity_leave_* /// currency_wage_* reasons_left_job_* gap_after_job_* done_in_gap_* after_last_job main_job teacher teacher_* yrbirth age_int_2017 vek_2017 social_work social_work_* /// weights_ind_SHL weights_ind been_married year_married_* year_divorced_* gen __Wave3=. sort mergeid *---------------------------------------------------------------------------------------------------------------------------- *-------------------------------------- MERGE ------------------------------------------------------------- *if _merge=3, i.e. merged data btw. wave 3 and 7 - we have detailed history only from wave 3 merge m:m mergeid using `wave3', update replace tab _merge drop _merge sort mergeid save `zakladni', replace *---------------------------------------------------------------------------------------------------------------------------- *************************** merge gv_isced (about highest edu of respondent, mother and father) **ISCED of respondent from waves 1, 2 and 4 foreach v in 1 2 4 { use "${PATHR7}\sharew`v'_rel7-0-0_ALL_datasets_stata\sharew`v'_rel7-0-0_gv_isced.dta", clear rename isced1997_r isced_resp //isced level 1997 of respondent keep mergeid isced_resp replace isced_resp=. if isced_resp<0 | isced_resp>10 sort mergeid merge mergeid using `zakladni', update replace tab _merge drop if _merge==1 drop _merge sort mergeid save `zakladni', replace } **ISCED of respondent and his parents - from waves 5, 6 and 7 foreach v in 5 6 7 { use "${PATHR7}\sharew`v'_rel7-0-0_ALL_datasets_stata\sharew`v'_rel7-0-0_gv_isced.dta", clear rename isced1997_r isced_resp //isced level 1997 of respondent rename isced1997_m isced_mother //isced level mother rename isced1997_f isced_father //isced level father keep mergeid isced_resp isced_mother isced_father replace isced_resp=. if isced_resp<0 | isced_resp>10 replace isced_mother=. if isced_mother<0 | isced_mother>10 replace isced_father=. if isced_father<0 | isced_father>10 sort mergeid merge mergeid using `zakladni', update replace tab _merge drop if _merge==1 drop _merge sort mergeid save `zakladni', replace } *---------------------------------------------------------------------------------------------------------------------------- *************************** merge dn (martial status) *martial status from waves 1,2, 4, 5, 6 and 7 foreach v in 1 2 4 5 6 7 { use "${PATHR7}\sharew`v'_rel7-0-0_ALL_datasets_stata\sharew`v'_rel7-0-0_dn.dta", clear rename dn014_ martial_status //martial status of respondent keep mergeid martial_status replace martial_status=. if martial_status<0 sort mergeid merge mergeid using `zakladni', update replace tab _merge drop if _merge==1 drop _merge sort mergeid save `zakladni', replace } *---------------------------------------------------------------------------------------------------------------------------- **************************** merge _ep - Reportovany rok odchodu do duchodu foreach v in 2 4 5 6 7 { use "${PATHR7}\sharew`v'_rel7-0-0_ALL_datasets_stata\sharew`v'_rel7-0-0_ep.dta", clear *****identifikator vlny gen vlna=`v' *****ponechani potrebnych promennych keep mergeid vlna ep328_ ep329_ *****spojeni ruznych vln modulu ekon_akt if `v'!=2 append using `EkonomickaAktivita2' save `EkonomickaAktivita2', replace } *****Reportovany rok v dane vlne gen yrretO=ep329_ if ep329_>1900 **Prvni reportovany rok - zmeny v reportovanych hodnotach jsou enormne caste foreach v in 2 4 5 6 7 { gen yrret`v'_pom=yrretO if vlna==`v' // yrretO>=yrbirth+50 egen yrret`v'=mean(yrret`v'_pom) , by(mergeid) drop yrret`v'_pom } gen yrretI=. foreach v in 2 4 5 6 7 { replace yrretI=yrret`v' if yrretI==. & yrret`v'!=. drop yrret`v' } collapse (mean) yrretI, by(mergeid) sort mergeid merge mergeid using `zakladni', update replace tab _merge drop if _merge==1 drop _merge *****Prvni reportovany vek odchodu do duchodu gen ret_vek=. replace ret_vek=yrretI-yrbirth if yrretI!=. & yrbirth!=. replace ret_vek=. if ret_vek<10 tab ret_vek *---------------------------------------------------------------------------------------------------------------------------- *--------------------------------------- NEW VARS ----------------------------------------- *---------------------------------------------------------------------------------------------------------------------------- *gen teacher turnover (0 if no turnover, 1 if turnover, . if not teacher) gen teacher_turnover=(teacher_1==1 & teacher_2==0 & isco_2>0) gen teacher_turnover_2=(teacher_2==0 & teacher_1==1 & isco_2>0) replace teacher_turnover_2=. if teacher==0 forvalues i = 3(1)20 { local n=`i'-1 gen teacher_turnover_`i'=(teacher_`i'==0 & teacher_`n'==1 & teacher_turnover!=1 & isco_`i'>0) replace teacher_turnover_`i'=. if teacher==0 replace teacher_turnover=1 if teacher_`i'==0 & teacher_`n'==1 & isco_`i'>0 } replace teacher_turnover=. if teacher==0 *gen social and health worker turnover (0 if no turnover, 1 if turnover, . if not teacher) gen social_turnover=(social_work_1==1 & social_work_2==0 & isco_2>0) gen social_turnover_2=(social_work_2==0 & social_work_1==1 & isco_2>0) replace social_turnover_2=. if social_work==0 forvalues i = 3(1)20 { local n=`i'-1 gen social_turnover_`i'=(social_work_`i'==0 & social_work_`n'==1 & social_turnover!=1 & isco_`i'>0) replace social_turnover_`i'=. if social_work==0 replace social_turnover=1 if social_work_`i'==0 & social_work_`n'==1 & isco_`i'>0 } replace social_turnover=. if social_work==0 *nursery turnover (0 if no turnover, 1 if turnover, . if not teacher) gen nursery_turnover=(nursery_1==1 & nursery_2==0 & isco_2>0) gen nursery_turnover_2=(nursery_2==0 & nursery_1==1 & isco_2>0) replace nursery_turnover_2=. if nursery==0 forvalues i = 3(1)20 { local n=`i'-1 gen nursery_turnover_`i'=(nursery_`i'==0 & nursery_`n'==1 & nursery_turnover!=1 & isco_`i'>0) replace nursery_turnover_`i'=. if nursery==0 replace nursery_turnover=1 if nursery_`i'==0 & nursery_`n'==1 & isco_`i'>0 } replace nursery_turnover=. if nursery==0 ******POSITIVE TEACHER TURNOVER - start to teach after other profession *there are 18% of teachers that didnt started as teachers (positive change) and 18% of teachers switchers gen positive_turnover=(teacher_1==0 & teacher_2==1 & isco_1>0) forvalues i = 3(1)20 { local n=`i'-1 replace positive_turnover=1 if teacher_`i'==1 & teacher_`n'==0 & isco_`n'>0 } replace positive_turnover=. if teacher==0 gen switcher=(teacher_turnover==1 & positive_turnover==1) replace switcher=. if teacher==0 gen re_enter=. forvalues i = 3(1)20 { forvalues n = `i'(-1)2 { replace re_enter=1 if teacher_`i'==1 & teacher_turnover_`n'==1 & isco_`n'>0 } } *table - number of observations, % of teachers in the sample, % of turnovers btw. teachers table country, c(n teacher sum teacher mean teacher sum teacher_turnover mean teacher_turnover) format(%12.3f) cell(20) row *---------------------------- Experience as teacher (number of years) ---------------------------------------------------------- *uprava dat - year started first job replace year_start_job_1=year_finish_edu if year_start_job_1==-1 & start_first_job==1 & year_finish_edu!=-1 & year_finish_edu!=-2 & year_finish_edu!=. replace year_start_job_1=year_finish_edu if year_start_job_1==-2 & start_first_job==1 & year_finish_edu!=-1 & year_finish_edu!=-2 & year_finish_edu!=. *year when respondent stop in this job equal 9997 if he/she is still in this job - replace it with 2017 *also replace those who start job earlier than finished the previous job forvalues i = 1(1)19 { local n=`i'+1 replace year_stop_job_`i'=2017 if year_stop_job_`i'==9997 replace year_start_job_`n'=year_stop_job_`i' if year_start_job_`n'100 *******intervals for teacher experience gen teacher_exp=1 if teacher_experience!=. & teacher_experience<=2 & teacher==1 replace teacher_exp=2 if teacher_experience!=. & teacher_experience>2 & teacher_experience<=5 & teacher==1 replace teacher_exp=3 if teacher_experience!=. & teacher_experience>5 & teacher_experience<=10 & teacher==1 replace teacher_exp=4 if teacher_experience!=. & teacher_experience>10 & teacher_experience<=30 & teacher==1 replace teacher_exp=5 if teacher_experience!=. & teacher_experience>30 & teacher==1 label define teacher_exp 1 "0-2 years" 2 "3-5 years" 3 "6-10 years" 4 "11-30 years" 5 ">30 years", replace label values teacher_exp teacher_exp label list teacher_exp *******gen year when they start teaching gen year_start_teaching=. replace year_start_teaching=year_start_job_1 if teacher_1==1 forvalues i=2(1)20 { local n=`i'-1 replace year_start_teaching=year_start_job_`i' if teacher_`i'==1 & teacher_`n'==0 & year_start_teaching==. } /* *------------------------------- REGIONS -------------------------------------------------- *South - Italy, Spain, Greece, Portugal, Cyprus gen region=1 if country==15 | country==16 | country==19 | country==33 | country==53 *West - Austria, Germany, France, Switzerland, Belgium, Luxembourg, Malta, Netherlands, Ireland replace region=2 if country==11 | country==12 | country==17 | country==20 | country==23 | country==31 | country==59 | country==14 | country==30 *North - Sweden, Denmark, Finland, Estonia replace region=3 if country==13 | country==18 | country==55 | country==35 *East - Czech, Poland, Hungary, Slovenia, Lithuania, Latvia, Slovakia replace region=4 if country==28 | country==29 | country==32 | country==34 | country==48 | country==57 | country==63 *South East - Croatia, Bulgaria, Romania replace region=5 if country==47 | country==51 | country==61 label define region 1 "South" 2 "West" 3 "North" 4 "East" 5 "SouthEast", replace label values region region labellist region *Yes - Czech, Poland, Hungary, Slovenia, Lithuania, Latvia, Slovakia (East countries) - without Croatia, Bulgaria, Romania (in 1990s still in war conditions) gen post_communist=1 if country==28 | country==29 | country==32 | country==34 | country==48 | country==57 | country==63 *No - West countries: Austria, Germany, France, Switzerland, Belgium, Luxembourg, Malta replace post_communist=0 if country==11 | country==12 | country==17 | country==20 | country==23 | country==31 | country==59 /* 11 Austria 12 Germany 13 Sweden 14 Netherlands 15 Spain 16 Italy 17 France 18 Denmark 19 Greece 20 Switzerland 23 Belgium 25 Israel 28 Czech Republic 29 Poland 30 Ireland 31 Luxembourg 32 Hungary 33 Portugal 34 Slovenia 35 Estonia 47 Croatia 48 Lithuania 51 Bulgaria 53 Cyprus 55 Finland 57 Latvia 59 Malta 61 Romania 63 Slovakia */ *desc region table region, c(n teacher sum teacher mean teacher sum teacher_turnover mean teacher_turnover) format(%12.3f) cell(20) row */ *-------------------------------- CORRECTIONS REGIONS - because of not coded isco -------------- gen not_coded=(isco_1==-7) table country,c(count not_coded sum not_coded mean not_coded) row *South - Italy, Spain, Greece, Portugal gen region=1 if country==15 | country==16 | country==19 | country==33 *West - Austria, France, Switzerland, Belgium, Luxembourg, Netherlands, Ireland replace region=2 if country==11 | country==17 | country==20 | country==23 | country==31 | country==14 | country==30 *North - Sweden, Denmark replace region=3 if country==13 | country==18 *East - Czech, Poland, Slovenia, Slovakia ??Estonia replace region=4 if country==28 | country==29 | country==34 | country==63 *South East - Croatia, Bulgaria replace region=5 if country==47 | country==51 label define region 1 "South" 2 "West" 3 "North" 4 "East" 5 "SouthEast", replace label values region region label list region drop if region==. *drop - Hungary, Lithuania, Cyprus, Finlandia, Latvia, Malta, Romania, Germany (because they were also partly under comunism) *Estonia (beacause I cant have it north regions if I compare change in turnover after 1990, but I cant have it with East reg) *----------------------------------------------------------------------------------------------- *----------------------------------- DURATION + JOB after turnover + WAGE diff ----------------------------------- *year of teacher turnover gen year_turnover=. *year of social worker turnover gen year_turnover_social=. *po kolikatem zamestnani se rozhodl pro odchod ze skolstvi gen njob_turnover=. *duration (in years) of the last job before turnover gen duration_job_turn = . *isco after turnover gen isco_after_turnover=. *job industry after turnover gen industry_after_turnover=. *job sector after turnover (private/public/self-employed) gen sector_after_turnover=. *job sector before turnover (private/public/self-employed) - where they teach gen sector_before_turnover=. *reasons after turnover gen reasons_after_turnover=. *gap after turnover gen gap_after_turnover=. *done in gap after turnover (if responded that 'had a gap of 6 months or more before starting new job') gen done_after_turnover=. *wage before turnover (first monthly wage in job) gen wage_before=. *currency of wage before turnover gen curr_wage_before=. *wage after turnover (first monthly wage in job) gen wage_after=. *currency of wage after turnover gen curr_wage_after=. *job description after turnover - to form blue/white collar turnovers gen job_desc_after=. forvalues i = 1(1)15 { local n=`i'+1 replace year_turnover=year_start_job_`n' if teacher_turnover_`n'==1 & year_turnover==. replace year_turnover_social=year_start_job_`n' if social_turnover_`n'==1 & year_turnover_social==. replace njob_turnover=`i' if teacher_turnover_`n'==1 & njob_turnover==. replace duration_job_turn=year_start_job_`n'-year_stop_job_`n' if teacher_turnover_`n'==1 & duration_job_turn==. replace isco_after_turnover=isco_`n' if teacher_turnover_`n'==1 & isco_after_turnover==. replace industry_after_turnover=job_industry_`n' if teacher_turnover_`n'==1 & industry_after_turnover==. replace sector_before_turnover=job_sector_`i' if teacher_turnover_`n'==1 & sector_before_turnover==. replace sector_after_turnover=job_sector_`n' if teacher_turnover_`n'==1 & sector_after_turnover==. replace reasons_after_turnover=reasons_left_job_`i' if teacher_turnover_`n'==1 & reasons_after_turnover==. replace gap_after_turnover=gap_after_job_`i' if teacher_turnover_`n'==1 & gap_after_turnover==. replace done_after_turnover=done_in_gap_`i' if teacher_turnover_`n'==1 & done_after_turnover==. replace wage_before=first_month_wage_`i' if teacher_turnover_`n'==1 & wage_before==. replace curr_wage_before=currency_wage_`i' if teacher_turnover_`n'==1 & curr_wage_before==. replace wage_after=first_month_wage_`n' if teacher_turnover_`n'==1 & wage_after==. replace curr_wage_after=currency_wage_`n' if teacher_turnover_`n'==1 & curr_wage_after==. replace job_desc_after=job_desc_`n' if teacher_turnover_`n'==1 & job_desc_after==. display `n' } *years between the start of the first job and teacher turnover gen turnover_work_time=year_turnover-year_start_job_1 if teacher_turnover==1 *age at the teacher turnover gen age_turnover=year_turnover-yrbirth if teacher_turnover==1 *age at the social turnover gen age_turnover_social=year_turnover_social-yrbirth if social_turnover==1 *upravy promennych replace year_turnover=. if year_turnover<0 replace year_turnover_social=. if year_turnover_social<0 replace duration_job_turn=. if duration_job_turn<0 | duration_job_turn>100 replace turnover_work_time=. if turnover_work_time<0 | turnover_work_time>100 replace age_turnover=. if age_turnover<0 replace age_turnover_social=. if age_turnover_social<0 replace industry_after_turnover=. if industry_after_turnover<0 replace sector_after_turnover=. if sector_after_turnover<0 replace sector_before_turnover=. if sector_before_turnover<0 replace job_desc_after=. if job_desc_after<0 forvalues i=1(1)20 { replace year_start_job_`i'=. if year_start_job_`i'<0 | year_start_job_`i'>2020 //Year started job } ***blue/white collar *high-skilled white collar - job_desc/isco = 1,2,3 *low-skilled white collar - job_desc/isco = 4, 5 *high-skilled blues collar - job_desc/isco = 6, 7 *low-skilled blues collar - job_desc/isco = 8,9 *armed forces are excluded tostring isco_after_turnover, gen (isco_after) replace isco_after=substr(isco_after, 1,1) destring isco_after, replace replace isco_after=. if isco_after_turnover<0 gen occupation_after=1 if job_desc_after==1 | job_desc_after==2 | job_desc_after==3 replace occupation_after=1 if isco_after==1 | isco_after==2 | isco_after==3 replace occupation_after=2 if job_desc_after==4 | job_desc_after==5 | isco_after==4 | isco_after==5 replace occupation_after=3 if job_desc_after==6 | job_desc_after==7 | isco_after==6 | isco_after==7 replace occupation_after=4 if job_desc_after==8 | job_desc_after==9 | isco_after==8 | isco_after==9 label define occupation_after 1 "high-skilled white" 2 "low-skilled white" 3 "high-skilled blue" 4 "low-skilled blue", replace label values occupation_after occupation_after label list occupation_after **MALE gen male=1 if gender==1 replace male=0 if gender==2 **n children replace n_children=. if n_children<0 *----------------------------------------------------------------------------------------------- *----------------------- TEACHER'S CHARACTERISTICS -------------------------------- *----------------------------------------------------------------------------------------------- *---------- compare individual characteristics of teachers - 1962-72 vs 1977-87 ---------------- *----------------------------------------------------------------------------------------------- **weights - merge weights from w3 and individual weights in ShareLife w7 gen weights=weights_ind_SHL if w3==. replace weights=weights_ind_w3 if w3==1 *----------------------------------------------------------------------------------------------- *---------------------- create 2 groups of teachers - by decades ----------------------------- *----------------------------------------------------------------------------------------------- *gen year when they start teaching replace year_start_teaching=. if year_start_teaching<0 *alternative division according to the year when they started their first job sum year_start_job_1, det *10th decile (1950) and 90th decile (1981) - 50s vs 70s gen group_all=1 if year_start_job_1>=1970 & year_start_job_1<=1985 replace group_all=0 if year_start_job_1>=1950 & year_start_job_1<=1965 *----------------------------------------------------------------------------------------------- *---------------------- ISCED level - teachers and their parents ----------------------------- *----------------------------------------------------------------------------------------------- *----------------------- prepare vars ---------------- **education levels of respondent gen resp_edu=1 if isced_resp==0 | isced_resp==1 | isced_resp==2 //none, primary or lower sec replace resp_edu=2 if isced_resp==3 | isced_resp==4 //secondary replace resp_edu=3 if isced_resp==5 | isced_resp==6 //tertiary label define resp_edu 1 "primary" 2 "secondary" 3 "tertiary", replace label values resp_edu resp_edu labellist resp_edu **uni - teachers gen resp_uni=(isced_resp==5 | isced_resp==6) replace resp_uni=. if isced_resp==. *****PARENTS **at least one with uni edu gen parents_uni=(isced_father==5 | isced_father==6 | isced_mother==5 | isced_mother==6) replace parents_uni=. if isced_father==. & isced_mother==. *****MARTIAL STATUS gen divorced=(martial_status==5) replace divorced=. if martial_status==. gen widowed=(martial_status==6) replace widowed=. if martial_status==. gen never_married=(martial_status==4) replace never_married=. if martial_status==. gen married=(martial_status==1) replace married=. if martial_status==. gen ever_married=(martial_status==1 | martial_status==2 | martial_status==3 | martial_status==5 | martial_status==6) replace ever_married=. if martial_status==. *----------------------- descriptive stats ------------------------------------ hist year_start_job_1 **vek sum vek_2017 [aw=weights] sum vek_2017 if teacher==1 [aw=weights] ***ALL *numbers tab group_all, mis tab teacher if weights!=., mis *gender tab male [aw=weights] tab male group_all [aw=weights], col nofreq reg male group_all [aw=weights] tab male teacher [aw=weights],col tab male group_all if teacher==1 [aw=weights], col nofreq reg male group_all if teacher==1 [aw=weights] table region if teacher==1 [aw=weights], c(n male mean male) format(%12.3f) cell(20) row table region if teacher==1 [aw=weights], by(group_all) c(n male mean male) format(%12.3f) cell(20) row //group = 1 means 70s reg male group_all if region==2 & teacher==1 [aw=weights] //diff is significant for West (more men as teachers in 70s) *respondent education tab resp_edu [aw=weights] tab resp_edu group_all [aw=weights], col nofreq reg resp_uni group_all [aw=weights] tab resp_edu teacher [aw=weights],col tab resp_edu group_all if teacher==1 [aw=weights], col nofreq reg resp_uni group_all if teacher==1 [aw=weights] table region if teacher==1 [aw=weights], c(n resp_uni mean resp_uni) format(%12.3f) cell(20) row table region if teacher==1 [aw=weights], by(group_all) c(n resp_uni mean resp_uni) format(%12.3f) cell(20) row //group = 1 means 70s reg resp_uni group_all if region==2 & teacher==1 [aw=weights] //diff is significant for West (more men as teachers in 70s) *PARENTS EDU **at least one with uni edu tab parents_uni [aw=weights] tab parents_uni group_all [aw=weights], col nofreq reg parents_uni group_all [aw=weights] tab parents_uni teacher [aw=weights],col tab parents_uni group_all if teacher==1 [aw=weights], col nofreq reg parents_uni group_all if teacher==1 [aw=weights] table region if teacher==1 [aw=weights], c(n parents_uni mean parents_uni) format(%12.3f) cell(20) row table region if teacher==1 [aw=weights], by(group_all) c(n parents_uni mean parents_uni) format(%12.3f) cell(20) row //group = 1 means 70s reg parents_uni group_all if region==2 & teacher==1 [aw=weights] //(more men as teachers in 70s) * N children mean n_children [aw=weights] mean n_children if group_all==0 [aw=weights] mean n_children if group_all==1 [aw=weights] reg n_children group_all [aw=weights] mean n_children if teacher==1 [aw=weights] mean n_children if group_all==0 & teacher==1 [aw=weights] mean n_children if group_all==1 & teacher==1 [aw=weights] reg n_children group_all if teacher==1 [aw=weights] table region if teacher==1 [aw=weights], c(n n_children mean n_children) format(%12.3f) cell(20) row table region if teacher==1 [aw=weights], by(group_all) c(n n_children mean n_children) format(%12.3f) cell(20) row //group = 1 means 70s reg n_children group_all if region==2 & teacher==1 [aw=weights] // (more men as teachers in 70s) *MARTIAL STATUS tab martial_status [aw=weights] tab ever_married [aw=weights] tab ever_married group_all [aw=weights], col nofreq reg ever_married group_all [aw=weights] tab ever_married teacher [aw=weights], col nofreq tab ever_married group_all if teacher==1 [aw=weights], col nofreq reg ever_married group_all if teacher==1 [aw=weights] table region if teacher==1 [aw=weights], c(n ever_married mean ever_married) format(%12.3f) cell(20) row table region if teacher==1 [aw=weights], by(group_all) c(n ever_married mean ever_married) format(%12.3f) cell(20) row //group = 1 means 70s reg ever_married group_all if region==2 & teacher==1 [aw=weights] // (more men as teachers in 70s) *----------------------------------------------------------------------------------------------- *-------------------- Teachers characteristics - those who exit teaching ------------------- *----------------------------------------------------------------------------------------------- *----------------------- descriptive ---------------- **GENDER table region if male==0, c(sum teacher mean teacher_turnover) format(%12.3f) cell(20) row table region if male==1, c(sum teacher mean teacher_turnover) format(%12.3f) cell(20) row reg teacher_turnover male if region==2 **AGE - start to teach at their 31 or older gen age_start_teach=year_start_teaching-yrbirth replace age_start_teach=. if age_start_teach<15 | age_start_teach>60 gen start_teach_before_31=(age_start_teach<=30) replace start_teach_before_31=. if age_start_teach==. reg teacher_turnover start_teach_before_31 //no significant difference tab teacher_turnover start_teach_before_31, col tab teacher_turnover start_teach_before_31, col nofreq ***MARRIED TEACHERS gen martial_status_teacher=0 if teacher==1 *kolko rokov pred tym, ako zacala ucit uz bola vydata - i.e. positive if teacher married before teaching/ negative if married after start teaching gen married_teacher=(year_start_teaching-year_married_1) *replace if divorced before start teaching replace married_teacher= year_start_teaching-year_married_2 if year_start_teaching>=year_divorced_1 & year_divorced_1>0 replace martial_status_teacher=1 if married_teacher>0 & married_teacher!=. //married before teaching *did she married while teaching? - add years of experience - now if positive, she married before or while teaching; otherwise after teaching replace married_teacher=married_teacher+teacher_experience replace martial_status_teacher=2 if married_teacher>0 & married_teacher!=. & martial_status_teacher!=1 //married while teaching replace martial_status_teacher=3 if married_teacher==0 & martial_status_teacher!=1 & martial_status_teacher!=2 //married and stop teaching in same year replace martial_status_teacher=. if year_start_teaching==. label define martial_status_teacher 0 "not married" 1 "married before teaching" 2 "married while teaching" 3 "stop teaching when married", replace label values martial_status_teacher martial_status_teacher labellist martial_status_teacher *desc stat tab martial_status_teacher if teacher==1 tab martial_status_teacher teacher_turnover, row tab martial_status_teacher teacher_turnover, row nofreq *indicator whether teacher was married or not during teaching gen teacher_not_married=(martial_status_teacher==0 | martial_status_teacher==3) replace teacher_not_married=. if martial_status_teacher==. tab teacher_not_married teacher_turnover, row *region tab teacher_not_married region if teacher==1, col nofreq tab teacher_turnover region if teacher_not_married==1, col nofreq tab teacher_turnover region if teacher_not_married==0, col nofreq reg teacher_turnover teacher_not_married if region==1 reg teacher_turnover teacher_not_married //33% difference reg teacher_turnover teacher_not_married if male==0 //28.6 reg teacher_turnover teacher_not_married if male==1 //41.3 **teacher turnover rate among not married teachers is higher than for married teachers across all levels of teacher experience tab teacher_exp teacher_turnover if teacher_not_married==0, row nofreq tab teacher_exp teacher_turnover if teacher_not_married==1, row nofreq * reg teacher_turnover teacher_not_married //33% difference *****EDUCATION - teacher with graduate degree tab resp_uni teacher_turnover tab resp_uni teacher_turnover, row nofreq tab teacher_turnover region if resp_uni==0, col nofreq tab teacher_turnover region if resp_uni==1, col nofreq reg teacher_turnover resp_uni if region==1 tab resp_uni region if teacher==1, col nofreq