cd "/Users/dave/Desktop/" use "iprex-km.dta", clear twoway (line event_by time_hiv_wk if time_hiv_wk < 132 & rx=="Placebo", sort lcolor(red) connect(stairstep)) /// (line event_by time_hiv_wk if time_hiv_wk < 132 & rx=="FTC/TDF", sort lcolor(blue) lpattern(solid) connect(stairstep)), /// ytitle(Cumulative Probability of HIV Infection) xtitle(Weeks Since Randomization) /// xlabel(0(12)132) ylabel(0(0.1)1.00, grid) /// legend(off order(1 "Placebo" 2 "FTC/TDF") nobox /// region(fcolor(none) lwidth(none)) position(12) ring(0)) scheme(s1color) graph export "kaplan meier1.pdf", as(pdf) replace twoway (line event_by time_hiv_wk if time_hiv_wk < 132 & rx=="Placebo", sort lcolor(red) connect(stairstep)) /// (line event_by time_hiv_wk if time_hiv_wk < 132 & rx=="FTC/TDF", sort lcolor(blue) lpattern(solid) connect(stairstep)), /// ytitle(Cumulative Probability of HIV Infection) xtitle(Weeks Since Randomization) /// xlabel(0(12)132) ylabel(0(0.02)0.10, grid) /// legend(off order(1 "Placebo" 2 "FTC/TDF") nobox /// region(fcolor(none) lwidth(none)) position(12) ring(0)) scheme(s1color) graph export "kaplan meier2.pdf", as(pdf) replace