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, statalist.org is already up and running.


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

st: Transforming data - horizontal to vertical


From   lreine ycenna <lreine.ycenna@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Transforming data - horizontal to vertical
Date   Wed, 11 May 2011 09:43:11 +0100

Hi all,
I need to re-convert my data into the stata format (vertical). What
command do I use?

I have a list of countries and variables to sort.

My data look like this currently:

var year USA AUS
x 1997  0.1   0.1
x 1998  0.2   0.5
x 1999  0.1   0.3
x 2000  0.3   0.3

I need it to look like this:

year country x
1997 USA   0.1
1998 USA  0.2
1999 USA  0.1
2000 USA  0.3
1997 AUS  0.1

etc..

lreine
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index