pageunstack

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

fnarita
Posts: 15
Joined: Thu Jun 04, 2009 11:15 am

pageunstack

Postby fnarita » Thu Jun 04, 2009 11:40 am

Hi,

I'd like to construct an unstacked panel data set from stacked data in an excel file.
I'm using EViews 5.1.

I attached the excel file that I have.
It contains 3 letter country code (ccode), data year (year), and a variable of interest (kaopen).

I'd like to read it as the format like this: (ccode)_KAOPEN.
For example,
USA_KAOPEN
CAN_KAOPEN
JPN_KAOPEN
... and so forth, and each series contains the time series of KAOPEN of each country.

I thought that "pageunstack" will work.
So, here is my program code, which does not work well.

Code: Select all

pagecreate(page=Capital_Mobility) u 6916 %path = %currentdirectory + "KAOPEN_CI2007.xls" read(A2,na="",t=xls) %path cn year kaopen ccode $ country_name $ pageunstack(namepat="?_*") ccode year @ kaopen
By the way, I prefer to use program codes as I will hand it in to my supervisor.
I will really appreciate it if anyone could give me any suggestion.

Thank you very much,
Futoshi
Attachments
KAOPEN_CI2007.xls
(606.5 KiB) Downloaded 396 times

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

Re: pageunstack

Postby EViews Gareth » Thu Jun 04, 2009 11:50 am

Structure the page as a panel before unstacking it.

I'd do something like this:

Code: Select all

%path = %currentdirectory + "KAOPEN_CI2007.xls" pageload %path pagestruct @date(year) ccode pageunstack(namepat="?_*") ccode year @ kaopen

fnarita
Posts: 15
Joined: Thu Jun 04, 2009 11:15 am

Re: pageunstack

Postby fnarita » Thu Jun 04, 2009 12:23 pm

Thank you so much!! Your code works well. You're great!
I'm really grateful for your quick and precise reply!

Many thanks,
Futoshi


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests