clear all set more off cap cd "/users/mlg2296/Dropbox/JEP Risk Selection/" cap cd "C:\Users\Tim\Dropbox\JEP Risk Selection\" use "Do Files/GL_CostRevByClass.dta", clear *--------------------------------------------- *Scatter Figure *--------------------------------------------- cap drop x cap drop y gen x = 0 in 1 replace x = 70000 in 2 gen y = 0 in 1 replace y = 70000 in 2 cap drop sample70 gen sample70 = avg_total_spending<70000 & avg_rev<70000 & therapeutic_class_d~="None ($844)" & number_with_any_spending>=100 & number_with_any_spending!=. twoway /// (scatter y x in 1/2, msymbol(none) connect(l) lpattern(solid) lw(thin) color(gs10)) /// (scatter avg_rev avg_total_spending [aweight= number_with_any_spending] if sample70==1 , msymbol(oh) lpattern(solid) lw(vthick) color(blue)) /// , xlabel(0 "$0" 10000 "$10k" 20000 "$20k" 30000 "30k" 40000 "$40k" 50000 "50k" 60000 "$60k" 70000 "$70k" , grid labsize(small)) /// ylabel(0 "$0" 10000 "$10k" 20000 "$20k" 30000 "30k" 40000 "$40k" 50000 "50k" 60000 "$60k" 70000 "$70k" , grid labsize(small)) /// ytitle("Average Revenue by Group: Premium + RA", size(medsmall)) xtitle("Average Cost by Group", size(medsmall)) /// graphr(c(white) lc(white)) aspectratio(1) /// legend(off ) name(graph3, replace) graph export "FiguresTables`c(dirsep)'Scatter.pdf", replace