/* Let's look at the three different scenarios graphically. */ #delimit ; graph twoway (scatter y x) (lfit y x), title("Original Data") xtitle("X") ytitle("Y", orientation(horizontal)) ylabel(0(5)30) ytick(0(1)32) xlabel(0(1)10) name(g1, replace) nodraw; graph twoway (scatter y1 x) (lfit y1 x) (lfit y1 x if y1<23, lpattern(dash) lstyle(p1)), title("Scenario #1") xtitle("X") ytitle("Y", orientation(horizontal)) ylabel(0(5)30) ytick(0(1)32) xlabel(0(1)10) name(g2, replace) nodraw; graph twoway (scatter y2 x) (lfit y2 x) (lfit y1 x if y1<23, lpattern(dash) lstyle(p1)), title("Scenario #2") xtitle("X") ytitle("Y", orientation(horizontal)) ylabel(0(5)30) ytick(0(1)32) xlabel(0(1)10) name(g3, replace) nodraw; graph combine g1 g2 g3, title("Plots of Three Different Data Scenarios") ycommon nocopies; #delimit cr