******************************************************************************** ******************************************************************************** *** Input of daily wages of baseline projection, economy 4.0 scenario *** and calculation of wage inequality ******************************************************************************** ******************************************************************************** * PATH cd "P:\JBNST\" ******************************************************************************** *** Input of daily wages - baseline projection import excel Art=A wz=B beruf=C j1995=D j1996=E j1997=F j1998=G j1999=H /// j2000=I j2001=J j2002=K j2003=L j2004=M j2005=N j2006=O j2007=P j2008=Q /// j2009=R j2010=S j2011=T j2012=U j2013=V j2014=W j2015=X j2016=Y j2017=Z /// j2018=AA j2019=AB j2020=AC j2021=AD j2022=AE j2023=AF j2024=AG j2025=AH /// j2026=AI j2027=AJ j2028=AK j2029=AL j2030=AM j2031=AN j2032=AO j2033=AP /// j2034=AQ j2035=AR using "AUSLESE_BBLG_BPTG.xlsx", sh("V_0") clear drop if beruf==. reshape long j, i(Art wz beruf) j(jahr) gen art = 1 if Art=="BBLG" replace art = 2 if Art=="BPTG" drop Art reshape wide j, i(wz beruf jahr) j(art) rename j1 lohn replace lohn = lohn*1000000000 rename j2 bptg isid wz beruf jahr drop if lohn == 0 drop if bptg == 0 * Sort by average wage gen lohnet = lohn/bptg sort jahr lohnet * Summing up emloyment shares by jahr: gen ranget = sum(bptg) by jahr: egen sumet = total(bptg) gen kumant = ranget/sumet * Mark upper and lower 20% gen ant20 = 1 if kumant <= 0.2 gen ant80 = 1 if kumant >= 0.8 * Wage totals bysort jahr ant20: egen lohn20 = total(lohn) if ant20==1 bysort jahr ant80: egen lohn80 = total(lohn) if ant80==1 bysort jahr: sum lohnet * Calculate inequality measure bysort jahr ant20 ant80: keep if _n==1 drop if ant20==. & ant80==. collapse (mean) lohn20 lohn80, by(jahr) gen ungleich = lohn80/lohn20 lab var ungleich "baseline projection (REF)" * Save data save LohnungleichheitTagBasis, replace ******************************************************************************** *** Input of daily wages - economy 4.0 scenario import excel Art=A wz=B beruf=C j1995=D j1996=E j1997=F j1998=G j1999=H /// j2000=I j2001=J j2002=K j2003=L j2004=M j2005=N j2006=O j2007=P j2008=Q /// j2009=R j2010=S j2011=T j2012=U j2013=V j2014=W j2015=X j2016=Y j2017=Z /// j2018=AA j2019=AB j2020=AC j2021=AD j2022=AE j2023=AF j2024=AG j2025=AH /// j2026=AI j2027=AJ j2028=AK j2029=AL j2030=AM j2031=AN j2032=AO j2033=AP /// j2034=AQ j2035=AR using "AUSLESE_BBLG_BPTG.xlsx", sh("V_4.0") clear drop if beruf==. reshape long j, i(Art wz beruf) j(jahr) gen art = 1 if Art=="BBLG" replace art = 2 if Art=="BPTG" drop Art reshape wide j, i(wz beruf jahr) j(art) rename j1 lohn replace lohn = lohn*1000000000 rename j2 bptg isid wz beruf jahr drop if lohn == 0 drop if bptg == 0 * Sort by average wage gen lohnet = lohn/bptg sort jahr lohnet * Summing up emloyment shares by jahr: gen ranget = sum(bptg) by jahr: egen sumet = total(bptg) gen kumant = ranget/sumet * Mark upper and lower 20% gen ant20 = 1 if kumant <= 0.2 gen ant80 = 1 if kumant >= 0.8 * Wage totals bysort jahr ant20: egen lohn20_w4 = total(lohn) if ant20==1 bysort jahr ant80: egen lohn80_w4 = total(lohn) if ant80==1 * Save statistics bysort jahr: asdoc tabstat lohnet, stat(mean sd min max) format(%9.2f) replace * Calculate inequality measure bysort jahr ant20 ant80: keep if _n==1 drop if ant20==. & ant80==. collapse (mean) lohn20_w4 lohn80_w4, by(jahr) gen ungleich_w4 = lohn80_w4/lohn20_w4 lab var ungleich_w4 "alternative scenario (W4.0)" * Save data save LohnungleichheitTagW4, replace ******************************************************************************** *** Compare inequality * Merge merge 1:1 jahr using LohnungleichheitTagBasis drop _merge tset jahr lab var jahr "Year" twoway (tsline ungleich_w4) (tsline ungleich, ytitle("S80/S20") /// xlabel(1995(5)2035)) graph export "Wageinequality.png", replace as(png) /// width(4800) height(3200)