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

Re: st: reshape question


From   "Joel Clovis" <Msrafjc2@fs1.ec.man.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: reshape question
Date   Mon, 16 Sep 2002 19:06:54 +0100

Hi Alejandro,

I had to do a similar job for my data too.

Here is what I would do:

reshape long year, i(country) j(descriptor)
rename year Vars_of_Interest (or whatever they are) 

remember to ensure that country and descriptor are valid (non-string) 
variables... use describe to find out.  if this does not work do get back to 
me.


JC 

From:           	"Riano, Alejandro" <ALEJANDROR@iadb.org>
To:             	statalist@hsphsun2.harvard.edu
Subject:        	st: reshape question
Date sent:      	Mon, 16 Sep 2002 12:54:35 -0400
Send reply to:  	statalist@hsphsun2.harvard.edu

> Hi, i have the a database like this:
> 
> country         descriptor      year1970 year1971 ... year2000
> Argentina          var1                x70          x71              x00
> Argentina          var2                y70          y71              y00
> Bolivia               var1                x70         x71               x00
> Bolivia               var2                y70         y71               y00
> .
> .
> .
> 
> and so on... i want to know if exists a way in which i could reshape this
> wide dataset into a long one that would look like this:
> 
> country         year           var1           var2
> Argentina       1970            x70            y70
> Argentina       1971            x71            y71
>     .
>     .
>     .
>  do you know how could i do the reshape of the two variables jointly ? if i
> use the <reshape> command i'd have to do it one by one.
> 
> Thanks in advance
> 
> Alejandro Riano
> ==========================
> Research Department
> Inter-American Development Bank
> (202) 623-1932
> alejandror@iadb.org
> ==========================
> 
> *
> *   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/


Joel Clovis
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index