Page 1 of 1

Unstacking six-dimensional panel data

Posted: Mon May 14, 2012 8:08 am
by paues
I have a colon-separated text file (attached) containing panel data defined by 11 columns: the actual observation values in columns 6-11, annual dates in column 2, and properties for the series (scenario, country, sex and age) in columns 1 and 3-5. I (think that I) have managed to open the data as a workfile. Now I would like to completely unstack the data. From what I can recon from the command reference, the code below should do it.

Code: Select all

close @all wfopen C:\temp\testdata.txt delim=; pagestruct land kon alder @date(ar01) pageunstack(namepat=*?,page=serier) land kon alder ar01 @ bef mbef fodda doda immig emig
However, they are still partly stacked. What am I doing wrong?

P.S. I am using EViews 7.2 Enterprise Edition.

Re: Unstacking six-dimensional panel data

Posted: Mon May 14, 2012 8:51 am
by EViews Gareth
pageunstack only lets you unstack one dimension at a time. One way to get around it is to create a "superid" that has all of the non-date ids in it. Something like:

Code: Select all

alpha superid = kon + "_" + @str(land) + "_" + @str(alder) pageunstack superid ar01

Re: Unstacking six-dimensional panel data

Posted: Wed May 16, 2012 12:04 am
by paues
Thanks! Worked wonders!

Re: Unstacking six-dimensional panel data

Posted: Wed May 16, 2012 11:26 am
by paues
Follow-up question: I have another file, identical to testdata.txt in structure, containing data for an earlier set of years. I would like to merge that data with that in testdata.txt before unstacking the combined data into one-dimensional series. How would I do that?

Re: Unstacking six-dimensional panel data

Posted: Wed May 16, 2012 11:52 am
by EViews Gareth
Just import that second file into the first?

Re: Unstacking six-dimensional panel data

Posted: Wed May 16, 2012 11:55 am
by paues
I figured it out.

Code: Select all

wfopen testdata.txt delim=; import testdata2.txt delim=; @append pagestruct land kon alder @date(ar01) alpha superid=@str(land) + kon + @right("00" + @str(alder),3) pageunstack(namepat=*_?,page=serier) superid @date @ bef pagestruct(freq=a,start=2000)