* Grafiken der Koeffizienten im Analysedesign 1 * --------------------------------------------- clear version 7.0 set memory 40m * +----+ * |Data| * +----+ * crmarg2_1.do gelaufen? * Wenn nicht, jetzt starten und Koeffizienten laden capture use marg2_3, clear if _rc == 601 { do crmarg2_3 use marg2_3 } * +-----------------------+ * |Vorbereitung der Grafik| * +-----------------------+ * Beobachtung fuer die Referenzkategorien * --------------------------------------- count local obs = r(N)+1 set obs `obs' for var spd* cdu* b90*: replace X = 0 in `obs' replace coef = "referenz" in `obs' * Beschriftungen der X-Achsen * --------------------------- * Politische Stimmung im HH gen hhstim = 1 if substr(coef,1,5) == "ikons" replace hhstim = 2 if substr(coef,1,4) == "ispd" replace hhstim = 3 if substr(coef,1,4) == "ib90" lab var hhstim " " lab val hhstim hhstim lab def hhstim 1 "CDU,FDP" 2 "SPD" 3 "B90/Gr." * Klasse gen egp = 0 if coef== "referenz" replace egp = 1 if coef == "egp_2" | coef == "egpl13_2" | coef == "egpl1_2" replace egp = 2 if coef == "egp_3" | coef == "egpl13_3" | coef == "egpl1_3" replace egp = 3 if coef == "egp_4" | coef == "egpl13_4" | coef == "egpl1_4" replace egp = 4 if coef == "egp_5" | coef == "egpl13_5" | coef == "egpl1_5" replace egp = 5 if coef == "egp_6" | coef == "egpl13_6" | coef == "egpl1_6" lab var egp " " lab val egp egp lab def egp 0 "Selb." 1 "Adm. D." 2 "Exp." 3 "Soz. D." /* */ 4 "Mischt." 5 "Arb." * Löschen der Y-Achsenbeschriftung * -------------------------------- for varlist spd* cdu* b90*: label value X blank lab def blank 0 " " * Zum Löschen der X-Achsenbeschriftung * ------------------------------------ gen egpno = egp lab var egpno " " lab val egpno egpno lab def egpno 0 " " 1 " " 2 " " 3 " " 4 " " 5 " " gen hhno = hhstim lab var hhno " " lab val hhno hhno lab def hhno 1 " " 2 " " 3 " " * +--------------------------------------+ * |Zusammenführen der beiden Teilgrafiken| * +--------------------------------------+ capture program drop grtraeg program define grtraeg gph open, saving(`1', replace) graph using g1 graph using g2 graph using g3 graph using g4 gph pen 2 gph point 500 7000 175 1 gph point 500 13000 175 3 gph point 500 22000 175 2 gph pen 1 gph text 675 7500 0 -1 SPD gph text 675 13500 0 -1 CDU/CSU, FDP gph text 675 22500 0 -1 B90/GR. gph text 22500 10000 0 1 Lag-13 gph text 22500 24000 0 1 Lag-1 gph text 22000 16000 0 0 `2' gph font 960 550 gph text 11531 600 1 0 Marginaleffekte gph text 6000 200 1 0 Aktuell gph text 16500 200 1 0 Frueher gph close end * +--------+ * |Grafiken| * +--------+ * Global Options * -------------- local opt `"border yline(0) c(l[-#]l[.]l) sort s(OTS) pen(222) key1(" ") "' local opt `" `opt' gap(3) ytick(-.75(.25).75) rtick(-.75(.25).75) "' local opt `" `opt' yscale(-.8,.75) "' * Aktuelle HH-Stimmung * -------------------- * Lag-15, Aktuell graph spd_13 cdu_13 b90_13 hhno /* */ if coef == "ikons" | coef == "ispd" | coef == "ib90", `opt' /* */ ylab(-.75(.25).75) rlab(0) xlab(1(1)3) /* */ bbox(0,800,13032,17800,900,450,0) saving(g1, replace) * Lag-1, Aktuell graph spd_1 cdu_1 b90_1 hhno /* */ if coef == "ikons" | coef == "ispd" | coef == "ib90", `opt' /* */ rlab(-.75(.25).75) ylab(0) xlab(1(1)3) /* */ bbox(0,15000,13032,32000,900,450,0) saving(g2, replace) * Lag-15, Lagged graph spd_13 cdu_13 b90_13 hhstim /* */ if coef == "ikonsl13" | coef == "ispdl13" | coef == "ib90l13", `opt' /* */ ylab(-.75(.25).75) rlab(0) xlab(1(1)3) /* */ bbox(10031,800,23063,17800,900,450,0) saving(g3, replace) * Lag-1, Lagged graph spd_1 cdu_1 b90_1 hhstim /* */ if coef == "ikonsl13" | coef == "ispdl13" | coef == "ib90l13", `opt' /* */ rlab(-.75(.25).75) ylab(0) xlab(1(1)3) /* */ bbox(10032,15000,23063,32000,900,450,0) saving(g4, replace) grtraeg traeg4a_3 HH-Stimmung * Klasse * ------ * Lag-15, Aktuell graph spd_13 cdu_13 b90_13 egpno /* */ if coef == "referenz" | substr(coef,1,4) == "egp_" , /* */ `opt' xlab(0(1)5) /* */ ylab(-.75(.25).75) rlab(0) /* */ bbox(0,800,13032,17800,900,450,0) saving(g1, replace) * Lag-1, Aktuell graph spd_1 cdu_1 b90_1 egpno /* */ if coef == "referenz" | substr(coef,1,4) == "egp_", /* */ `opt' xlab(0(1)5) /* */ rlab(-.75(.25).75) ylab(0) /* */ bbox(0,15000,13032,32000,900,450,0) saving(g2, replace) * Lag-15, Lagged graph spd_13 cdu_13 b90_13 egp /* */ if coef == "referenz" | substr(coef,1,4) == "egpl" , /* */ `opt' xlab(0(1)5) /* */ ylab(-.75(.25).75) rlab(0) /* */ bbox(10031,800,23063,17800,900,450,0) saving(g3, replace) * Lag-1, Lagged graph spd_1 cdu_1 b90_1 egp /* */ if coef == "referenz" | substr(coef,1,4) == "egpl", /* */ `opt' xlab(0(1)5) /* */ rlab(-.75(.25).75) ylab(0) /* */ bbox(10032,15000,23063,32000,900,450,0) saving(g4, replace) grtraeg traeg4b_3 Klassenzugehoerigkeit erase g1.gph erase g2.gph erase g3.gph erase g4.gph exit