/* ms2_fig2.do do-file to generate figure 2 for SJ manuscript: "Accomodating covariates in ROC analysis". Janes H, Longton G, and Pepe M. last update: 4/14/2008 uses Norton neonatal audoilogy dataset: nnhs2.dta and -roccurve- version 1.3.9 or later -grc1leg-, a contributed program written to combine graphs with a common legend (written by Statacorp's Vince Wiggins), must be installed: .net from http://www.stata.com/users/vwiggins .net install grc1leg */ version 10.0 set scheme sj use http://labs.fhcrc.org/pepe/book/data/nnhs, clear local commonopts scheme(`scheme') yscale(titlegap(*.3)) xscale(titlegap(*.3)) /// title(, size(3.2) margin(b=2 t=2) bmargin(t=0) linegap(1.5) ) /// xtitle(FPR,size(*.8)) ytitle(TPR,size(*.8)) local legend legend(ring(0) position(6) bmargin(b=19 r=10) /// region(lstyle(foreground) lw(vvthin) margin(1 1 1 1)) /// label(1 DPOAE) keygap(*.6) symx(*.8) /// size(*.9) title(,margin(b=0) size(*.7))) roccurve d y1, adjcov(currage gender) adjm(linear) cl(id) /// name(g1, replace) /// title("empirical pv" "empirical ROC") /// `commonopts' /// `legend' roccurve d y1, adjcov(currage gender) adjm(linear) cl(id) /// pvcm(normal) /// name(g2, replace) /// title("normal pv" "empirical ROC") /// `commonopts' /// legend(off) roccurve d y1, adjcov(currage gender) adjm(linear) cl(id) /// pvcm(normal) rocm(parametric) /// name(g3, replace) /// title("normal pv" "binormal ROC") /// `commonopts' /// legend(off) // xsize() and ysize() region_options are unrecognized by grc1leg // due to use of -graph combine, nodraw `name' - and // subsequent -graph draw, `name'-. // So, must set these with subsequent -graph display- grc1leg g1 g2 g3 , imargin(l=2 r=2 b=2 t=2) /// graphregion(margin(l=0 r=0 t=0 b=0)) /// scheme(`scheme') ring(0) position(5) /// title("") /// name(g5, replace) graph display g5, xsize(6.55) ysize(6.5)