Page 1 of 1

Converting a Panel Page to a Cross-Section Page

Posted: Thu Jan 12, 2017 4:05 pm
by aruoba
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

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

Posted: Thu Jan 12, 2017 4:13 pm
by EViews Gareth
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.

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

Posted: Thu Jan 12, 2017 5:51 pm
by aruoba
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!

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

Posted: Fri Jan 13, 2017 7:30 am
by aruoba
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.