Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: nested reshape question


From   John Levendis <[email protected]>
To   [email protected]
Subject   st: nested reshape question
Date   Thu, 5 Apr 2007 01:36:32 -0700 (PDT)

Hello, 

I’ve got a question regarding 2nd level nesting of reshape. At least, I think that’s what I need. 

I have a dataset in the following wide format: 

Country Trade Yr1990 Yr1991 
---------------------------------------------------------------- 
Armenia imports 105 120 
Armenia exports 90 100 
Armenia GDP 1000 1500 
Bolivia imports 200 230 
Bolivia exports 80 115 
Bolivia GDP 2000 2500 
Columbia imports 100 105 
Columbia exports 70 71 
Columbia GDP 3000 3500 


I would like to reshape the data into a long format resembling: 

Country Year Imports Exports GDP 
------------------------------------------------------ 
Armenia 1990 105 90 1000 
Armenia 1991 120 100 1500 
Bolivia 1990 200 80 2000 
Bolivia 1991 230 115 2500 
Columbia 1990 100 70 3000 
Columbia 1991 105 71 3500 


Any suggestions on how to do this? 

Thanks in advance. 

--John 


------------------------------------ 
John Levendis 
Assistant Professor of Economics 
Loyola University New Orleans 
6363 St. Charles Avenue, Box 15 
New Orleans, LA 70118-6143 
------------------------------------

*
*   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