stack/unstack data
Posted: Mon Aug 03, 2015 10:00 am
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.
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.