I have summary billing data for 3000+ hospitals across 500+ diagnoses groups. I'm trying to produce twoway graphs for each of the diagnoses groups. The diagnoses groups (variable drg) range 1-900, but there are many missing integers in between. The following code works, but produces many blank graphs.
I therefore tried to use the following code, based on the 2nd method explained in a Stata FAQ here. The code runs without an error, but does not produce any results.
Thanks!
Code:
foreach i of num 1/900 { local t:label(drg)`i' twoway (scatter discharges payments if drg==`i', mlabel(providername) scale(0.4) title("`i' - `t'") ), saving(drg`i', replace) graph export "drg`i'.pdf", replace }
Code:
levelsof drg, local(drgnums) foreach i of local drgnums { local t:label(drg)`i' twoway (scatter discharges payments if drg==`i', mlabel(providername) scale(0.4) title("`i'-`t'")), saving(drg`i', replace) graph export "drg`i'.pdf", replace }
Comment