cap prog drop fig3 * prog def fig3 * clear use /usr/local/stata/auto mat A=(0) makfun for pri, x(A) y(4) z(mean mpg) cap erase 3dfig3a.gph di "generating fig 3a" di hidlin makfun, x(-1 1 .2) y(3200 16000 200) e(1 -1000 -3) c saving(3dfig3a) glo xye x(-1 1 .025) y(3200 8000 50) e(1 -2000 -5) cap erase 3dfig3b.gph di "generating fig 3b" di hidlin makfun, $xye b c l(x) saving(3dfig3b) hltex clean mat2mac hlZfun 1 tx1 %6.1f mat2mac hlZfun 2 tx2 %6.1f glo hlTexl mag(80). . . . Domestic . $tx1 glo hlTexr mag(80). . . . Foreign . $tx2 cap erase 3dfig3c.gph di "generating fig 3c" di hidlin makfun, $xye b l(x) xm(15) ym(22) t tm(70) saving(3dfig3c) glo hlText1 mag(100)Average 'mpg' in the quartiles of 'price' by 'foreign' glo hlTexb2 hidlin makfun, $xye ... glo hlTexb1 ... box lines(x) xmar(15) ymar(22) tex tmag(70) glo hlTexc GvM cap erase 3dfig3d.gph di "generating fig 3d" di hidlin makfun, $xye b l(x) xm(15) ym(22) t tm(70) saving(3dfig3d) cap erase 3dfig3.gph di "generating fig 3, which contains 3a, 3b, 3d" di gr using 3dfig3a 3dfig3b 3dfig3d, saving(3dfig3) end *