clear set obs 10000 /*10000*/ set seed 0 gen dc1 = 0 replace dc1 = 1 in 1/`=1*_N/5' gen dc2 = 0 replace dc2 = 1 in `=_N/5+1'/`=2*_N/5' gen dc3 = 0 replace dc3 = 1 in `=2*_N/5+1'/`=3*_N/5' gen dc4 = 0 replace dc4 = 1 in `=3*_N/5+1'/`=4*_N/5' gen dc5 = 0 replace dc5 = 1 in `=4*_N/5+1'/`=5*_N/5' gen industry = 0 replace industry = 1 if dc1 == 1 replace industry = 2 if dc2 == 1 replace industry = 3 if dc3 == 1 replace industry = 4 if dc4 == 1 replace industry = 5 if dc5 == 1 label define industry 0 "" 1 "proportional costs" 2 "degressive costs" 3 "progressive costs" 4 "regressive costs" 5 "fixed costs" label value industry industry *bys industry: gen q = _n *bys industry: gen q = 150 *bys industry: gen q = 100 + exp(rnormal(2,1)) bys industry: gen q = 140 gen p = 1 gen r_noshock = q * p /* Umsatz Vorjahresmonat */ *gen r = max(r_noshock + runiform(-q,q*0.5),0) /* Umsatz Jetzt */ *gen r = max(r_noshock * (1 + -0.01),0) /* Umsatz -1% */ *gen r = max(r_noshock * (1 + -0.1),0) /* Umsatz -10% */ *gen r = max(r_noshock * (1 + -0.2),0) /* Umsatz -20% */ *gen r = max(r_noshock * (1 + -0.31),0) /* Umsatz -30% */ *gen r = max(r_noshock * (1 + -0.5),0) /* Umsatz -50% */ *gen r = max(r_noshock * (1 + -0.71),0) /* Umsatz -70% */ *gen r = max(r_noshock * (1 + -0.99),0) /* Umsatz -100% */ bys industry: gen shock = _n/_N *bys industry: gen r = max(r_noshock * (1 + -shock),0) /* Umsatz Schock */ bys industry: gen r = max(r_noshock * (1 + -shock*industry),0) /* Umsatz Schock */ gen p_shocked = r/q gen c_prop = 0.05 * q /* proportional costs */ gen c_degr = (10 * q)^0.5 /* degressive costs */ gen c_progr = (0.005 * q)^2 /* progressive costs */ gen c_regr = 1000/q /* regressive costs */ *gen f = rnormal(runiform(0,1000),10) /* fixed costs: Mietkosten, Personalkosten, Sozialabgaben, betriebliche Steuern, Versicherungsprämien */ gen f = 100 /* fixed costs: Mietkosten, Personalkosten, Sozialabgaben, betriebliche Steuern, Versicherungsprämien */ /* replace f = 10 if dc1 == 1 replace f = 100 if dc2 == 1 replace f = 200 if dc3 == 1 replace f = 300 if dc4 == 1 replace f = 400 if dc5 == 1 */ gen vc = c_prop if dc1 == 1 replace vc = c_degr if dc2 == 1 replace vc = c_progr if dc3 == 1 replace vc = c_regr if dc4 == 1 replace vc = 0 if dc5 == 1 *replace vc = c_prop /* all proportional costs */ replace vc = f /* all fixed costs */ gen c = vc + f replace c = vc /* all fixed costs */ /*tw (line c q if industry ==1, lp(solid) lw(thick)) (line c q if industry ==2, lp(dash) lw(thick))(line c q if industry ==3, lp(longdash) lw(thick))(line c q if industry ==4, lp(dash_dot) lw(thick))(line c q if industry ==5, lp(longdash_dot) lw(thick)) if c<200 /// , legend( label(1 "proportional") label(2 "degressiv") label(3 "progressiv") label(4 "regressiv") label(5 "fix")) ylabel(#8) xlabel(#8) xtitle(Umsatz) ytitle(Kosten) graph export "${MY_FIGURES_PATH}costs.pdf", replace /*width(1280)*/ */ gen ac = c/q gen exit_c = 0 replace exit_c = 1 if p_shocked1 replace fixed_r = 0 if fixed_r<0 | fixed_r==. /* tw (line avc q if industry ==1, lp(solid) lw(thick)) (line avc q if industry ==2, lp(dash) lw(thick))(line avc q if industry ==3, lp(longdash) lw(thick))(line avc q if industry ==4, lp(dash_dot) lw(thick))(line avc q if industry ==5, lp(longdash_dot) lw(thick)) if q<100 & avc<10 /// , legend( label(1 "proportional") label(2 "degressiv") label(3 "progressiv") label(4 "regressiv") label(5 "fix")) ylabel(#8) xlabel(#8) xtitle(Umsatz) ytitle(Variable Durchschnittskosten) graph export "${MY_FIGURES_PATH}avcosts.pdf", replace /*width(1280)*/ tw (line ac q if industry ==1, lp(solid) lw(thick)) (line ac q if industry ==2, lp(dash) lw(thick))(line ac q if industry ==3, lp(longdash) lw(thick))(line ac q if industry ==4, lp(dash_dot) lw(thick))(line ac q if industry ==5, lp(longdash_dot) lw(thick)) if q<200 & ac<10 /// , legend( label(1 "proportional") label(2 "degressiv") label(3 "progressiv") label(4 "regressiv") label(5 "fix")) ylabel(#8) xlabel(#8) xtitle(Umsatz) ytitle(Durchschnittskosten) graph export "${MY_FIGURES_PATH}acosts.pdf", replace /*width(1280)*/ */ gen exit_vc = 0 replace exit_vc = 1 if p_shocked 0 & beta < 1 replace lbeta = 1 if beta >= 1 /* tw (line beta q if industry ==1, lp(solid) lw(thick)) (line beta q if industry ==2, lp(dash) lw(thick))(line beta q if industry ==3, lp(longdash) lw(thick))(line beta q if industry ==4, lp(dash_dot) lw(thick)) (line beta q if industry ==5, lp(longdash_dot) lw(thick)) if beta>=-5 & beta<5 & q<250 /// , legend( label(1 "proportional") label(2 "degressiv") label(3 "progressiv") label(4 "regressiv") label(5 "fix")) ylabel(#8) xlabel(#8) xtitle(Umsatz) ytitle(Transmissionsfaktor) graph export "${MY_FIGURES_PATH}transmission.pdf", replace /*width(1280)*/ */ bys industry: egen mbeta = mean(beta) bys industry: egen mpi_noshock = mean(pi_noshock) if pi_noshock>0 gen vollhilfe = 0 replace vollhilfe = abs(-r_gr * beta * pi_noshock) if r_gr < 0 & pi_gr < 0 /* Umsatzrückgang * Transmissionsfaktor * Gewinn aus Vorjahresmonat */ /* pi_gr statt r_gr, wegen degressiven Kosten*/ gen verbl_verlust_vollhilfe = (pi + vollhilfe - pi_noshock)/pi_noshock gen p_shocked_vollhilfe = (r+vollhilfe)/q gen exit_vc_vollhilfe = 0 replace exit_vc_vollhilfe = 1 if p_shocked_vollhilfe= -0.7 & r_gr < -0.5 & pi_gr < 0 replace strukturhilfe = skalierung * zielhilfe * 0.4 if r_gr >= -0.5 & r_gr < -0.3 & pi_gr < 0 /* Gewichten mit fixed_share (backward) oder fixed_r (forward) */ gen verbl_verlust = (pi + zielhilfe - pi_noshock)/pi_noshock gen p_shocked_strukturhilfe = (r+zielhilfe)/q gen exit_vc_strukturhilfe = 0 replace exit_vc_strukturhilfe = 1 if p_shocked_strukturhilfe= -0.7 & r_gr < -0.5 replace uehilfeIII = 0.4 * f if r_gr >= -0.5 & r_gr < -0.3 gen verbl_verlustuehilfeIII = (pi + uehilfeIII - pi_noshock)/pi_noshock gen p_shocked_uehilfeIII = (r+uehilfeIII)/q gen exit_c_uehilfeIII = 0 replace exit_c_uehilfeIII = 1 if p_shocked_uehilfeIII 0 gen dstrukturhilfe2 = 0 replace dstrukturhilfe2 = 1 if strukturhilfe2 > 0 gen duehilfeIII = 0 replace duehilfeIII = 1 if uehilfeIII > 0 su verbl_verlust if dstrukturhilfe == 1 su verbl_verlust2 if dstrukturhilfe == 1 su verbl_verlustuehilfeIII if duehilfeIII == 1 tab dstrukturhilfe industry, cell tab dstrukturhilfe2 industry, cell tab duehilfeIII industry, cell bys industry: su exit_vc* bys industry: su exit_c* bys industry: su budget* bys industry: su verbl_verlust* format %10.2f mr_gr . format %10.0f uehilfeIII . format %10.0f strukturhilfe2 . format %10.0f strukturhilfe . format %10.0f vollhilfe . format %10.2f beta . format %10.4f pi_gr . format %10.0f pi . format %10.0f pi_noshock . format %10.0f r_noshock . format %10.2f r_gr . format %10.2f pi_gr . format %10.0f r order r_noshock r r_gr mr_gr pi_noshock pi pi_gr beta vollhilfe strukturhilfe strukturhilfe2 uehilfeIII br r_noshock r r_gr mr_gr pi_noshock pi pi_gr beta vollhilfe strukturhilfe strukturhilfe2 uehilfeIII if r_gr == -0.25 | r_gr == -0.5 | r_gr == -0.75 | r_gr == -1