Hallo everybody
I have a problem with exporting my graphs in png format in a loop. It only saves one graph with the title of the local macro:
"wellbeing_affraid wellbeing_nervous wellbeing_panic wellbeing_concern"?
My code looks like this:
cd "E:\Projectdata"
use Input\studypopulation, clear
local anxiety wellbeing_affraid wellbeing_nervous wellbeing_panic wellbeing_concern
foreach var of local anxiety {
twoway hist `var', freq yla(,format(%5.0f) ang(h)) width(1) discret xla(0/4, valuelabel noticks) barw(0.8) ytitle(Antal gravide kvinder)
graph export "Graphs/`anxiety'.png", as(png) replace
}
I really can't figure out what's the problem with the export command?
Kind regards Frank
Related Posts with Problem with exporting graphs in a loop
Regression with propensity scoreDear all I am trying to estimates the dynamic treatment effect while using propensity scores. I woul…
reshaping long-long (?) data (all variables and observations in the single column)Dear all, I have data from the IEA that looks like this: Code: * Example generated by -dataex-. To…
Stata 17 - how to get forest plots with risk ratio and not log risk ratioHi I am new to Stata 17 meta analysis forest plots. I am analysing binary data for treatment(Yes/No)…
Plotting the slopeGood day Statalisters! Is there a command in Stata where I can plot a curve using the lower bound a…
Calculate shares by variable and a conditionHi Stata Users, I have household data and would like to calculate age specific enrollment rates i.e…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with exporting graphs in a loop
Post a Comment