* Berechnung der Fit-Indizes im herkoemmlichen Modell * --------------------------------------------------- * ATTENTION: This Do-File automatically installs * Stata-Ados from the Internet. Comment the section * "Cool-Ados" if you want to install them by hand! clear version 7.0 set more off set memory 90m set matsize 80 *+--------------------------------+ *| INSTALLATION VON ZUSATZMODULEN | *+--------------------------------+ * COOL-ADOS: Diese Ados werden im Folgenden automatisch über das * Internet geladen und installiert. * Das setzt natürlich voraus, dass ihr Rechner eine feste Verbindung * zum Internet hat. Sollte dies nicht der Fall sein müssen Sie die * entsprechenden Ados von Hand installieren. Hinweise hierzu in * Kohler/Kreuter (2001) capture which fitstat if _rc ~= 0 { net from http://www.indiana.edu/~jsl650/spost/ net describe spost } * +----+ * |Data| * +----+ capture use traeg_3 if welle <=97, clear if _rc == 601 { di as text "Data not found. Try to recover" do crtraeg_3 use traeg_3 if welle <=97, clear } * +--------------+ * | Rekodierungen| * +--------------+ * Imputation der Stimmung im HH fuer Einpersonenhaushalte * -------------------------------------------------------- * (Zur exakten Reproduktion der Ergebnisse muessen die markierten * Zeilen Auskommentiert werden) * Reproduzierbarkeit set seed 731 /* Kommentiere fuer Zufallsergebnisse */ gen long r = _n /* Kommentiere fuer Zufallsergebnisse */ * gen long r = uniform() /* Auskommentiere fuer Zufallsergebnisse */ gen split = kons==. sort pid egp hbil split r by pid egp hbil: gen valid = sum(split == 0) by pid egp hbil: gen ikons = kons[int(uniform()*valid)+1] if kons == . replace ikons = kons if ikons == . drop kons replace split = spd==. sort pid egp hbil split r by pid egp hbil: replace valid = sum(split == 0) by pid egp hbil: gen ispd = spd[int(uniform()*valid)+1] if b90 == . replace ispd = spd if ispd == . drop spd replace split = b90==. sort pid egp hbil split r by pid egp hbil: replace valid = sum(split == 0) by pid egp hbil: gen ib90 = b90[int(uniform()*valid)+1] if b90 == . replace ib90 = b90 if ib90 == . drop b90 valid r pid * Lag-15: Zeitraum: 1984-1999 (15-Jahre) * ------------------------------------ sort persnr welle by persnr: gen pil13 = pi[_n-13] by persnr: gen egpl13 = egp[_n-13] by persnr: gen hbill13 = hbil[_n-13] by persnr: gen ikonsl13 = ikons[_n-13] by persnr: gen ispdl13 = ispd[_n-13] by persnr: gen ib90l13 = ib90[_n-13] * Lag-1 * ----- sort persnr welle by persnr: gen pil1 = pi[_n-1] by persnr: gen egpl1 = egp[_n-1] by persnr: gen hbill1 = hbil[_n-1] by persnr: gen ikonsl1 = ikons[_n-1] by persnr: gen ispdl1 = ispd[_n-1] by persnr: gen ib90l1 = ib90[_n-1] * Auswahl der Beobachtungen * ------------------------- * Nur CDU,SPD,FDP,B90 (-> Note 1) gen valid15 = pi ~= . & pil13 ~= . & egp ~= . & egpl13 ~= . gen valid1 = pi ~= . & pil1 ~= . & egp ~= . & egpl1 ~= . * Dummy-Bildung * ------------- quietly { foreach var of varlist pil13 pil1 egp egpl13 egpl1 konf { tab `var', gen(`var'_) mis drop `var' } } * +--------+ * |Analysen| * +--------+ * Apply Design 1 * -------------- * Lag-15 mlogit pi pil13_2-pil13_3 egp_2-egp_6 ikons ispd ib90 hbil age men olds konf_2-konf_4 /* */ if valid15 & mark fitstat, saving(mod1) * Lag-1 mlogit pi pil1_2-pil1_3 egp_2-egp_6 ikons ispd ib90 hbil age men olds konf_2-konf_4 /* */ if valid1 fitstat, saving(mod2) * Apply Design 2 * -------------- * Lag-15 mlogit pi egp_2-egp_6 egpl13_2-egpl13_6 /* */ ikons ispd ib90 ikonsl13 ispdl13 ib90l13 /* */ hbil age men olds konf_2-konf_4 if mark & valid15 fitstat, saving(mod3) * Lag-1 mlogit pi egp_2-egp_6 egpl1_2-egpl1_6 /* */ ikons ispd ib90 ikonsl1 ispdl1 ib90l1 /* */ hbil age men olds konf_2-konf_4 if valid1 fitstat, saving(mod4) * +-------+ * |Ausgabe| * +-------+ matrix mod1 = fs_mod1[1,"N"] \ fs_mod1[1,"r2_mf"] \ fs_mod1[1,"r2_ctadj"] /* */ \ fs_mod1[1,"bic"] \ fs_mod1[1,"bic_p"] \ fs_mod1[1,"lrx2"] /* */ \ fs_mod1[1,"lrx2_df"] \ fs_mod1[1,"lrx2_p"] matrix mod2 = fs_mod2[1,"N"] \ fs_mod2[1,"r2_mf"] \ fs_mod2[1,"r2_ctadj"] /* */ \ fs_mod2[1,"bic"] \ fs_mod2[1,"bic_p"] \ fs_mod2[1,"lrx2"] /* */ \ fs_mod2[1,"lrx2_df"] \ fs_mod2[1,"lrx2_p"] matrix mod3 = fs_mod3[1,"N"] \ fs_mod3[1,"r2_mf"] \ fs_mod3[1,"r2_ctadj"] /* */ \ fs_mod3[1,"bic"] \ fs_mod3[1,"bic_p"] \ fs_mod3[1,"lrx2"] /* */ \ fs_mod3[1,"lrx2_df"] \ fs_mod3[1,"lrx2_p"] matrix mod4 = fs_mod4[1,"N"] \ fs_mod4[1,"r2_mf"] \ fs_mod4[1,"r2_ctadj"] /* */ \ fs_mod4[1,"bic"] \ fs_mod4[1,"bic_p"] \ fs_mod4[1,"lrx2"] /* */ \ fs_mod4[1,"lrx2_df"] \ fs_mod4[1,"lrx2_p"] matrix gof = mod1, mod2, mod3, mod4 matrix rownames gof = "n" "p2MF" "r2adjC" "BIC" "BIC'" "XL" "XLp" matrix colnames gof = "84-99" "(t-1)-t" "84-99" "(t-1)-t" matrix list gof, noheader format(%8.2f) exit