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.