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
cannot get accurate reault of large number calculationsHi ! I want to generate variable c by a - b, but the result is : c == a?! I don't know why and pleas…
Transpose between row and columnHi all, I know there are lots of posts about transpose, but I still find troubles with my table. I h…
colours for coefplot with matrixHi, I am using Stata16 and would like to produce a multicoloured coefplot from a matrix that contai…
Identify the age-period-cohort effectDear friends, I tried to apply the command of ''apcd''. The code is, Code: use "http://www.louisc…
keeping observation with lowest value and get the median of thatHello, I have a panel data and I want to keep the observation with the minimum value of Days for eac…
Subscribe to:
Post Comments (Atom)
0 Response to Bar Graph with loop
Post a Comment