Converting a Panel Page to a Cross-Section Page

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

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

aruoba
Posts: 4
Joined: Thu Jan 12, 2017 3:48 pm

Converting a Panel Page to a Cross-Section Page

Postby aruoba » Thu Jan 12, 2017 4:05 pm

Hello

I have a panel page with multiple variables that is annual from 1990 2015 and 250 cross-sections.

I have an undated page with 250 observations.

I want to create variables in the undated page that corresponds to the averages of the same variables in the panel page, possibly changing the sample along the way (averaged not over the full 1990 2015 sample but a narrower sample that may include an if command -- so let's just say I have a sample object sample_use I want to apply to the averaging). Obviously the 250 cross-sections in the panel exactly will correspond to the 250 observations in the undated page.

What's the code I need to run for this? I tried a few obvious things but they didn't work.

Many thanks

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

Re: Converting a Panel Page to a Cross-Section Page

Postby EViews Gareth » Thu Jan 12, 2017 4:13 pm

In the undated page create a series equal to @trend+1. Something like:

Code: Select all

series id = @trend+1


In the panel page create a series equal to the cross-section id:

Code: Select all

series id = @crossid


Then copy the series you want from the panel to the undated and do a paste-special. Change the "Merge by" setting to General Match Merge, change the contraction method to Mean, and enter "id" as the two id series.
Follow us on Twitter @IHSEViews

aruoba
Posts: 4
Joined: Thu Jan 12, 2017 3:48 pm

Re: Converting a Panel Page to a Cross-Section Page

Postby aruoba » Thu Jan 12, 2017 5:51 pm

Perfect, thank you!

If it's easy for you, can you write the code to do the copying (I got the first two commands)? I'll figure it out otherwise.

Thanks either way for the quick response!

aruoba
Posts: 4
Joined: Thu Jan 12, 2017 3:48 pm

Re: Converting a Panel Page to a Cross-Section Page

Postby aruoba » Fri Jan 13, 2017 7:30 am

I've got it. For those who are interested, here it is:

Code: Select all

copy(smpl=sample_use, overwrite) panel_all\INFLATION * @src id @dest id


here "sample_use" is a sample object I created to do the averaging and INFLATION is the series I am copying from the panel page "panel_all". By default eviews takes an average so no need to specify that, it seems.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 23 guests