Pivoting 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

Pivoting data?

Postby paues » Mon Oct 08, 2012 8:37 am

I have a text file with monthly data (see attached example.txt) that I want to import. My problem is that the series are written horizontally while EViews assumes that they are written vertically. That is, EViews yields series named e.g. data200903 and not firstser.

Thus, I guess that I would need to pivot the data panel before I can give it a dated structure. I thought that the code below would get me started, but there seems to be some problem with the pagestack command.

Code: Select all

wfopen(type=text) example.txt colhead=1 delim=; pagestack data*
Any help would be much appreciated.
Attachments
example.txt
The data to be pivotted.
(248 Bytes) Downloaded 354 times

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

Re: Pivoting data?

Postby EViews Gareth » Mon Oct 08, 2012 8:51 am

Unfortunately EViews currently doesn't allow opening of transposed data in the WFOPEN command.

Your best bet is to create a workfile of the correct size first, then use the old READ command, which support a (t) option for reading transposed data.

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

Re: Pivoting data?

Postby paues » Tue Oct 09, 2012 12:09 am

I see. It is not possible to transpose data once a workfile has been created using the wfopen command?

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

Re: Pivoting data?

Postby EViews Gareth » Tue Oct 09, 2012 5:23 am

Yes, but in general it requires far more work than using Read.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests