* Examples for Leverage und Diskrepancy of the Beatles and St. Pepper version 9 preserve * Create the Data clear set obs 5 input str11 name flatsize65 income65 Ringo 50 2000 George 60 2300 John 70 2800 Paul 80 3000 "Sgt. Pepper" 80 2525 gen income67 = income65 replace income67 = 3400 in 5 reg flatsize65 income67 in 1/4 predict flatsize67 gen income71 = income67 gen flatsize71 = flatsize67 replace flatsize71 = 68 in 5 * Grafik 1 * -------- reg flatsize65 income65 predict yh1 reg flatsize65 income65 in 1/4 predict yh2 graph twoway /// (scatter flatsize65 income65, mlabel(name)) /// (line yh1 yh2 income65, sort) /// , name(g1, replace) legend(off) ytitle(flatsize) * Grafik 2 * -------- reg flatsize67 income67 predict yh3 reg flatsize67 income67 in 1/4 predict yh4 graph twoway /// (scatter flatsize67 income67, mlabel(name)) /// (line yh3 yh4 income67, sort) /// , name(g2, replace) legend(off) ytitle(flatsize) * Grafik 3 * -------- reg flatsize71 income71 predict yh5 reg flatsize71 income71 in 1/4 predict yh6 graph twoway /// (scatter flatsize71 income71, mlabel(name)) /// (line yh5 yh6 income71, sort) /// , name(g3, replace) legend(off) ytitle(flatsize) graph combine g1 g2 g3, rows(3) ysize(6) xcommon ycommon restore