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]

RE: st: long to wide conversion


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: long to wide conversion
Date   Thu, 7 Oct 2010 13:39:12 +0100

In statistics it is usually true that David Cox's solution is more sensible. 

Nick 
n.j.cox@durham.ac.uk 

Ada Ma
Subject: Re: st: long to wide conversion

Ooops sorry correction:
sort id collect_date order_type, stable
by id collect_date order_type: gen seq=_n
reshape drug_code drug_result, i(id collect_date order_type) j(seq)

David Cox's solution might be more sensible, depending on what you wanted to do.


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