Summing Series in Panel Data

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

Nik
Posts: 4
Joined: Thu Feb 16, 2012 8:32 am

Summing Series in Panel Data

Postby Nik » Thu Feb 16, 2012 8:39 am

Hey guys,

I have a panel set up.

I have industries identified by an industry code as the cross-section, and years as the time series identifiers.

IE:

INDCODE YEAR GDP EMP
1 95 25 100
1 96 28 134
1 97 39 148
1 98 56 150
2 95 15 32
2 96 19 22
2 97 25 21
2 98 32 24
etc.

So my question is, how do I combine industries? Like say Indcode 1 is plum farming and Indcode 2 is grain farming, how do I combine the series to get a total GDP for the plum and grain farming sector?

Cheers,
Nik

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

Re: Summing Series in Panel Data

Postby EViews Gareth » Thu Feb 16, 2012 8:42 am

Looks like you don't currently have a panel workfile, rather you have a pool workfile.

In the pool workfile, you can put the two series into a group, and then type "show @rsum(g)" where g is the name of the group.

Or, you could convert your pool into a panel:
http://forums.eviews.com/viewtopic.php?f=7&t=74

Nik
Posts: 4
Joined: Thu Feb 16, 2012 8:32 am

Re: Summing Series in Panel Data

Postby Nik » Thu Feb 16, 2012 9:08 am

Hi Gareth,

Thanks for helping me on this!

I thought I had a panel? I opened the data as a dated panel with a time series identifier and a cross-section identifier.

Here's what it looks like:

Image

NVAL is nominal value added, HRS is hours worked that year. I want to sum NVAL for industries 1 and 2 (indcode 1 and indcode 2). How do I use the @rsum function to do this? I know I should probably just read the chapters in the pdf that came with eviews, and I plan to do this soon, but I need to get these figures sorted out quickly.

Cheers, and thanks for any help you can give,
Nik

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

Re: Summing Series in Panel Data

Postby EViews Gareth » Thu Feb 16, 2012 9:27 am

Sorry, I misunderstood your original post. Yes, you have a panel.

Do this:

Code: Select all

show @sumsby(nval, @obsid)

Nik
Posts: 4
Joined: Thu Feb 16, 2012 8:32 am

Re: Summing Series in Panel Data

Postby Nik » Thu Feb 16, 2012 9:37 am

Hi Gareth,

That seems to give the sum of NVAL for each year for all the industries (I have some 95 of them). If I just want to add industry 1 and 2, how would I do that? (I need to aggregate a number of different industries into larger sector categories).

Cheers,
Nik

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

Re: Summing Series in Panel Data

Postby EViews Gareth » Thu Feb 16, 2012 9:50 am

Code: Select all

smpl if @crossid=1 or @crossid=2 show @sumsby(nval, @obsid)

Nik
Posts: 4
Joined: Thu Feb 16, 2012 8:32 am

Re: Summing Series in Panel Data

Postby Nik » Thu Feb 16, 2012 3:26 pm

okay that seems to work

thanks!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest