long to wide transformation with of panel data with many variables

Joined
Apr 1, 2012
Messages
1
Reaction score
0
Hello, I've seen some solutions to simple 'long to wide' transformation on the Internet, but I haven't found this anywhere, though it is so common when working with panel/longitudinal data. I therefore would be very much obliged if you could let me know how to transform the so-called long format of data like this:

country year gdp taxes gini ...
Chile 1970 4.2 17 45
Chile 1971 4.8 18 46
.
.
.
Chile 2010 8.1 26 43
USA 1970 15.2 23 36
USA 1971 16.3 24 35
.
.
.
USA 2010 26.8 37 39
.
.
.

into the wide format:

country vars 1970 1971 ... 2010
Chile gdp 4.2 4.8 ... 8.1
Chile taxes 17 18 ... 26
Chile gini 45 46 ... 43
USA gdp 15.2 16.3 ... 26.8
USA taxes 23 24 ... 37
USA gini 36 35 ... 39
. .
. .
. .

So, many countries, many variables and... yeah, it would save a lot of my time if you could help me :)

Kind regards and thanks in advance.
 
Back
Top