Unstacking six-dimensional panel data

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Unstacking six-dimensional panel data

Postby paues » Mon May 14, 2012 8:08 am

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.
Attachments
testdata.txt
(4.54 KiB) Downloaded 508 times

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

Re: Unstacking six-dimensional panel data

Postby EViews Gareth » Mon May 14, 2012 8:51 am

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

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Unstacking six-dimensional panel data

Postby paues » Wed May 16, 2012 12:04 am

Thanks! Worked wonders!

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Unstacking six-dimensional panel data

Postby paues » Wed May 16, 2012 11:26 am

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?

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

Re: Unstacking six-dimensional panel data

Postby EViews Gareth » Wed May 16, 2012 11:52 am

Just import that second file into the first?

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Unstacking six-dimensional panel data

Postby paues » Wed May 16, 2012 11:55 am

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)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests