I've run into a problem after working with a .do file and dataset to draw a series of graphs, prior iterations of the code (albeit different versions) drew and saved the graphs just fine. There isn't any error message or anything, it just won't save the graph or display it at all. Stata runs the .Do file and then displays "end of .do file" after it.
Here's some example code at the end:
* Loop over each province
foreach primaryprovince of local primaryprovince {
* Generate a line plot of sigacts vs modate for the current province
twoway line sigacts modate if primaryprovince == "`primaryprovince'",
title("Monthly SIGACTs in `primaryprovince', 2005-2014")
xtitle("") ytitle("Total")
legend(off)
tlabel(2005m1(12)2014m12)
xlabel(, angle(vertical))
* Shade the july - January periods in each year
|| recast(area)
line(, y(0) lpattern(shortdash))
if primaryprovince == "`primaryprovince'" &
month(modate) >= 7 &
(month(modate) <= 12 | month(modate) == 1),
color(gs12)
* Add a July marker on the X axis for each year
|| scatteri
7, ypos(0) mcolor(black) msize(large) mlab("July")
if primaryprovince == "`primaryprovince'" &
month(modate) == 7,
* Add a demarcation line on the Prvoince "Kabul" for August 2003 labeled "NATO deployment"
|| line
21.5, yscale(alt) lcolor(blue) lpattern(dash)
text(, position(11 21.5) color(blue) size(large))
if primaryprovince == "`primaryprovince'" &
month(modate) == 8 &
year(modate) == 2003,
yline(, lpatten(shortdash))
* Save the plot as an image
graph export "sigacts_`primaryprovince'.png"
}
Can anyone help me figure out what is going wrong?
Thanks!
Related Posts with Stata Runs .Do File without errors to plot graph but nothing happens
Use of repest for carrying out multilevel analysis with PIAACDear members of the list, I am trying to run a multilevel analysis using PIAAC data. Knowing the c…
reporting prevalence estimates between two groups adjusting for sociodemographic differencesHello STATALIST family. I am interested with reporting prevalence for severity of depressive symptom…
boxplotDear all, I have subdivided my particpants into 3 group based on bmi (0, 1, 2). i want to plot (box …
Merging new variable conditioned on two other observationsHi people, I am currently working on a datasets that consists of customer booking information acros…
Testing for overdispersion glm negative binomial regressionHi, I am working with time series count data. I use Newey-West SEs and therefore need to use the gl…
Subscribe to:
Post Comments (Atom)
0 Response to Stata Runs .Do File without errors to plot graph but nothing happens
Post a Comment