Hi,
I want to create a bar graph for multiple variables and combine them in a graph using a loop. But my code only generates a bar graph for the first variable. How can I adjust my code to fix this problem?
My code is:
foreach var of varlist merge1 merge2 merge3 {
foreach var of varlist Beschäftigungsanteil_1 Beschäftigungsanteil_2 Beschäftigungsanteil_3 Beschäftigungsanteil_4 {
graph bar, over (ˋvar') saving (Stellendaten2, replace)
graph bar, over (ˋvar') saving (BHP2, replace)
graph bar, over (ˋvar') saving (Beide2, replace)
graph combine Stellendaten2.gph BHP2.gph Beide2.gph, xcommon ycommon rows(1)
graph export ˋvar'bar.png
}
}
Related Posts with Bar Graph with loop
extract table from multiple pages of the web by Stata ?Hi , I'm now trying to extract data from web " https://ift.tt/2HE5woy" , there are a lot of pages in…
Binary Variable GraphHello all, I simply want to plot a graph with the number of times a binary variable (civil war inci…
Creating Mills RatiosHi all, This is my first post here so I apologise in advance if I've broken any rules, and I also a…
Annualising coefficients in a loopHi all, I am currently working on project about volatility timing. The data I am working with is dai…
How to create variable of relative change?Dear experts, I have a dataset including monthly observations from June 2017 - June 2019, where I w…
Subscribe to:
Post Comments (Atom)
0 Response to Bar Graph with loop
Post a Comment