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 on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: rearranging cross-section to longitudinal cross-section


From   "Steve Martin" <stephen.martin@york.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: rearranging cross-section to longitudinal cross-section
Date   Sun, 13 Nov 2011 19:34:46 -0000

Hi Kristen,

I think that you need to use 

reshape long

here.

Steve

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Kristen Shorette
Sent: 13 November 2011 19:19
To: statalist@hsphsun2.harvard.edu
Subject: st: rearranging cross-section to longitudinal cross-section

Hi All,

I have a data set that's arranged as:

       year1  year2 year3...
case1
case2
case3...

and I'd like to rearrange it to look like:

case1 year1
case1 year2
case1 year3
case2 year1...

Is there a way to automatically do this in Stata? (I'm on version 10)

Thanks,
Kristen

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

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