stacked bar graph across countries

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

stacked bar graph across countries

Postby tvonbrasch » Tue Jan 26, 2016 3:05 am

Hi

I am trying to decompose changes in income across countries. I have made the graph i want in excel (see below), but I do not know how to make it in Eviews

the data is both in the attached excel file and in the attached Eviews workfile. How do you you make a stacked bar graph like this in Eviews?

Thomas

decomp_g.pdf
(89.26 KiB) Downloaded 273 times
Attachments
decomp_g.xlsx
(13.93 KiB) Downloaded 254 times
graph.wf1
(9.42 KiB) Downloaded 211 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: stacked bar graph across countries

Postby EViews Gareth » Tue Jan 26, 2016 7:44 am

Workfile didn't contain any data.

But just open up the Excel file in EViews, then open up the five series as a group. View->Graph->Bar. Select Multiple Series: Stack in single graph. Switch to the Graph Elements->Bar-Area-Pie page and select "Stack positive and negative values separately".
Attachments
decomp_g.wf1
(19.11 KiB) Downloaded 204 times

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Re: stacked bar graph across countries

Postby tvonbrasch » Tue Jan 26, 2016 10:49 am

thanks for this! very useful!

sorry about the data in the workfile, i only copied the groups.

if you look at the attached workfile, the groups
dec_deu
dec_dnk
dec_swe
dec_usa

contains series for the four countries deu, dnk, swe usa.

to create a stacked bar graph as you showed me (say for year=2013), how should i proceed when the workfile is in this time series format?

should i copy the series to a new page to make it consistent with the organisation in the excel format (and if so, how)? or is there a way to generate the stacked bar graph in the current worrkfile?
net_national_income_decomposition.wf1
(84.87 KiB) Downloaded 217 times
thanks again!
Thomas

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Re: stacked bar graph across countries

Postby tvonbrasch » Tue Jan 26, 2016 11:19 am

i see that i can do the same thing from a matrix

Code: Select all

smpl 2013 2013 vector dnk=@convert(dec_dnk) vector deu=@convert(dec_deu) vector swe=@convert(dec_swe) vector usa=@convert(dec_usa) matrix(4,5) aa rowplace(aa,dnk,1) rowplace(aa,deu,2) rowplace(aa,swe,3) rowplace(aa,usa,4)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests