Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: on restructuring of panel datasets


From   [email protected]
To   [email protected]
Subject   st: on restructuring of panel datasets
Date   Thu, 27 Jan 2011 19:47:18 +0000 (GMT)

Dear all,
 
I would like to ask for help with the reorganizing of a panel dataset. I 
have a panel data set with the following structure: 

 
Firm        date      VAR1      VAR2     VAR3 (other vars follow)
1              1              0              1      2   
1              2              1              2      3 
1              3              2              3      1
2              1             .                .       .
2              2             .                .       .
2              3             .                .       .              
3              1
3              2
3              3
 
 
VAR1      VAR2     VAR3 actually are sub-elements of a general variable VAR.

I would like to create the following series where these variables are combined 
in 

a single variable VAR for all firms:
On the example of firm 1, I would like to get:

Firm        date      VAR  
1              1              0               
1              1              1               
1              1              2               
1              2              1               
1              2              2               
1              2              3               
1              3              2              
1              3              3              
1              3              1              
and so on. 

I also have other variables in the dataset but I guess they will be reordered 
automatically with respect to this order.




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index