* Grafiken zur Regressionsdiagnose version 6.0 set textsize 100 use data1b, clear gen ost = state>=11 & state<=16 gen eigent = renttype == 1 * Median Trace graph flatsize hhinc, connect(m) bands(20) symbol(.) saving(diag1, replace) *Scatterplot-Matrix graph flatsize hhinc hhsize, matrix connect(m) bands(10) s(i) /* */ saving(diag2, replace) * Partial Residual Plot reg flatsize hhinc hhsize ost eigent cprplot hhsize, c(m) ba(20) saving(diag3, replace) *Formen der Nichtlinearität preserve clear set obs 100 * Graphiken für einige nichtlineare Zusammenhänge clear set obs 100 gen x = _n gen y1 = x^3 gen y2 = ln(x) gen y3 = (-50) * x + .5 * x^2 local if "if x == 1 | x == 25 | x == 50 | x == 75 | x==100" gen y1l = y1 `if' lab var y1l "Hyperbolisch" gen y2l = y2 `if' lab var y2l "Logarithmisch" gen y3l = y3 `if' lab var y3l "U-foermig" local opt "bor xlab s(iiiOTS) c(lll...)" graph y1 y2 y3 y1l y2l y3l x, `opt' rescale saving(diag4, replace) pen(234234) restore * Scatterplot-Matrix zur Outlier--Entdeckung * do groutlr *DFbeta reg flatsize hhinc hhsize ost eigent dfbeta graph DF*, oneway box saving(diag6, replace) avplots, saving(diag7, replace) avplot hhinc, s([persnr]) saving(diag8, replace) reg flatsize hhsize ost eigent predict ey, resid reg hhinc hhsize ost eigent predict ex, resid gen absDF = abs(DFhhein) reg ey ex predict yh1 graph ey yh1 ex [w = absDF], bor c(.l) s(Oi) saving(diag9, replace) b1t(e_hhein) /* */ l2t("e_wohngr") sort reg flatsize hhinc hhsize ost eigent predict cooksd, cooksd local max = 4/e(N) gen index = _n graph cooksd index, border yline(`max') symbol(.) ylog saving(diag10, replace) symplot hhinc, saving(diag11, replace) reg flatsize hhinc hhsize ost eigent predict yhat predict rstud, rstud graph rstud yhat, s(.) ba(20) c(m) bor saving(diag12, replace) gen arstud = abs(rstud) graph arstud yhat, s(.) ba(20) c(m) bor saving(diag13, replace) local groups = round(e(N)/100,1) pctile quant = yhat, n(`groups') xtile groups = yhat, c(quant) graph rstud, box by(groups) saving(diag14, replace) gphpen -dmeps -n -r52 -t111 diag1 gphpen -dmeps -n -r52 -t111 diag2 gphpen -dmeps -n -r52 -t111 diag3 gphpen -dmeps -n -r52 -t111 diag4 gphpen -dmeps -n -r52 -t111 diag5 gphpen -dmeps -n -r52 -t111 diag6 gphpen -dmeps -n -r52 -t111 diag7 gphpen -dmeps -n -r52 -t111 diag8 gphpen -dmeps -n -r52 -t111 diag9 gphpen -dmeps -n -r52 -t111 diag10 gphpen -dmeps -n -r52 -t111 diag10 gphpen -dmeps -n -r52 -t111 diag11 gphpen -dmeps -n -r52 -t111 diag12 gphpen -dmeps -n -r52 -t111 diag13 gphpen -dmeps -n -r52 -t111 diag14