Page 1 of 1

pageunstack

Posted: Thu Jun 04, 2009 11:40 am
by fnarita
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

Re: pageunstack

Posted: Thu Jun 04, 2009 11:50 am
by EViews Gareth
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

Re: pageunstack

Posted: Thu Jun 04, 2009 12:23 pm
by fnarita
Thank you so much!! Your code works well. You're great!
I'm really grateful for your quick and precise reply!

Many thanks,
Futoshi