I have an excel spreadsheet (downloaded from the not-so-versatile IMF) organized with country, year and data series all in rows. I can't seem to convert it into a proper panel data, in which the country and year are in rows but the data value is in columns.
for instance:
Country | Year| Data Series ID | Value
A | 1990| NGDP| 130283
A | 1991| NGDP| 920912
A | 1990| CPI | 102
A | 1991| CPI| 132
A | 1990| TOT| 103
A | 1991| TOT| 105
ought to look like:
Country| Year| Data series ID1 (NGDP) | Data series ID2 (CPI)| Data series ID3 (TOT)
A | 1990 | 130283 | 102 | 103
A | 1991 | 920912 | 132 | 105
This is for more than just 1 country--I just did one to illustrate the current structure of the database. Thanks in advance for any help you can provide.
stack/unstack data
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: stack/unstack data
Not quite sure where EViews comes in to play. The example you give is perfect panel data to begin with (at least as far as EViews is concerned).
Re: stack/unstack data
It leaves me with a series called "Value", which contains around 35 different variables. These 35 should be the series. I can't do anything with a series that mashes together all of these variables. Suggestions?
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: stack/unstack data
I think this will work...
In the workfile window menu select Proc/Reshape Current Page/Unstack in New Page....
The unstacking identifier is the data series ID. The observation identifiers are both the cross-section identifier and the period identifier.
You'll need to do some massaging of the series names on the output page.
In the workfile window menu select Proc/Reshape Current Page/Unstack in New Page....
The unstacking identifier is the data series ID. The observation identifiers are both the cross-section identifier and the period identifier.
You'll need to do some massaging of the series names on the output page.
Who is online
Users browsing this forum: No registered users and 2 guests
