Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: controlling the time series operator in panel data


From   <[email protected]>
To   <[email protected]>
Subject   st: controlling the time series operator in panel data
Date   Thu, 26 Sep 2002 15:24:13 -0300 (BRT)

Hi Stata users,

Please, I need help to change the dataset below (in the wide format) to
long format. Note that the reshape command is not enough to do this
transformation.

            panel     time      schooling   wage
  1.         1          1996       15      3,800
  2.         1          1996       16      3,500
  3.         1          1996       14      3,850
  4.         1          1997       15      3,999
  5.         1          1997       16      4,000
  6.         2          1997       15      4,258
  7.         2          1998       16      4,854
  8.         2          1998       14      4,555
  9.         2          1998       16      4,159
 10.         2          1998       16      4,369
 11.         2          1998       15      4,758
 12          3          1999        .         .
 13          3          1999        .         .
 14          3          1999        .         .
 15          4          2000       17      4,999
 16          4          2000       17      4,870
 17          4          2000       17      4,899
 18          4          2000       16      5,000
 19          4          2000       17      5,409
 20          5          2001       17      5,398
 21          5          2001       17      5,478
 22          5          2001       16      5,369


***************************************************************
 ***** I need the data in this format (with the year controlling the time
series operator) ********************

            panel     time      schooling   wage
  1.         1          1996       15      3,800
  2.         1          1997       16      3,500
  3.         1          1998       14      3,850
  4.         1          1999       15      3,999
  5.         1          2000       16      4,000
  6.         1          2001       15      4,258
  7.         2          1996       16      4,854
  8.         2          1997       14      4,555
  9.         2          1998       17      4,159
 10.         2          1999       16      4,369
 11.         2          2000       15      4,758
 12.         2          2001       15      4,500
 13.         3          1996       .         .
 17.         3          1997       .         .
 18          3          1998       .         .
 19          3          1999       .         .
 20          3          2000       .         .
 21          3          2001       .         .
 22          4          1996       17      5,000
 23          4          1997       17      5,000
 24          4          1998       16      5,699
 25          4          1999       17      5,300
 26          4          2000        .       .
 27          4          2001        .       .
 29          5          1996       17      5,444
 30          5          1997       16      5,788
 31          5          1998       17      5,666
 32          5          1999       17      5,999
 33          5          2000       17      6,000
 34          5          2001       .        .

 Any help would be appreciated.

Thanks

Paulo Loureiro
Universidade Cat�lica de Bras�lia




*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index