Transpose data with unstack

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

jthodge
Posts: 77
Joined: Tue Oct 21, 2008 5:52 am

Transpose data with unstack

Postby jthodge » Tue Jan 08, 2013 1:52 pm

I'm trying to transpose data using the unstack command and am running across some difficulties. My (undated) workfile has stacked data for a single date, and I simply wish to transpose that data to a new dated page for that single date.

Specifically, I would like to convert follow data:

Code: Select all

WEEKNUM STATE ZWHD 4/3/2010 AL 46 4/3/2010 AK 224 4/3/2010 AZ 49 4/3/2010 AR 46 4/3/2010 CA 84
Into the following format:

Code: Select all

ZWHD_AL ZWHD_AK ZWHD_AZ ZWHD_AR ZWHD_CA 4/3/2010 46 224 49 46 84
I've tried this using the unstack command with WEEKNUM as the observation identifier and STATE as the unstacking identifier. But I receive an error stating that "WEEKNUM is nested within the previous dimensions of the panel structure." I assume this is because there is only one value for WEEKNUM. Any suggestions on how to do this will be appreciated.

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

Re: Transpose data with unstack

Postby EViews Gareth » Tue Jan 08, 2013 3:10 pm

Could you post your workfile?

jthodge
Posts: 77
Joined: Tue Oct 21, 2008 5:52 am

Re: Transpose data with unstack

Postby jthodge » Wed Jan 09, 2013 7:24 am

The sample workfile is attached.
Attachments
example.wf1
(9.41 KiB) Downloaded 368 times

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

Re: Transpose data with unstack

Postby EViews Gareth » Wed Jan 09, 2013 3:26 pm

It is actually really difficult to do in EViews 7. In EViews 8, it works in the normal way. We'll see about folding the change in EViews 8 back in to EViews 7, but until that happens, you might be better off using the EViews 8 Beta to do it.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests