Dear all,
I would like to produce a graph similar to this one - https://peltiertech.com/images/2013-...mpleChart4.png.
I have data for two variables; count and z by city and week. I would like to have a horizontal bar plot of count by city and a line plot of weekly average of the variable z.
I have tried;
But get the following error
I guess the issue is that I want the bar plot to be by city but line plot (of weekly average of variable z) by week and overlay them.
I have provided a snippet of the data below, any help will be greatly appreciated.
Thank you!
Sincerely,
Milu
I would like to produce a graph similar to this one - https://peltiertech.com/images/2013-...mpleChart4.png.
I have data for two variables; count and z by city and week. I would like to have a horizontal bar plot of count by city and a line plot of weekly average of the variable z.
I have tried;
Code:
graph bar countall, horizontal over(city) || line tmin week
option | not allowed
I have provided a snippet of the data below, any help will be greatly appreciated.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str7 city byte week float(count z) "Boston" 1 3.5 1.9 "Akron" 1 3.1 1.5 "NYC" 1 2.8 -4.1 "Houston" 1 2.5 12.8 "OKC" 1 2.7 1.7 "Boston" 2 2.7 2 "Akron" 2 9.5 1.4 "NYC" 2 5.3 4 "Houston" 2 4.5 11.2 "OKC" 2 2.1 4 "Boston" 3 2.7 1.7 "Akron" 3 9.5 1.4 "NYC" 3 5.3 3.9 "Houston" 3 4.5 10.9 "OKC" 3 2.1 4.3 end
Sincerely,
Milu
Comment