Hello everyone,
I am new to Stata and currently trying to create a bar chart that shows GDP data from two different countries over a certain period of time. I figured out how to create a bar chart with only one country but now I would like to add bars that indicate a value for another country in the same graph. What I would like to show in the graph is the comparison of quarterly GDP values of two different countries. Here is my code:
graph twoway (bar obsvalue qdate if country == "DEU", color(gs8)) ///
(bar obsvalue qdate if country == "ITA", color(black)) ///
ytitle("Gross Value Added in Million US$") xtitle("Period") ///
xlabel(232 "Q1/2018" 233 "Q2/2018" 234 "Q3/2018" 235 "Q4/2018" 236 "Q1/2019" ///
237 "Q2/2019" 238 "Q3/2019" 239 "Q4/2019" 240 "Q1/2020" 241 "Q2/2020", angle(45)) ///
legend(order(1 "Germany" 2 "Italy"))
When I execute this code I always get the error message: ) required. I really cannot figure out where in the code the brackets are missing.
I would really appreciate any advise how to fix that problem.
Related Posts with Twoway graph with two bars in one diagram
Combining two datasets and keeping specific observationsI have two datasets. Dataset A and Dataset B. Dataset A is my existing data that I have organized an…
compare value different variable and rowshello, I want to compare values of two varible in diffrent rows. For example vr1 vr2 10 20 20 30 40 …
table summarizing 3 categorical variables in string form between two groups (binary variable)Hello, I am having a hard time finding examples of summary tables between two groups let's say stud…
Split String Code: clear input HAVE WANT1 WANT2 AA01 AA 01 AZ02 AZ 02 AV03 AV 03 AA04 AA 0…
New version of wridit on SSCThanks as always to Kit Baum, a new version of the wridit package is now available for download from…
Subscribe to:
Post Comments (Atom)
0 Response to Twoway graph with two bars in one diagram
Post a Comment