/* Reproduce Figure on p. 53 */ set scheme s2color #delimit ; graph twoway (lfit sbp age, yaxis(1 2) xaxis(1 2) lcolor(black)) (lfit sbp age if sbp <200, pstyle(p5) lcolor(black) lpattern(dash)) (scatter sbp age, msymbol(O) pstyle(p2) mlwidth(medium) mcolor(black)), title("Figure 5-8: Best fitting straight line of age and systolic blood pressure", size(medium) color(black) position(11) span) subtitle(" ") xtitle("", axis(2)) ytitle("Systolic blood pressure") note("Kleinbaum et al., p. 53", span) xlabel(, axis(1) grid glwidth(vvthin) glcolor(gs10)) xlabel(, axis(2) nolabel noticks) ylabel(100(20)220, glwidth(vvthin) glcolor(gs10) angle(0)) ylabel(100(20)220, axis(2) nolabels noticks) text(224 17.2 "Y") text(100 72 "X") text(168 31 "Y=98.71+0.98X+e", placement(east)) text(125 45 "Y=97.08+0.95X+e", placement(east)) legend(off) aspectratio(1) plotregion(margin(zero)) graphregion(color(white)) name(F58, replace) ; #delimit cr