Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: stack time-series to paneldata

From   Max Roser <>
Subject   st: stack time-series to paneldata
Date   Wed, 11 May 2011 21:24:57 +0200

have a small question concerning the input of data.
I want to stack Time-series to get a paneldata set.
So what I'd need is something between the stack and the reshape commands.

To clarify. I have data like this

Year    USA    UK    Brasil

2000    12    12    15
2001    13    12    14
2002    14    13    13

and I want

ID        Year        Women

USA    2000        12
USA    2001        13
USA    2002        14
UK    2000        12
UK    2001        12
UK    2002        13
Brazil    2000    15
Brazil    2001    14
Brazil    2002    13

Does anyone have an idea of how to do that?
(I always make as many year-variables as countries and then stack the
data. Obviously its prone to errors and very unelegant)
I need:
take countries as ids and stack them into year and join the value to id
&  year

Using Stata/IC 10.1 Born June 2010 (for Windows)

Best Regards from Rio de Janeiro, Max

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index