Page 1 of 1

Transpose data with unstack

Posted: Tue Jan 08, 2013 1:52 pm
by jthodge
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.

Re: Transpose data with unstack

Posted: Tue Jan 08, 2013 3:10 pm
by EViews Gareth
Could you post your workfile?

Re: Transpose data with unstack

Posted: Wed Jan 09, 2013 7:24 am
by jthodge
The sample workfile is attached.

Re: Transpose data with unstack

Posted: Wed Jan 09, 2013 3:26 pm
by EViews Gareth
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.